#include
void main()
{
int ch3;
do
{
clrscr();
cout<<"\n Program By : pratya wutticho "<
cin>>ch3;
switch(ch3)
{
case 1 :
int x33,y33;
int result33 =100;// start statement
clrscr();
cout<<"Please enter integer number : \n";
cout<<"\nFirst number : ";
cin>>y33;
cout<<"\nSecond number : ";
cin>>x33;
//condition of if
if(x33>y33)//condtition
cout<<"\nFirst number is greater than second numbre \a\n";
if(x33+y33>result33)//condition
cout<<"\nFirst number+Seconde number is greater than \a\n"<
break;
case 2 :
int x44,y44;
int result44 = 100;
//start statement
clrscr();
cout<<"Please enter integer number : ";
cin>>x44;
cout<<"\nSecond number : ";
cin>>y44;
//condition of if
if (x44>y44)
{
clrscr();
cout<<"\nFirst number is :"<
}
if(x44+y44<=result44)
{
clrscr();
cout<<"\nFirst number is :"<
getch();
break;
case 3 :
int x55,y55;
//start statement
clrscr();
cout<<"Please enter integer number : \n";
cout<<"\nFirst number:";
cin>>x55;
cout<<"\nSecond number :";
cin>>y55;
if(x55,y55)//condition of if
cout<<"\nFirst number is greater than second number\a\n";
else
cout<<"\nSecond number is greater than or equal first number\a\n";
getch();
break;
case 4 :
int x66,y66;
//start statement
clrscr();
cout<<"Please enter integer number :\n";
cout<<"\nFirst number:";
cin>>x66;
cout<<"\nSecond number:" ;
cin>>y66;
//condition of if
if (x66>y66)
{clrscr();
cout<<"You enter 2 number:";
cout<<"\nFirst number is:"<
getch();
}
else
{
clrscr();
cout<<"You enter 2 number : ";
cout<<"\nFirst number is : ";
cout<<"\nSecond number is :" ;
cout<<"\nSecond number is greater than or equal first number \a\n" ;
}
getch();
break;
case 5 :
int score77;
char grade77;
//begin statement
clrscr();
cout<<"Program calculate grade";
cout<<"\n\nPlease enter your score :";
cin>>score77; //input score
if(score77<0)//calculate grade use if...else if..
grade77='*';
else if(score77<=49)
grade77='F';
else if(score77<=59)
grade77='D';
else if(score77<=69)
grade77='C';
else if(score77<=79)
grade77='B';
else if(score77<=100)
grade77='A';
else
grade77='*';
cout<<"\nYou get grade : \a"<
cout<<"Your score = "<
break;
case 6 :
int score88;
char grade88;
//begin statement
clrscr();
cout<<"Program calculate grade";
cout<<"\n\nPlease enter your score :";
cin>>score88; //input score
//calculate grade use if...else if..
if(score88<0score88>100)//check enter error score
grade88='*';
else if(score88>=0&&score88<=49)
grade88='F';
else if(score88>=50&&score88<=59)
grade88='D';
else if(score88>=60&&score88<=69)
grade88='C';
else if(score88>=70&&score88<=79)
grade88='B';
else
grade88='A'; //end of if command
cout<<"\nYou get grade : \a"<
cout<<"Your score = "<
break;
case 7 :
int first99,second99;
char choice99;
//begin statement
clrscr();
cout<<"Program calculate Area\n";
cout<<"1.Circle\n";
cout<<"2.Square\n";
cout<<"3.Triangle\n";
cout<<"Please select your choice <1-3> : ";
cin>>choice99;
//begin statement
switch(choice99)
{
case'1':
cout<<"\nYou select choice "<
break;
case'2':
cout<<"\nYou select choice "<
break;
case'3':
cout<<"\nYou select choice "<
break;
default:
cout<<"\nYou select Another choice \a\a\n";
cout<<"Press any key to end program\n";
}
getch();
break;
}//end of do...while
}//end of switch
while(ch3!=0);
getch();
}
ไม่มีความคิดเห็น:
แสดงความคิดเห็น