this is my source code no error no warnings..but the output is not my expectation
because all i want is a simple choices appears in the scrn and when you enter "1" HERNANDEZ ARIEL
ICT PROGRAMMING INSTRUCTOR
MONDAY are will be appear.
plss help me i know it is easier to you guys..plss help me.:(
int main()
{
{
cout<<" CLB ICT INSTRUCTOR\n\n";
cout<<"Please Select The Number of Your Instructor :"<<endl<<"\n";
cout<<"1=HERNANDEZ,ARIEL\n 2=MACALALAD JAMES\n\n";
// 3 lines are displayed at this moment
// user input nothing!
if ("1"){
//you trying to handle user choise but user dont make it yet
//if ("1") is 'true' allways. you should make a logic exprassion like 1==2 etc
//so next 3 cout will be displayed
cout<<"HERNANDEZ ARIEL\n\n";
cout<<" ICT PROGRAMMING INSTRUCTOR \n"<<endl;
cout<<"MONDAY \n"<<endl;
//you have 6 lines displayed at this moment
}
system ("cls");
//you have a clear screan now
if ("2"){
//if ("2") is 'true' allways
cout<<"MACALALAD JAMES\n\n";
cout<<" ICT COMPFUN INSTRUCTOR \n"<<endl;
cout<<"TUESDAY \n"<<endl;
// now you have 3 displayed lines
}
cin.get();
//you read something from screan.
return 0;
}
}
#include<iostream>
#include<conio.h>
#include<stdlib.h>
usingnamespace std;
int main()
{
cout<<" CLB ICT INSTRUCTOR\n\n";
cout<<"Please Select The Number of Your Instructor\n\n";
cout<<"1=HERNANDEZ,ARIEL\n2=MACALALAD JAMES\n\n";
//3 lines are displayed
int choise;
cin>>choise; //read integer from screan
//variable choise contains user number
if (choise==1){ //if choise = 1
cout<<"HERNANDEZ ARIEL\n\n";
cout<<" ICT PROGRAMMING INSTRUCTOR \n"<<endl;
cout<<"MONDAY \n"<<endl;
}
elseif (choise==2){ //if choise = 2
cout<<"MACALALAD JAMES\n\n";
cout<<" ICT COMPFUN INSTRUCTOR \n"<<endl;
cout<<"TUESDAY \n"<<endl;
}
else //in any other case
cout<<"OOPS";
system("pause"); //wait for user press any key
return 0;
}