I need to change one of my if/else to a conditional statement |
I would like one of my numbers in the multiplication to be random between one and ten |
I need to add a for loop. |
PLEASE ALWAYS USE CODE TAGS (the <> formatting button), to the right of this box, when posting code. Along with the proper indenting it makes it easier to read your code and also easier to respond to your post. http://www.cplusplus.com/articles/jEywvCM9/ http://www.cplusplus.com/articles/z13hAqkS/ Hint: You can edit your post, highlight your code and press the <> formatting button. This will not automatically indent your code. That part is up to you. You can use the preview button at the bottom to see how it looks. I found the second link to be the most help. |
|
|
std::cin >> selection;
with unformatted input getline(cin, name);
.I have to make these changes to meet assignment requirements. |
Add a condition operator. |
|
|
if (std::toupper(age) == 'Y')
. This is 1 way to deal with this or you could use if (age == 'Y' || age == 'y')
. It is best to check for both cases if you do not change the case in as in the first example.Please make a selection: 1) Start 2) What your Daily Intention number means 3) Exit Enter choice: 4 Invalid selection! Try again. Please make a selection: 1) Start 2) What your Daily Intention number means 3) Exit Enter choice: 1 Please enter your name then hit enter: John Doe Welcome to your Daily Intention, John Doe Answer the following questions with either Y for Yes or N for No. Are you 13 or older? y Do you want to add some positivity to your day y You are old enough to receive a daily intention Positive vibes are coming your way. Choose a number then hit enter: 5 Choose a number then hit enter: 10 |