CS201 Assignment 01 Solution

Assignment No.  1
Semester: Fall 2022

CS201 Assignment 01 Solution Fall 2022

Total Marks: 20


Due Date: 05th  December 2022


Please read the following instructions carefully before submitting assignment:

It should be clear that your assignment will not get any credit if:


  1.                   Assignment is submitted after due date.
  2.                  Submitted assignment does not open or file is corrupt.
  3.                 Assignment is copied (From internet/students).


Recommended tool to develop Assignment

•        Dev C++



To enable students to understand and practice the concepts of:

  1.    Data Types and Variables
  2.     Arithmetic and Logical Operators
  3.     Expression Solving
  4.     If-else Statements
  5.     Repetition Structure
  6.     Function



Assignment Submission Instructions

You have to submit only .cpp file on the assignments interface of CS201 from your LMS account. Assignment submitted in any other format(like doc, docx, pdf, giff,jpg etc.) will be scaled with zero mark. So, check your solution file format before submission.

For any query related to assignment, please contact cs201@vu.edu.pk.

Lectures: 1 to 10


CS201 Assignment 01 Solution

Write a C++ program to prompt the user to enter the Scale and then print the Employee’s Basic Pay, House Rent Allowance and Total Pay by using a function.

Calculations are given as:

ScaleSalaryHouse Rent(% of salary)Utility Allowance


Note: The scale should be between 1 and 3 otherwise the system will ask for the correct scale again.

As a result, you should have the following output:

The user enter 1:

If the user enter 2:

The user enter 3:

If the user enters input other than 1, 2 and 3. Then program should prompt the user to enter the correct scale of the employee again.












Lectures Covered: 1 to 10

Due date: 05th December,2022









Leave a Reply

Your email address will not be published. Required fields are marked *