Share:
Notifications
Clear all

Students kindly share assignment files in relevant subject timely for discussion/solution.

or directly share with us " Click here"

[Solved] CS201 Assignment 1 Fall 2020  

  RSS

admin
(@admin)
Admin
Joined: 2 years ago
Posts: 4409
21/11/2020 10:59 pm  

CS201 Introduction to Programming Assignment 1 Solution & Discussion Fall 2020


 

Assignment No.  1
Semester: Fall 2020

CS201 – Introduction to Programming

Total Marks: 20

Due Date:  26-November-2020

Instructions

Please read the following instructions carefully before submitting assignment:

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

o        Assignment is submitted after due date.

o        Submitted assignment does not open or file is corrupt.

o        Assignment is copied (From internet/students).

 

Recommended tool to develop Assignment

-       Dev C++

 

Objectives:

To enable students to understand and practice the concepts of:

  • Data Types and Variables
  • Arithmetic and Logical Operators
  • If-else statements

  

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 will not be accepted and will be scaled with zero marks.

 

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

Assignment

 

       

 

Information about an ABC organization is given below.

1.     There are 10 employees in the organization.

2.     There are 2 employees of level-A, 3 employees of level-B, 5 employees of level-C.

3.     The information about their salaries is given below.

a)     The salary of level-A employee is Rs.1, 25,000.

b)    The salary of level-B employee is Rs.80, 000.

c)     The salary of level-C employee is Rs.45, 000.

4.     Rs.600 is deducted from the salaries of all employees against staff welfare fund.

5.     If ANNUAL salary of an employee is more than Rs.600, 000, 1% tax is deducted from salary each month.

You are required to write a C++ program which finds

1)    Total monthly tax deduction for all employees.

2)    Total amount of welfare fund collected each month from all employees.

3)    Net monthly salary of an employee. (Level-A, level-B, level-C).

(Hint: Net_Monthly_Salary= Original_Salary- Monthly_Tax – Monthly_Welfare_Fund)

4)    Total amount which organization pays to its employees each month.

5)    Also create a menu using (if-else) conditional statements, if a user wants to know about the separate tax collection of Level-A, Level-B, And Level-C employees.

If user enters 1, leve-A employee tax will be shown.

If user enters 2, leve-B employee tax will be shown.

If user enters 1, leve-C employee tax will be shown.

If user inputs wrong number then a message will be shown: “incorrect input”.

Sample Screenshot of Output

 

QueryVU WhatsApp Groups subject wise : Join Now


Quote
admin
(@admin)
Admin
Joined: 2 years ago
Posts: 4409
21/11/2020 11:25 pm  

CS201 Introduction to Programming Assignment 1 Solution & Discussion Fall 2020


CS201 Assignment  1 Fall 2020

 

Solution.

 

 

#include

using namespace std;

main()

{

              long sal_level_a=125000, sal_level_b=80000, sal_level_c=45000;

              int total_employees=10;

              int welfare_fund=600;

              int tax_level_a, total_tax_A, tax_level_b, total_tax_B, tax_level_c,total_tax_C, total_tax;

              int option;

              long Net_salary_A, Net_salary_B, Net_salary_C, total_pay;

             

              // FUNDS

              int total_fund=total_employees*welfare_fund;

             

              long anual_salary_A=sal_level_a*12;

              long anual_salary_B=sal_level_b*12;

              long anual_salary_C=sal_level_c*12;

             

              if(anual_salary_A>600000)

              {

                             tax_level_a=sal_level_a*1/100;

              }

              total_tax_A=tax_level_a*2;

              if(anual_salary_B>600000)

              {

                             tax_level_b=sal_level_b*1/100;

              }

              total_tax_B=tax_level_b*3;

              if(anual_salary_C>600000)

              {

                             tax_level_c=sal_level_c*1/100;

              }

              total_tax_C=tax_level_c*5;

             

              // TAX CALCULATION

              total_tax=total_tax_A+total_tax_B+total_tax_C;

             

             

              // NET SALARIES

              Net_salary_A= sal_level_a - tax_level_a - welfare_fund;

              Net_salary_B= sal_level_b - tax_level_b - welfare_fund;

              Net_salary_C= sal_level_c - tax_level_c - welfare_fund;

             

   //total_pay=(Net_salary_A*2)+(Net_salary_B*3)+(Net_salary_C*5);

              total_pay=(sal_level_a*2)+(sal_level_b*3)+(sal_level_c*5);

             

              cout<<"Total Monthly tax deduction of all employees : "<<total_tax;

              cout<<"\nTotal amount of welfare fund collected : "<<total_fund;

              cout<<"\nNet monthly salary of level A employees : "<<Net_salary_A;

              cout<<"\nNet monthly salary of level B employees : "<<Net_salary_B;

              cout<<"\nNet monthly salary of level C employees : "<<Net_salary_C;

              cout<<"\nTotal amount paid by university after a month : "<<total_pay;

             

              // MENU

              cout<<"\nEnter 1 to know the tax collection of level A employees";

              cout<<"\nEnter 2 to know the tax collection of level B employees";

              cout<<"\nEnter 3 to know the tax collection of level C employees"<<endl;

              cin>>option;

              if(option==1)

              {

                             cout<<"Tax collection of level A employee is Rs. "<<total_tax_A;

              }

              else if(option==2)

              {

                             cout<<"Tax collection of level B employee is Rs. "<<total_tax_B;

              }

              else if(option==3)

              {

                             cout<<"Tax collection of level C employee is Rs. "<<total_tax_C;

              }

}


Execute Online --> http://cpp.sh/2i4a6

Download code in text file.

QueryVU WhatsApp Groups subject wise : Join Now


ReplyQuote

Leave a reply

Author Name

Author Email

Title *

 
Preview 0 Revisions Saved
Share: