954,504 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

i need to add function for add, subtract, multiply and division.

#include


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
Newbie Poster
5 posts since Dec 2004
Reputation Points: 10
Solved Threads: 0
 

ya need help?

herdi
Newbie Poster
15 posts since Dec 2004
Reputation Points: 10
Solved Threads: 0
 

i know a lot about it.

herdi
Newbie Poster
15 posts since Dec 2004
Reputation Points: 10
Solved Threads: 0
 
ya need help?


yes this is my finals

shermili
Newbie Poster
5 posts since Dec 2004
Reputation Points: 10
Solved Threads: 0
 
Add:      <strong>a + b</strong>
Subtract: <strong>a - b</strong>
Multiply: <strong>a * b</strong>
Divide: (this gets tricky) <strong>if(b) a / b</strong>


What have you been trying?

Dave Sinkula
long time no c
Team Colleague
5,058 posts since Apr 2004
Reputation Points: 2,780
Solved Threads: 314
 
What have you been trying?

Well, he's tried to get the input code :)

jwenting
duckman
Team Colleague
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
 

what the.....

herdi
Newbie Poster
15 posts since Dec 2004
Reputation Points: 10
Solved Threads: 0
 

Are you expecting someone to write the code for ya?

jasweb2002
Junior Poster in Training
56 posts since Sep 2004
Reputation Points: 11
Solved Threads: 2
 

no i did not. Not really jasweb but close.

herdi
Newbie Poster
15 posts since Dec 2004
Reputation Points: 10
Solved Threads: 0
 

hehehehehe

herdi
Newbie Poster
15 posts since Dec 2004
Reputation Points: 10
Solved Threads: 0
 

i 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. i thought this site was to get help but i got the code fixed and thank you very much for big help. i had to declare the function on top of main and then put it at the end of progrm. but

thank you anyways

shermili
Newbie Poster
5 posts since Dec 2004
Reputation Points: 10
Solved Threads: 0
 
what the.....


what the

what are u trying to say finish your sentences i thought u knew lot about this question :evil:
:cry:

shermili
Newbie Poster
5 posts since Dec 2004
Reputation Points: 10
Solved Threads: 0
 
Add:      <strong>a + b</strong>
Subtract: <strong>a - b</strong>
Multiply: <strong>a * b</strong>
Divide: (this gets tricky) <strong>if(b) a / b</strong>
What have you been trying?


Thank you for your help

shermili
Newbie Poster
5 posts since Dec 2004
Reputation Points: 10
Solved Threads: 0
 
i 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 the people here, not a good thing to do...

jwenting
duckman
Team Colleague
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
 

what 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...

jwenting
duckman
Team Colleague
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
 
Ever heard of punctuation, capitalisation, and spelling? They're important in English as well as in programming languages so you'd better practice some...

lol ... 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
Darko

Darko
Newbie Poster
10 posts since Nov 2004
Reputation Points: 10
Solved Threads: 0
 

lol ... 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 Darko

Jwenting is right...Ask a decent question, get a decent answer (and the spelling matters, too:))...What's so complicated??

frrossk
Posting Whiz in Training
220 posts since Sep 2004
Reputation Points: 17
Solved Threads: 9
 
Jwenting is right...Ask a decent question, get a decent answer (and the spelling matters, too:))...What's so complicated??

nuthin is complicated... the whole point is u know wht the person is asking u jus tht its not in perfect english.. but instead of helping tht person with it u go abt criticising his/her english... jus answer his/her doubt n get it over with... besides if u want to comment of his/her english.. do it in a manner so that it desnt sound offensive... u dont have to be rude... thts all...

Darko
Newbie Poster
10 posts since Nov 2004
Reputation Points: 10
Solved Threads: 0
 

Darko having a post that is hard to read and expecting someone else how to tell them how to do everything deserves a little criticism. People are here to help not to decipher through a badly written post. Using stuff like nuthin, u and things of that nature just make you look not so intelligent.
As for the OP check this out:
http://www.cprogramming.com/tutorial/lesson4.html

prog-bman
Junior Poster
109 posts since Nov 2004
Reputation Points: 14
Solved Threads: 4
 
Darko having a post that is hard to read and expecting someone else how to tell them how to do everything deserves a little criticism. People are here to help not to decipher through a badly written post. Using stuff like nuthin, u and things of that nature just make you look not so intelligent. As for the OP check this out: http://www.cprogramming.com/tutorial/lesson4.html

Agreed dude, pretty decent. I will try not to make it complicated. I guess jasweb and jwenting can learn from you how to be polite while making a point.

As for the link, I dint exactly need it. Maybe shermili did. I got a different thread called: "Help With My Fy Project". Check it out see if you can help.

Darko
Newbie Poster
10 posts since Nov 2004
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You