iostream> using namespace std; string name; int number; int age; string city;
iostream> using namespace std; string name; int number; int age; string city;
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
#include<iostream>
using namespace std;
string name;
int number;
int age;
string city;
string module1_name;
string module1_code;
int module1_credit;
string module2_name;
string module2_code;
int module2_credit;
int module1_marks;
int module2_marks;
void student_registration()
{
cout<<"\nEnter Student ID: ";
cin>>number;
cout<<"\nEnter Student's name : ";
cin>>name;
cout<<"\nEnter age : ";
cin>>age;
cout<<"\nEnter city : ";
cin>>city;
}
void module_enrolment()
{
cout<<"\nEnter Module1 name : ";
cin>>module1_name;
cout<<"\nEnter Module1 code : ";
cin>>module1_code;
cout<<"\nEnter Module1 credits : ";
cin>>module1_credit;
cout<<"\nEnter Module2 name : ";
cin>>module2_name;
cout<<"\nEnter Module2 code : ";
cin>>module2_code;
cout<<"\nEnter Module2 credits : ";
cin>>module2_credit;
if((module2_credit!=15) &&( module2_credit!=30))
{
if((module1_credit!=15) && (module1_credit!=30))
{
cout<<"\ninvalid credit number \n";
}
}
}
void student_assessment()
{
cout<<"Enter Module1 marks : ";
cin>>module1_marks;
cout<<"Enter Module2 marks : ";
cin>>module2_marks;
}
void search(int s)
{
int op;
cout<<"Enter \n1 for personal data\n2 for module information\n3 for assessment information\n";
cin>>op;
if(op==1)
{
cout<<"Student's Number : "<<number<<"\n\n";
cout<<"Student's Name : "<<name<<"\n\n";
cout<<"Student's Age : "<<age<<"\n\n";
cout<<"Student's city : "<<city<<"\n\n";
}
else if(op==2)
{
cout<<"The Student is enrolled in \n";
cout<<"Module1 code : "<<module1_code<<"\n\n";
cout<<"Module2 code : "<<module2_code<<"\n\n";
cout<<"Module1 name : "<<module1_name<<"\n\n";
cout<<"Module2 name : "<<module2_name<<"\n\n";
cout<<"Module1 credit : "<<module1_credit<<"\n\n";
cout<<"Module2 credit : "<<module2_credit<<"\n\n";
}
else if(op==3)
{
cout<<"Students Scorecard \n\n";
cout<<"Module1 marks : "<<module1_marks<<"\n\n";
cout<<"Module2 marks : "<<module2_marks<<"\n\n";
}
else
{
cout<<"enter a valid choice\n";
}
}
int main()
{
char a;
{
int ch;
cout<<"\n**************************************\n";
cout<<"*WELCOME TO STUDENT MANAGEMENT SYSTEM*\n";
cout<<"**************************************\n";
cout<<"1.Student Registration \n2.Module Enrollment \n3.Student Assessment\n4.Search Student\n5.Exit\nEnter Your Choice(1-5) : ";
cin>>ch;
switch(ch)
{
case 1:{student_registration();break;}
case 2:{
module_enrolment( );
break;
}
case 3:{
student_assessment();
break;
}
case 4:{
int sroo;
cout<<"\nEnter Student number : ";
cin>>sroo;
search(sroo);
break;
}
case 5:{
exit(0);
break;
}
default:{
cout<<"\nEnter a valid choice";
break;
}
}
}while(a=='Y' || a=='y');
return 0;
}
why iam able to enter only one module in the out put where is the mistake
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps

Recommended textbooks for you

Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON

Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science

Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning

Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON

Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science

Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning

Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning

Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education

Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY