Need help.
Type: Posts; User: Sembhi
Need help.
Then why does the total display?
^ Thanks.
#include <iostream.h>
int main()
{
int sum = 0;
int num;
int total = 0;
Yea I know, I'm just trying to get one to work first.
Can someone take a look at the code posted above and tell me whats wrong with it?
What I had in mind was using if, setting the first number entered to a variable called temporary, and have all the numbers entered compared to that, if the number entered bigger/smaller have that...
I have a program where the user has to input numbers over and over, if they want to end the program they hit 0. After they hit zero though I have to display the largest and smallest numbers they...
Got it. Thank you.
OK I get what you're saying but I'm not sure how to put that into code.
Yea I saw. Thanks for the help. Works fine now.
The reason I had sum = 0 was because the problem told me. Not sure why though. Oh well, that one is done.
I'm starting on the one I had...
Still confused. This is what I have.
do
{
cout << "Enter a number (Enter 0 to quit): ";
cin >> num;
total = num;
total = total + num;
Yea that does.
Need help with another program real quick. I have to keep getting a number from the user until they enter 0. I also need to add up all the numbers they enter and display it. How do...
"Write a program that uses nested loops to produce the following output.
A1B1B2B3A2B1B2B3"
Any tips on where I should start?
For some reason it won't let me find out a final score out of 100.
I'm dividing the total number they got correct out of the total number of questions then multiplying by 100 and it's not coming...
How would I write a code that shows the user how many correct answers they got?
Gah! Knew it would be something stupid. Thanks.
I'm asking the user if they are ready to begin.
#include <iostream.h>
int main()
{
int a; // start;
int answer_one; // answer to number one
int answer;
Ok having a problem. I have to multiply the total before the shipping cost (which is double) by the shipping cost (which is a int because it's in a switch). I keep getting another weird answer. It...
Gosh what a stupid mistake. Thanks for the help.
Here is my code/
#include <iostream.h>
#include <iomanip.h>
int main()
{
Getting a really stupid problem.
fst = food * o;
cout << "Your subtotal is $" << fst << endl;
Answer is coming out to some negative huge number. What could be the problem?
Oh I figured it out. I need to have 3 different switches because they may want more than one type of sandwch.
I'm a little confused because on our paper it said something about using 3 different switch structures. Where would I need this?
Alright thanks.
I just need your guys advice on what I should to do complete this program.
I have to ask the user what type of sandwich they would like (3 choices, each has different price)....
How do I ask the user how much of the food they picked they want and make it display that?
How would I multiply only the sandwich they order by the price?
I have to write a program asking the user what type of sandwich they would like. I know how to do that part using switch but how do I get it to show the price only for that sandwich.
This is what...