if statements question help

I'm kinda stuck on how to write the if statement for the following situation:

Let say this person played two games
the first game if he gets a score less than or equal to 100, he gets 15 tickets for each score he got. so if he scored 100 it would be : 100*15=1500 tickets

the second game if he score higher than 100 he gets 2.5 more tickets for each point after 100. So let say he scored 106 he will get 15*2.5*6 = 225 + 1500 = 1725 tickets total

I know how to write the statement for the first game but not the second one any helps/ hints would be appreciated


Last edited on
anyone can help?
I know how to write the statement for the first game but not the second one any helps/ hints would be appreciated


Prove it. Then let us know what problems are you having. Here is a tip of the type of questions to ask. http://www.cplusplus.com/forum/articles/40071/#msg218019

The link about if/else statements is below:

http://www.cplusplus.com/doc/tutorial/control/
Last edited on
#include<iostream>
#include<iomanip>
using namespace std;

int main()
{
int game1score, ticketseachScore;

cout << " Hello, Sir! Whats your score for game 1 and game 2?";
cin >> game1score >> game2score

ticketseachScore= 15;

if (gamescore1 <= 100)
cout << "Your tickets is:" << gamescore1 * ticketseachScore;

thats for the first one


for the second one im not sure how to type in the if else statement if he scores higher than 100. Like for example what happens if the user input 106? How do i print out the total number of tickets he will get based on the situation?

if the user gets higher than 100, then for each score he will get an additional 2.5 more tickets.

its really hard to explain what i need help with but i hope you get what i meant



for the second one. Here is an example:

1
2
3
4
5
6
if (game1score is higher than 100)
{
	//Compute the math (i.e. if score is 106
	// he will get 15*2.5*6 = 225 + 1500 = 1725 tickets total.
	//Let the user know the tickets total.
}


The above should give you an idea on how to work the problem out.

Hint: you may one to use constant variables for the values that will not change.
Last edited on
Topic archived. No new replies allowed.