We are here with you hands in hands to facilitate your learning & don't appreciate the idea of copying or replicating solutions. Read More>>

Looking For Something at vustudents.ning.com? Click Here to Search

www.bit.ly/vucodes

+ Link For Assignments, GDBs & Online Quizzes Solution

www.bit.ly/papersvu

+ Link For Past Papers, Solved MCQs, Short Notes & More


Dear Students! Share your Assignments / GDBs / Quizzes files as you receive in your LMS, So it can be discussed/solved timely. Add Discussion

How to Add New Discussion in Study Group ? Step By Step Guide Click Here.

Lesson:  1 to 8. Switch Statement

Due Date: 01.June.2020

Total Marks: 20

+ How to Follow the New Added Discussions at Your Mail Address?

+ How to Join Subject Study Groups & Get Helping Material?

+ How to become Top Reputation, Angels, Intellectual, Featured Members & Moderators?

+ VU Students Reserves The Right to Delete Your Profile, If?


See Your Saved Posts Timeline

Views: 1286

.

+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)

+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)

+ Click Here to Search (Looking For something at vustudents.ning.com?)

+ Click Here To Join (Our facebook study Group)

Attachments:

Replies to This Discussion

Please Discuss here about this assignment.Thanks

Our main purpose here discussion not just Solution

Students having same subject can start discussion here to solve assignment, GDB & Quiz and can clear their concepts until solution is provided. 

 

P.S:    Please always try to add the discussion in proper format title like “CS101 Assignment / GDB No 01 Solution & Discussion Due Date: ___________”

Then copy Questions from assignment file and paste in Discussion.

 

http://bit.ly/vucodes (For Assignments, GDBs & Online Quizzes Solution)

http://bit.ly/papersvu (For Past Papers, Solved MCQs, Short Notes & More)

Click Here to Search (Looking For something at vustudents.ning.com?)

Click Here to Join (Our facebook study Group)

CS201 Introduction to Programming Assignment 1 Solution & Discussion Spring 2020


 

Solution Idea:

 

//program calculate net pay on the basis of increrment, tax deduction on the basis of net salary
#include <iostream>
using namespace std;

main()
{
//delare and initialize the variables
int payScale=0;
int ini_Salary=0;
int inc_Salary=0;
int upd_Salary=0;
int tax_Deduction=0;
int net_Salary=0;

//Main menu
cout"************* SALARY CALCULATOR ***************"endl;
cout"\n************* ***************** ***************"endl;
cout"\n************* Enter 1 for SPS6 ***************"endl;
cout"\n************* Enter 2 for SPS7 ***************"endl;
cout"\n************* Enter 3 for SPS8 ***************"endl;
cout"\n************* Enter 4 for SPS9 ***************"endl;
cout"\nSelect a pay scale from the menue : ";
cin>>payScale;

//switch statement
switch (payScale)
{
case 1:

//calculation
ini_Salary=40000;
inc_Salary = ini_Salary * 20/100;
upd_Salary = ini_Salary + inc_Salary;
tax_Deduction = upd_Salary * 3/100;
net_Salary = ini_Salary + inc_Salary - tax_Deduction;

//display result
cout " Initial Salary: " ini_Salaryendl;
cout " Incremented Salary: " inc_Salaryendl;
cout " Increased Salary: " upd_Salaryendl;
cout " Tax Deduction: " tax_Deductionendl;
cout " Net Salary: " net_Salaryendl;

break;
case 2:
ini_Salary=60000;
inc_Salary = ini_Salary * 15/100;
upd_Salary = ini_Salary + inc_Salary;
tax_Deduction = upd_Salary * 3/100;
net_Salary = ini_Salary + inc_Salary - tax_Deduction;

//display result
cout " Initial Salary: " ini_Salaryendl;
cout " Incremented Salary: " inc_Salaryendl;
cout " Increased Salary: " upd_Salaryendl;
cout " Tax Deduction: " tax_Deductionendl;
cout " Net Salary: " net_Salaryendl;

break;
case 3:

ini_Salary=80000;
inc_Salary = ini_Salary * 10/100;
upd_Salary = ini_Salary + inc_Salary;
tax_Deduction = upd_Salary * 3/100;
net_Salary = ini_Salary + inc_Salary - tax_Deduction;

//display result
cout " Initial Salary: " ini_Salaryendl;
cout " Incremented Salary: " inc_Salaryendl;
cout " Increased Salary: " upd_Salaryendl;
cout " Tax Deduction: " tax_Deductionendl;
cout " Net Salary: " net_Salaryendl;


break;
case 4:

ini_Salary=100000;
inc_Salary = ini_Salary * 5/100;
upd_Salary = ini_Salary + inc_Salary;
tax_Deduction = upd_Salary * 3/100;
net_Salary = ini_Salary + inc_Salary - tax_Deduction;

//display result
cout " Initial Salary: " ini_Salaryendl;
cout " Incremented Salary: " inc_Salaryendl;
cout " Increased Salary: " upd_Salaryendl;
cout " Tax Deduction: " tax_Deductionendl;
cout " Net Salary: " net_Salaryendl;


break;

default:
cout"Selected choice is invalid";

}
}

aoa sir error a rha 

Angle Bracket " " missing h is lie error h yahn paste sai ni hoga code

CS201_SOL1.txt


ok thnks ho giya ab btiya jo bnie dev wo krana submit ya uska output

