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

CS201 Introduction to Programming Assignment No 01 Solution & Discussion Due Date: 13-05-2019

CS201 Introduction to Programming Assignment No 01 Solution & Discussion Due Date: 13-05-2019

XYZ University wants to track students’ admissions. They need a program in C++ which will automate the process.

  • The program will display the following menu options to user:-

======================================================

Please select the program option, in which you want to enter enrollments.

Please enter option 1 for BCS program.

Please enter option 2 for BIT program.

Please enter option 3 for BBA program.

Please enter option 4 for BA program.

===============================================

  • First the user will select the program option, for any invalid option the program should not perform any calculation and display an error message like:-

           THE PROGRAM NAME IS INVALID, PLEASE TRY AGAIN.

Press any key to continue…

  • On pressing any key from the keyboard, the program should start again from the beginning.
  • Upon entering the valid program option, the program will ask the user to enter students’ enrollment for four years as:-
  • Please enter number of students in Year 1.
  • Please enter number of students in Year 2.
  • Please enter number of students in Year 3.
  • Please enter number of students in Year 4.

 

  • After entering the valid program option and students’ enrollment data for four years, the department name of the program needs to be displayed. (e.g. for BCS & BIT, the department name needs to be DEPARTMENT OF COMPUTER SCIENCE, for BBA, the department name should be DEPRTAMENT OF BUSINESS ADMINISTRATION while for BA, the department name should be DEPARTMENT OF FINE ARTS.)
  • Finally, the program will perform some calculations and will display the following information:-
  • The number of students in each year.
  • The percentage of student’s enrollment in each year against particular program.
  • The total number of students in the program.
  • Also if the number of students enrolled in a year is greater than 100, then display a message that THE NUMBER OF STUDENTS ENROLLED IN THAT YEAR IS OVER THE LIMIT.

      

+ Click Here To Join also Our facebook study Group.

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

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


See Your Saved Posts Timeline

Views: 2581

.

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

Attachments:

Replies to This Discussion

Please Discuss here about this assignment.Thanks

Our main purpose here discussion not just Solution

We are here with you hands in hands to facilitate your learning and do not appreciate the idea of copying or replicating solutions. Read More>>

Discussed & be touched with this discussion. After discussion a perfect solution will come in a result at the end.

 

“How to Join Subject Study Groups & Get Helping Material”

 

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

Cs201 assignment solution
#include <iostream>
#include <cstdlib>

using namespace std;
int main()
{
// All Variable Declared...
int program_option;
int year1;
int year2;
int year3;
int year4;
int studentsSum;

cout "Please Select The Program Options, In Which You Want To Enter Enrollments.\n";
cout "Please Enter Option 1 for BCS program.\n";
cout "Please Enter Option 2 for BIT program.\n";
cout "Please Enter Option 3 for BBA program.\n";
cout "Please Enter Option 4 for BA program.\n";
cout "===================\n";
do {
cout "Please Enter Program Option: ";
cin >> program_option;
if(program_option > 4){
cout "THE PROGRAM NAME IS INVALID, PLEASE TRY AGAIN.\n";
system("pause");
}
} while(program_option > 4);

cout "Please enter number of students in Year 1: ";
cin >> year1;

cout "Please enter number of students in Year 2: ";
cin >> year2;

cout "Please enter number of students in Year 3: ";
cin >> year3;

cout "Please enter number of students in Year 4: ";
cin >> year4;
cout "\n\n";
if(program_option == 1){
cout "==============DEPARTMENT OF COMPUTER SCIENCE==============\n";
} else if(program_option == 2){
cout "==============DEPARTMENT OF COMPUTER SCIENCE==============\n";
} else if(program_option == 3) {
cout "==============DEPRTAMENT OF BUSINESS ADMINISTRATION==============\n";
} else {
cout "==============DEPARTMENT OF FINE ARTS==============\n";
}
cout "\n";

cout "The number of students in year 1 is: ";
cout year1;
cout "\n";

cout "The number of students in year 2 is: ";
cout year2;
cout "\n";

cout "The number of students in year 3 is: ";
cout year3;
cout "\n";

cout "The number of students in year 4 is: ";
cout year4;
cout "\n\n";

studentsSum = year1 + year2 + year3 + year4;

cout "The percentage of students in year 1 is: ";
double percentage = (double)year1 / studentsSum * 100;
cout percentage; cout "%\n";

cout "The percentage of students in year 2 is: ";
percentage = (double)year2 / studentsSum * 100;
cout percentage; cout "%\n";

cout "The percentage of students in year 3 is: ";
percentage = (double)year3 / studentsSum * 100;
cout percentage; cout "%\n";

cout "The percentage of students in year 4 is: ";
percentage = (double)year4 / studentsSum * 100;
cout percentage; cout "%\n";

cout "The total number of students in the program is: ";
cout studentsSum;
cout "\n";

if(studentsSum > 100){
cout "The number of students enrolled in that year is over the limit.";
}
}

