We have been working very hard since 2009 to facilitate in your learning Read More. We can't keep up without your support. Donate Now.

www.bit.ly/vucodes

+ Link For Assignments, GDBs & Online Quizzes Solution

www.bit.ly/papersvu

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

Lesson:  1 to 8. Switch Statement

Due Date: 01.June.2020

Total Marks: 20


+ 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)


Views: 1466

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

Latest Activity

+ ! ! JS ! ! + liked Hafiza Tehreem Fatima's discussion BIRTHDAY CELEBRATION OUR BELOVED <MEMBER SARAH ABDUL
1 hour ago
Hafiza Tehreem Fatima posted a discussion
1 hour ago
+M.Tariq Malik replied to Fragrance of Islam's discussion ENG301 Business Communication GDB No 01 Fall 2020 Solution / Discussion in the group ENG301 Business Communication
1 hour ago
+M.Tariq Malik replied to Fragrance of Islam's discussion ENG301 Business Communication GDB No 01 Fall 2020 Solution / Discussion in the group ENG301 Business Communication
1 hour ago
+M.Tariq Malik replied to +M.Tariq Malik's discussion MTH633 Group Theory Assignment 01 Fall 2020 Solution / Discussion in the group MTH633 Group Theory
1 hour ago
+M.Tariq Malik replied to +M.Tariq Malik's discussion SOC401 Cultural Anthropology Assignment 01 Fall 2020 Solution / Discussion in the group SOC401 Cultural Anthropology
1 hour ago
+M.Tariq Malik replied to +M.Tariq Malik's discussion SOC401 Cultural Anthropology Assignment 01 Fall 2020 Solution / Discussion in the group SOC401 Cultural Anthropology
1 hour ago
+M.Tariq Malik replied to +M.Tariq Malik's discussion SOC401 Cultural Anthropology Assignment 01 Fall 2020 Solution / Discussion in the group SOC401 Cultural Anthropology
2 hours ago
+M.Tariq Malik replied to +M.Tariq Malik's discussion ECO406 Assignment 01 Fall 2020 Solution / Discussion Due Date: 04-12-2020 in the group ECO406 Mathematical Economics
2 hours ago
+M.Tariq Malik liked +M.Tariq Malik's discussion MCM520 Contemporary Mass Media Assignment 01 Fall 2020 Solution / Discussion
2 hours ago
+M.Tariq Malik added a discussion to the group MCM520 Contemporary Mass Media
2 hours ago
Profile IconMalik Ali Raza, Zohaib Anjum, Arooj Shahid and 12 more joined Virtual University of Pakistan
2 hours ago
+M.Tariq Malik replied to Fragrance of Islam's discussion ENG301 Business Communication GDB No 01 Fall 2020 Solution / Discussion in the group ENG301 Business Communication
2 hours ago
+M.Tariq Malik replied to Muhammad Azeem's discussion BNK603 Consumer Banking Assignment No 01 Solution & Discussion FALL 2020 in the group BNK603 Consumer Banking
2 hours ago
+M.Tariq Malik liked Muhammad Azeem's discussion BNK603 Consumer Banking Assignment No 01 Solution & Discussion FALL 2020
2 hours ago
+M.Tariq Malik replied to +M.Tariq Malik's discussion CS302 Assignment 01 Fall 2020 Solution / Discussion in the group CS302 Digital Logic Design
2 hours ago

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

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

.