#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 Post— Dave Sinkula 2,398Add: [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 Post— jwenting 1,905What have you been trying?
Well, he's tried to get the input code :)
Jump to Post— jasweb2002 0Are you expecting someone to write the code for ya?
Jump to Post— jwenting 1,905i am not waiting for someone to write the code, i already wrote the code but i been getting this error message. you wouln't understand because u probably tell this to everyone and criticized everyone.
You didn't write anything related to your question that you showed.
Instead you start badmouthing …
Jump to Post— jwenting 1,905what the
what are u trying to say finish your sentences i thought u knew lot about this question
Ever heard of punctuation, capitalisation, and spelling?
They're important in English as well as in programming languages so you'd better practice some...
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.