Quantcast
Channel: CodeGuru Forums - Visual C++ Programming
Viewing all articles
Browse latest Browse all 3029

Question and Answers Program

$
0
0
//This is the only way I know that when a question is been asked it uses the statements below try it out.Only "Grade 1"I repeat Grade 1 only works at the moment for this is still a prototype.I am new to programming please bear with me.Thanks.

#include<iostream>
#include<string>
using namespace std;
using std::string;
//functions
int grade1(void);
//questions
int grade1q1(void);
int grade1q2(void);
int grade1q3(void);
int grade2(void);
int grade3(void);
int grade4(void);


int main()
{
string space ="\n\n\n\n\n\n\n\n\n\n\n\n\n";
string line ="-------------------------------------------------------------------------------";
int start;
int grade;
cout<<"Welcome to the English Guide.\nEnter (1)to continue or (0)to exit.\n\nAnswer:";
cin>>start;
if(start==1){


do{
cout<<"\n\nPlease Enter your Grade:\n";
cout<<"\n[1]Grade 1\n\n[2]Grade 2\n\n[3]Grade 3\n\n[4]Grade 4\n\nAnswer:";
cin>>start;
}while(start<1||start>4);
switch(start)
{
case 1:cout<<space<<line<<"\nGrade 1";cout<<grade1q1();cout<<grade1q2();cout<<grade1q3(); break;
case 2:cout<<line<<"Grade 2"; break;
case 3:cout<<line<<"Grade 3"; break;
case 4:cout<<line<<"Grade 4"; break;
default :cout<<line<<"Sorry This is number is not valid."; break;
}
}
else cout<<"Thank you for using the English Guide";


}

int grade1q1(void)
{
int a1=0,a2,guessNum;
cout<<"\n\nQuestion No.1\n\n";
do
{
for (guessNum = 0;a1!= 1; guessNum++){
if(guessNum<5){
{

cout<<"\n_____ you going to school?";
cout<<"\n\n[1]Are [3]Is\n\n[2]They [4]Will\n";
cin>>a1;
}

}else{cout<<"Thank you for using the program.";return 0;}
}}while(a1!=1);

}

//Grade 1 Question 2
int grade1q2(void)
{
int a1=0,a2,guessNum;
cout<<"\n\nQuestion No.2\n\n";
do
{
for (guessNum = 0;a1!= 4; guessNum++){
if(guessNum<5){
{

cout<<"\n____ they be heading to the mall?";
cout<<"\n\n[1]Are [3]Is\n\n[2]Them [4]Will\n";
cin>>a1;
}

}else{cout<<"Thank you for using the program.";return 0;}
}}while(a1!=4);
}

int grade1q3(void)
{
int a1=0,a2,guessNum;
cout<<"\n\nQuestion No.3\n\n";
do
{
for (guessNum = 0;a1!= 3; guessNum++){
if(guessNum<5){
{

cout<<"\n____the dog jumping on the couch?";
cout<<"\n\n[1]Are [3]Is\n\n[2]They [4]Will\n";
cin>>a1;
}

}else{cout<<"Thank you for using the program.";return 0;}
}}while(a1!=3);
}

Viewing all articles
Browse latest Browse all 3029

Latest Images

Trending Articles



Latest Images