CS201 Assignment 1 Solution Spring 2020

 Azhar Sagar 

Add youtube embed codes here with proper tilte & despriction, otherwise your youtube will be deleted & your account will be banned. Always add the youtube embed codes in discussion replies, as not start a new discussion. Thanks for understanding.

 

#CS201 solution

cs201%20solution.cpp

-CS201 ASSIGNMENT NO.1 SOLUTION SPRING 2020-

CLICK HERE TODOWNLOAD THE SOLUTION FILE FROM HERE
#include<iostream>
using namespace std;
int main(){
int scale, initialSalary, incrementRate, taxDeductionRate;
float incrementValue, taxValue, netSalary = 0;
cout"*********** SALRY CALCULATOR **************\n";
cout"*******************************************\n";
cout"*********** ENTER 1 FOR SPS6  *************\n";
cout"*********** ENTER 2 FOR SPS7  *************\n";
cout"*********** ENTER 3 FOR SPS8  *************\n";
cout"*********** ENTER 4 FOR SPS9  *************\n";
cout"Select a payscale from the menu : ";
cin>>scale;
if(scale == 1){
initialSalary = 40000;
incrementRate = 20;
taxDeductionRate = 3;
}else if(scale == 2){
initialSalary = 60000;
incrementRate = 15;
taxDeductionRate = 3;
}else if(scale == 3){
initialSalary = 80000;
incrementRate = 10;
taxDeductionRate = 3;
}else if(scale == 4){
initialSalary = 100000;
incrementRate = 5;
taxDeductionRate = 3;
}else{
cout"You enter wrong scale\n";
return 0;
}
incrementValue = ((initialSalary * incrementRate) / 100);
taxValue = (((initialSalary + incrementValue) * taxDeductionRate) / 100);
netSalary = (initialSalary + incrementValue) - taxValue;
cout"Initial Salary : "initialSalary;
cout"\nIncrement Amount : "incrementValue;
cout"\nIncreased Salary : "initialSalary + incrementValue;
cout"\nTex Deduction : "taxValue;
cout"\nNet Salary : "netSalary;
}

CS201 Introduction to Programming Assignment 1 Solution & Discussion Spring 2020


 

Solution Idea:

 

//program calculate net pay on the basis of increrment, tax deduction on the basis of net salary
#include <iostream>
using namespace std;

main()
{
//delare and initialize the variables
int payScale=0;
int ini_Salary=0;
int inc_Salary=0;
int upd_Salary=0;
int tax_Deduction=0;
int net_Salary=0;

//Main menu
cout"************* SALARY CALCULATOR ***************"endl;
cout"\n************* ***************** ***************"endl;
cout"\n************* Enter 1 for SPS6 ***************"endl;
cout"\n************* Enter 2 for SPS7 ***************"endl;
cout"\n************* Enter 3 for SPS8 ***************"endl;
cout"\n************* Enter 4 for SPS9 ***************"endl;
cout"\nSelect a pay scale from the menue : ";
cin>>payScale;

//switch statement
switch (payScale)
{
case 1:

//calculation
ini_Salary=40000;
inc_Salary = ini_Salary * 20/100;
upd_Salary = ini_Salary + inc_Salary;
tax_Deduction = upd_Salary * 3/100;
net_Salary = ini_Salary + inc_Salary - tax_Deduction;

//display result
cout " Initial Salary: " ini_Salaryendl;
cout " Incremented Salary: " inc_Salaryendl;
cout " Increased Salary: " upd_Salaryendl;
cout " Tax Deduction: " tax_Deductionendl;
cout " Net Salary: " net_Salaryendl;

break;
case 2:
ini_Salary=60000;
inc_Salary = ini_Salary * 15/100;
upd_Salary = ini_Salary + inc_Salary;
tax_Deduction = upd_Salary * 3/100;
net_Salary = ini_Salary + inc_Salary - tax_Deduction;

//display result
cout " Initial Salary: " ini_Salaryendl;
cout " Incremented Salary: " inc_Salaryendl;
cout " Increased Salary: " upd_Salaryendl;
cout " Tax Deduction: " tax_Deductionendl;
cout " Net Salary: " net_Salaryendl;

break;
case 3:

ini_Salary=80000;
inc_Salary = ini_Salary * 10/100;
upd_Salary = ini_Salary + inc_Salary;
tax_Deduction = upd_Salary * 3/100;
net_Salary = ini_Salary + inc_Salary - tax_Deduction;

//display result
cout " Initial Salary: " ini_Salaryendl;
cout " Incremented Salary: " inc_Salaryendl;
cout " Increased Salary: " upd_Salaryendl;
cout " Tax Deduction: " tax_Deductionendl;
cout " Net Salary: " net_Salaryendl;


break;
case 4:

ini_Salary=100000;
inc_Salary = ini_Salary * 5/100;
upd_Salary = ini_Salary + inc_Salary;
tax_Deduction = upd_Salary * 3/100;
net_Salary = ini_Salary + inc_Salary - tax_Deduction;

//display result
cout " Initial Salary: " ini_Salaryendl;
cout " Incremented Salary: " inc_Salaryendl;
cout " Increased Salary: " upd_Salaryendl;
cout " Tax Deduction: " tax_Deductionendl;
cout " Net Salary: " net_Salaryendl;


break;

default:
cout"Selected choice is invalid";

}
}

RSS

Today Top Members 

© 2020   Created by +M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service

.