Ask your own question, for FREE!
Computer Science 20 Online
OpenStudy (anonymous):

Hi guys i need help for checking my program. I made a program in c++ but i'm not sure if this is correct.

OpenStudy (anonymous):

cout<<"Please Enter your account no.: "; cin>>x; cout<<endl; cout<<endl; cout<<"*****Costumer Type*****\n"; cout<<endl; cout<<" R - Residential\n"; cout<<" B - Business\n"; cout<<" C - Exit\n"; cout<<endl; cout<<endl; cout<<"Please Enter your choice: "; cin>>choice; cout<<endl; cout<<endl; switch (toupper(choice)) { case 'R': cout<<"***Following rates***\n"; cout<<endl; cout<<endl; cout<<"Bill processing fee: $4.50\n"; cout<<"Basic service fee: $20.50\n"; cout<<"Premium channels: $7.50 per channel"; cout<<endl; cout<<endl; cout<<"Please Enter the number of premium channels subcribed: "; cin>>y; cout<<endl; cout<<endl; cout<<"Your bill is: " <<7.50* y+ 4.50 + 20.50<< " dollars "<<endl;break; case 'B': cout<<"***Following rates***\n"; cout<<endl; cout<<endl; cout<<"Bill processing fee: $15.00\n"; cout<<"Basic service fee: $7.50 for the first 10 connection\n"; cout<<"Premium channels: $50.00 per channel\n"; cout<<"Additional connection: $5.00 each\n"; cout<<endl; cout<<"Please Enter the number of premium channels subcribed: "; cin>>y; cout<<endl; cout<<endl; if (y < 11) { cout<<"Your bill is: " << 50.00* y + 15.00 + 7.50<< " dollars "<<endl;break; } else { if ( y > 10) { cout<<"Your bill is: " << y*50.00 + 15.00 + 7.50 +5.00<< " dollars "<<endl; } else return 0; break; } case 'C': cout<<"GOODBYE!\n";break; default: cout<<"INVALID INPUT!\n";break; } system("pause"); return 0; }

OpenStudy (anonymous):

\[\newcommand{\avec}[1]\]

OpenStudy (anonymous):

Well, what exactly is your program suppose to do? I know what your code is doing but what did your instructor tell you to create and what is the output suppose to look like. Right now the program you have can be improved dramatically but you are starting off great

OpenStudy (anonymous):

\[\newcommand\{\alpheqn\}\{\setcounter{saveeqn}\}\{\value{equation}\}%\]

OpenStudy (anonymous):

moha???

OpenStudy (anonymous):

yeah

OpenStudy (anonymous):

What are you trying to put up there? Looks like messed up latex lol

OpenStudy (anonymous):

yeah i'm just training some :)

OpenStudy (anonymous):

To use latex use \ [ latex goes here \ ]

OpenStudy (anonymous):

okay but how i can write mix of combination of mathmatics

OpenStudy (anonymous):

\ [ \frac{-b \pm \sqrt{b^2-4ac}}{2a} \ ] Will give you the Quadratic Formula \[ \frac{-b \pm \sqrt{b^2-4ac}}{2a} \] Also click on the Equation button next to draw and attach files

OpenStudy (anonymous):

thx alot

OpenStudy (anonymous):

pm it's +_ right???

OpenStudy (anonymous):

Yes \pm is +-

OpenStudy (anonymous):

If you want to make things inline with your sentence like this \( \frac{2}{4} \) you would use the \ ( \)

OpenStudy (anonymous):

thx and what about dx

OpenStudy (anonymous):

and integration

OpenStudy (anonymous):

its a bill inquiry.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!