#include <iostream.h>
int main()
{
int ID,Choice,Addition,Subtraction,Multiplication,Division,Exit;
char Firstname[10];
char Lastname[10];
cout<<"Enter your Firstname\n";
cin>>Firstname;
cout<<"Enter your Lastname\n";
cin>>Lastname;
cout<<"Enter your ID\n";
cin>>ID;
cout<<"1. Addition\n";
cout<<"2. Subtraction\n";
cout<<"3. Multiplication\n";
cout<<"4. Division\n";
cout<<"5. Exit\n";
cout<<"Enter your Choice:\n";
cin>>Choice;
while (Choice != 5)
{
switch(Choice)
{
case 1: cout<<"You have selected Addition\n";Addition;break;
case 2: cout<<"You have selected Subtraction\n";Subtraction;break;
case 3: cout<<"You have selected Multiplication\n";Multiplication;break;
case 4: cout<<"You have selected Division\n";Division;break;
case 5: cout<<"You will Exit\n";Exit;break;
default:cout<<"Your selection is incorrect, You can only select number from 1-5\n";
cin>>Choice;
}
}
return 0;
}
shermili 0 Newbie Poster
Dark_Omen commented: Use Code tags, and people dont do hw for other people +0
Recommended Answers
Jump to PostAdd: [B]a + b[/B] Subtract: [B]a - b[/B] Multiply: [B]a * b[/B] Divide: (this gets tricky) [B]if(b) a / b[/B]
What have you been trying?
Jump to PostWhat have you been trying?
Well, he's tried to get the input code :)
Jump to PostAre you expecting someone to write the code for ya?
Jump to Postlol ... u are here also jwenting.. hey shermili u wont get any help as long as him n jasweb are arnd... they only criticise other ppls english... i doubt they know programming...
Dark Darkest
DarkoJwenting is right...Ask a decent question, get a decent answer (and the spelling matters, …
Jump to PostLet's jump back on topic here, okay? This thread's been hijacked by this grammar discussion. Though completely valid and topical, I fear it's going to detract from the original poster's question.
All 22 Replies
herdi 0 Newbie Poster
herdi 0 Newbie Poster
shermili 0 Newbie Poster
Dave Sinkula 2,398 long time no c Team Colleague
jwenting 1,905 duckman Team Colleague
herdi 0 Newbie Poster
Dave Sinkula commented: Do you have anything to add? +0
jasweb2002 0 Junior Poster in Training
herdi 0 Newbie Poster
herdi 0 Newbie Poster
shermili 0 Newbie Poster
shermili 0 Newbie Poster
shermili 0 Newbie Poster
jwenting 1,905 duckman Team Colleague
jwenting 1,905 duckman Team Colleague
Darko 0 Newbie Poster
frrossk 2 Posting Whiz in Training
Darko 0 Newbie Poster
prog-bman 4 Junior Poster
Darko 0 Newbie Poster
jwenting 1,905 duckman Team Colleague
Darko 0 Newbie Poster
alc6379 120 Cookie... That's it Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.