Write a program that will take a penny and over the course of 30 days double its value and print it on the screen each time.ย
Create a variable that contains the integer 1ย
Over thirty days (iterations) double its value
Output each days (iterations) value for each of the thirty days
Write a program that will output the song starting at 99 and ending at 0.
"99 bottles of pop on the wall, 99 bottles of pop."
"Take one down, pass it around, 98 bottles of pop on the wall."
The same verse is repeated, each time with one fewer bottle. The song is completed when the number of bottles reaches zero.
screen output:
99 bottles of pop on the wall, 99 bottles of pop.
Take one down, pass it around, 98 bottles of pop on the wall.
Write a program that will simulate a Rocket launch count down.
the user should input a time to countdown from in seconds
the program will count through each second in order until reaching zero
When the countdown is complete output "BLAST OFF!"
screen output:
T-Minus 10 and counting.
9
8
7
6
5
4
3
2
1
BLAST OFF!
Stretch: If the countdown value is a multiple of 10 then the words โT-minus __ and countingโ will accompany the value, otherwise just the number will be output. (Modulus is used in the conditional expression)
Write a program that will randomly generate an addition math question, the program will repeatedly ask the user to input an answer until they get it correct.ย
math question will be output on screen
user will input an aswer
if they answer correctly a message will be output stating "congratulations" and how many attempts they have had before they have answered correctly
if they answer incorrectly an "Unlucky, try again" message will be output to the screen.ย
the random question will only stop being asked when a correct answer is input
Write a program that will produce the times tables to the 10th term for a number entered by the user.
input a number
calculate and output each multiplication of the inputted number to the 10th term
All output to the user must be formatted as a sum as shown.
screen output e.g. if the user enters โ2โ it should produce the following output to the 10th term:
1 x 2 = 2
2 x 2 = 4
3 x 2 = 6
4 x 2 = 8
5 x 2 = 10
6 x 2 = 12
7 x 2 = 14
8 x 2 = 16
9 x 2 = 18
10 x 2 = 20
Adam regularly challenges one of his teachers to a pool competition.ย The winner of their matches is the person who wins the most individual games of pool.
Write a program to calculate the total number of times each player wins a game and display a message congratulating the winner of the overall match.ย ย
The program should:
repeatedly ask the user to input the winner of each game
stop asking for input when the character โXโ is entered
add up the number of wins for each player as the winner of each game is inputted
display a message congratulating the player who won the most games or display a message saying that the match was tied
Limit33 is a simple game of adding a series of random numbers to a running total.ย
The aim is to get to close to 33 without going over.
A player starts with a total of zero
On each turn a random number between 1 and 10 is generated and added to the players total
If the players total exceeds 33 the player has lost and the game ends
At the end of each turn the player is asked whether they want to continue or quit.
Write a program to simulate Limit33