can somebody help me?? hehehee
#include<iostream>
using namespace std;
void pilih(char, char[][3], int, int);
void display(char[][3]);
void isi(char*, int, char, char [][3], int);
bool rules(char [][3]);
void decide(bool, int);
void menu();
bool select(char&);
bool menuBack(bool);
char grade( double mark);
int main()
{
char num;
bool back;
do
{
menu();
back = select(num);
}
while(back == true);
system("pause");
}
void menu()
{
cout<<"\n------------WELCOME TO TIC TAC TOE GAME!!----------------"<<endl;
cout<<"---------------------------------------------------------"<<endl;
cout<<"| MENU |"<<endl;
cout<<"| |"<<endl;
cout<<"|1) ABOUT PROGRAMMERS 4) STUDENTS GRADE |"<<endl;
cout<<"| |"<<endl;
cout<<"|2) ABOUT GRADING 5) EXIT |"<<endl;
cout<<"| |"<<endl;
cout<<"|3) INSTRUCTIONS |"<<endl;
cout<<"| |"<<endl;
cout<<"| |"<<endl;
cout<<"| THANK YOU!!! :) |"<<endl;
cout<<"---------------------------------------------------------"<<endl;
}
bool select(char& num)
{
int nums;
bool back2Menu = false;
bool kembali = false;
cout<<"\nEnter your choice: ";
cin>>num;
cout<<endl;
system("cls");
nums = static_cast<int>(num);
nums -= 48;
if(nums>=1 && nums<=5)
{
switch (nums)
{
case 1:
{
cout<<"\n ABOUT PROGRAMMERS "<<endl;
cout<<" ----------------- "<<endl;
cout<<"\n1)SITI FATIMAH BT MORAD 2009868978 EE2503A "<<endl;
kembali = menuBack(back2Menu);
system("cls");
}
break;
case 2:
{
int numStud;
int numTest;
int numQuiz;
cout<<"*******************************************"<<endl;
cout<<"---------Students grade---------------------"<<endl<<endl;
cout<<"Please enter the number of students' data : ";
cin>>numStud;
cout<<"Number of test:";
cin>>numTest;
cout<<"Number of quiz:";
cin>>numQuiz;
string nameStud[numStud];
string id[numStud];
string part[numStud];
string code[numStud];
double test;
double quiz;
double fin;
string gred[numStud];
for(int c = 0; c<numStud; c++)
{
cout<<"Enter student name:";
cin>>nameStud[c];
cout<<"Enter student ID:";
cin>>id[c];
cout<<"Enter part:";
cin>>part[c];
cout<<"Enter course code:";
cin>>code[c];
double totalT = 0;
for(int t=0; t<numTest; t++)
{
cout<<"Enter Test "<<(t+1)<<":";
cin>>test;
totalT += test;
}
double totalQ = 0;
for(int q=0; q<numQuiz; q++)
{
cout<<"Enter Quiz "<<(q+1)<<":";
cin>>quiz;
totalQ += quiz;
}
cout<<"Enter final examination mark : ";
cin>>fin;
fin*=(60/100);
double total = totalT+totalQ+fin;
cout<<"The mark you get: "<<total<<endl;
cout<<"The gred :\n"<<grade(total);
}
return 0;
}
char grade( double mark);
{
char gred='a';
if(mark>=80 && mark<=100)
gred = 'A';
else if(mark>=70 && mark<80)
gred = 'B';
else if(mark>=60 && mark<70)
gred = 'C';
else if(mark>=50 && mark<60)
gred = 'D';
else if(mark>=40 && mark<50)
gred = 'E';
else if(mark>=0 && mark<40)
gred = 'F';
return gred;
}
}
break;
case 3:
{
cout<<"\n INSTRUCTIONS "<<endl;
cout<<" ------------ "<<endl;
cout<<"\n1) Enter the student name properly. "<<endl;
cout<<"2) it is continue by the matrix number without exceed the maximum num of 10. "<<endl;
cout<<"3) Next,enter the part and the course. "<<endl;
cout<<"4) Then,select the place you want to use "<<endl;
cout<<"\n\n THANK YOU!!!"<<endl;
kembali = menuBack(back2Menu);
system("cls");
}
{
menu();
select(num);
}
bool menuBack(bool back2Menu);
char back;
do
{
cout<<"\nBack to menu press 'M' or 'm'."<<endl;
cin>>back;
cout<<endl;
if(back == 'M' || back == 'm')
back2Menu = true;
}
while(back2Menu == false);
return back2Menu;
}
}
Edited by WingedPanther, 09 October 2010 - 04:50 AM.
add code tags (the # button)


Sign In
Create Account

Back to top









