Develop the program with Graphics properties
I need to put this statment in my cod =
Bonus Task:
Develop the program with Graphics properties to give a better look to your program. You need to explore
the graphics libraries available in C++ e.g. <Graphic.h>
#include<iostream>
#include<conio.h>
using namespace std;
struct student{
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;
}Student[100];
static int i=0; //to count number of students registered
void student_registration()
{
cout<<"\nEnter Student Number : ";
cin>>Student[i].number;
cout<<"\nEnter Student's name : ";
cin>>Student[i].name;
cout<<"\nEnter age : ";
cin>>Student[i].age;
cout<<"\nEnter city : ";
cin>>Student[i].city;
i++;
}
void module_enrolment(int s_no)
{
int x,flag=0;
for(int j=0;j<i;j++)
{
if(Student[j].number==s_no)
{
x=j;
cout<<"\nEnter Module1 name : ";
cin>>Student[x].module1_name;
cout<<"\nEnter Module1 code : ";
cin>>Student[x].module1_code;
label1: cout<<"\nEnter Module1 credits : "; //if credits are not correctly entered code after label1 will execute again
cin>>Student[x].module1_credit;
if((Student[x].module1_credit!=15) && (Student[x].module1_credit!=30))
{
cout<<"\nenter valid credits for module 1 \n ";
goto label1;
}
cout<<"\nEnter Module2 name : ";
cin>>Student[x].module2_name;
cout<<"\nEnter Module2 code : ";
cin>>Student[x].module2_code;
label2: cout<<"\nEnter Module2 credits : "; //if credits are not correctly entered code after label1 will execute again
cin>>Student[x].module2_credit;
if(Student[x].module2_credit!=15 && Student[x].module2_credit!=30)
{
cout<<"\nenter valid credits for module 2 \n";
goto label2;
}
flag=1;
break;
}
}
if(flag==0)
cout<<"\nStudent not found\n";
}
void student_assessment(int s_no)
{
int y,flag=0;
for(int k=0;k<i;k++)
{
if(Student[k].number==s_no)
{
y=k;
cout<<"Enter Module1 marks : ";
cin>>Student[y].module1_marks;
cout<<"Enter Module2 marks : ";
cin>>Student[y].module2_marks;
flag=1;
break;
}
}
if(flag==0)
cout<<"\nStudent not found\n";
}
void search(int s_no)
{
int z,flag=0;
for(int l=0;l<i;l++)
{
if(Student[l].number==s_no)
{
flag=1;
z=l;
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 : "<<Student[z].number<<"\n\n";
cout<<"Student's Name : "<<Student[z].name<<"\n\n";
cout<<"Student's Age : "<<Student[z].age<<"\n\n";
cout<<"Student's city : "<<Student[z].city<<"\n\n";
}
else if(op==2)
{
cout<<"The Student is enrolled in \n";
cout<<"Module1 code : "<<Student[z].module1_code<<"\n\n";
cout<<"Module1 name : "<<Student[z].module1_name<<"\n\n";
cout<<"Module1 credit : "<<Student[z].module1_credit<<"\n\n";
cout<<"Module2 code : "<<Student[z].module2_code<<"\n\n";
cout<<"Module2 name : "<<Student[z].module2_name<<"\n\n";
cout<<"Module1 credit : "<<Student[z].module2_credit<<"\n\n";
}
else if(op==3)
{
cout<<"Students Scorecard \n\n";
cout<<"Module1 marks : "<<Student[z].module1_marks<<"\n\n";
cout<<"Module2 marks : "<<Student[z].module2_marks<<"\n\n";
}
else
{
cout<<"enter a valid choice\n";
}
flag=1;
break;
}
}
if(flag==0)
cout<<"\nStudent not found!!!\n";
}
int main()
{
char d;
do{
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:{
int sn;
cout<<"\nEnter student number : ";
cin>>sn;
module_enrolment(sn);
break;
}
case 3:{
int sno;
cout<<"\nEnter student number : ";
cin>>sno;
student_assessment(sno);
break;
}
case 4:{
int snoo;
cout<<"\nEnter Student number : ";
cin>>snoo;
search(snoo);
break;
}
case 5:{
exit(0);
break;
}
default:{
cout<<"\nEnter a valid choice";
break;
}
}
cout<<"\nEnter Y/y to continue : ";
cin>>d;
cout<<"\n";
}while(d=='Y' || d=='y');
getch();
return 0;
}
Step by step
Solved in 2 steps