Errors

Sir is it completed ????

errors...sir plz mjy ye bta den k errors kewn a rhy??

Complete solution 

A.o.A cs201 a.cpp format solution plz

Dear Students Don’t wait for solution post your problems here and discuss ... after discussion a perfect solution will come in a result. So, Start it now, replies here give your comments according to your knowledge and understandings....

#include <iostream>

using namespace std;

int main(){

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
int stdYear1, stdYear2, stdYear3, stdYear4, ch,total;
float per;
 
do{
    system("CLS");
    cout"===================================="endl;
    cout"Please select the preogram option, in which you wants to enter enrollments."endl;
    cout"Please enter option 1 for BCS program."endl;
    cout"Please enter option 2 for BIT program."endl;
    cout"Please enter option 3 for BBA program."endl;
    cout"Please enter option 4 for BA program."endl;
    cout"=============================================="endl;
    cout"Please enter program option:       ";
    cin>>ch;
    if(ch >= 1 && ch <=4){
            cout"Please enter number of students in Year 1.      ";
            cin>>stdYear1;
            cout"Please enter number of students in Year 2.      ";
            cin>>stdYear2;
            cout"Please enter number of students in Year 3.      ";
            cin>>stdYear3;
            cout"Please enter number of students in Year 4.      ";
            cin>>stdYear4;
    }else if(ch < 1 || ch > 4){
        cout"THE PROGRAM NAME IS INVALID, PLEASE TRY AGAIN."endl;
        system("pause");
    }
    coutendl;
    if(ch == 1 || ch == 2){
        cout"============DEPRTAMENT OF COMPUTER SCIENCE============"endlendl;
}else if(ch == 3){
    cout"===========DEPRTAMENT OF BUSINESS ADMINISTRATION=========="endlendl;
}else if(ch == 4){
    cout"================DEPARTMENT OF FINE ARTS==================="endlendl;
}
        cout"The number of students in year 1 is:    "stdYear1endl;
        cout"The number of students in year 2 is:    "stdYear2endl;
        cout"The number of students in year 3 is:    "stdYear3endl;
        cout"The number of students in year 4 is:    "stdYear4endl;
        coutendl;
        total = stdYear1 + stdYear2 + stdYear3 + stdYear4;
        per   = (float)stdYear1 * 100 / total;
        cout"Ther percentage of students in year 1 is:    "perendl;
        per   = (float)stdYear2 * 100 / total;
        cout"Ther percentage of students in year 2 is:    "perendl;
        per   = (float)stdYear3 * 100 / total;
        cout"Ther percentage of students in year 3 is:    "perendl;
        per   = (float)stdYear4 * 100 / total;
        cout"Ther percentage of students in year 4 is:    "perendl;
        coutendl;
        cout"The total number of students in the program is:       "totalendlendl;
        if(stdYear1 > 100){
            cout"The number of students in year 1 is over the limit."endl;
        }
        if(stdYear2 > 100){
            cout"The number of students in year 2 is over the limit."endl;
        }
        if(stdYear3 > 100){
            cout"The number of students in year 3 is over the limit."endl;
        }
        if(stdYear4 > 100){
            cout"The number of students in year 4 is over the limit."endl;
        }
 
 
}while(ch < 1 || ch > 4);

CS201 Assignment NO.01 Solution
Spring - 2019

#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
// All Variable Declared...
int program_option;
int year1;
int year2;
int year3;
int year4;
int studentsSum;

cout "Please Select The Program Options, In Which You Want To Enter Enrollments.\n";
cout "Please Enter Option 1 for BCS program.\n";
cout "Please Enter Option 2 for BIT program.\n";
cout "Please Enter Option 3 for BBA program.\n";
cout "Please Enter Option 4 for BA program.\n";
cout "===================\n";
do {
cout "Please Enter Program Option: ";
cin >> program_option;
if(program_option > 4){
cout "THE PROGRAM NAME IS INVALID, PLEASE TRY AGAIN.\n";
system("pause");
}
} while(program_option > 4);

cout "Please enter number of students in Year 1: ";
cin >> year1;

cout "Please enter number of students in Year 2: ";
cin >> year2;

cout "Please enter number of students in Year 3: ";
cin >> year3;

cout "Please enter number of students in Year 4: ";
cin >> year4;
cout "\n\n";
if(program_option == 1){
cout "==============DEPARTMENT OF COMPUTER SCIENCE==============\n";
} else if(program_option == 2){
cout "==============DEPARTMENT OF COMPUTER SCIENCE==============\n";
} else if(program_option == 3) {
cout "==============DEPRTAMENT OF BUSINESS ADMINISTRATION==============\n";
} else {
cout "==============DEPARTMENT OF FINE ARTS==============\n";
}
cout "\n";

cout "The number of students in year 1 is: ";
cout year1;
cout "\n";

cout "The number of students in year 2 is: ";
cout year2;
cout "\n";

cout "The number of students in year 3 is: ";
cout year3;
cout "\n";

cout "The number of students in year 4 is: ";
cout year4;
cout "\n\n";

studentsSum = year1 + year2 + year3 + year4;

cout "The percentage of students in year 1 is: ";
double percentage = (double)year1 / studentsSum * 100;
cout percentage; cout "%\n";

cout "The percentage of students in year 2 is: ";
percentage = (double)year2 / studentsSum * 100;
cout percentage; cout "%\n";

cout "The percentage of students in year 3 is: ";
percentage = (double)year3 / studentsSum * 100;
cout percentage; cout "%\n";

cout "The percentage of students in year 4 is: ";
percentage = (double)year4 / studentsSum * 100;
cout percentage; cout "%\n";

cout "The total number of students in the program is: ";
cout studentsSum;
cout "\n";

if(studentsSum > 100){
cout "The number of students enrolled in that year is over the limit.";
}
}

XYZ University wants to track students’ admissions. They need a program in C++ which will automate the process. 
The program will display the following menu options to user:-
======================================================
Please select the program option, in which you want to enter enrollments.
Please enter option 1 for BCS program.
Please enter option 2 for BIT program.
Please enter option 3 for BBA program.
Please enter option 4 for BA program.
===============================================
First the user will select the program option, for any invalid option the program should not perform any calculation and display an error message like:-
THE PROGRAM NAME IS INVALID, PLEASE TRY AGAIN. 
Press any key to continue…
On pressing any key from the keyboard, the program should start again from the beginning.
Upon entering the valid program option, the program will ask the user to enter students’ enrollment for four years as:-
Please enter number of students in Year 1.
Please enter number of students in Year 2.
Please enter number of students in Year 3.
Please enter number of students in Year 4.

After entering the valid program option and students’ enrollment data for four years, the department name of the program needs to be displayed. (e.g. for BCS & BIT, the department name needs to be DEPARTMENT OF COMPUTER SCIENCE, for BBA, the department name should be DEPRTAMENT OF BUSINESS ADMINISTRATION while for BA, the department name should be DEPARTMENT OF FINE ARTS.)
Finally, the program will perform some calculations and will display the following information:-
The number of students in each year.
The percentage of student’s enrollment in each year against particular program.
The total number of students in the program. 
Also if the number of students enrolled in a year is greater than 100, then display a message that THE NUMBER OF STUDENTS ENROLLED IN THAT YEAR IS OVER THE LIMIT.

CS 201 ASSIGMENT 1 SOLUTION 

cs201%20soultion%20%281%29%20%281%29.cpp

RSS

Latest Activity

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

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