Backend Assignment (2)
Backend Assignment (2)
Activity 1:
You arrive in front of a bridge that you must cross to reach a village before
dark. Crossing the bridge is not free - the bridgekeeper asks you to roll two
dice to determine the cost.
You decide to write a program to verify that he is charging the right price.
Your program should read two integers, between 1 and 6, representing the
values of each die. If the sum is greater than or equal to 10, then you must
pay a special fee (36 coins). Otherwise, you pay twice the sum of the values
of the two dice. Your program must then display the text "Special tax" or
"Regular tax" followed by the amount you have to pay on the next line.
EXAMPLE
INPUT
OUTPUT
Special tax
36
INPUT
OUTPUT
Regular tax
14
Activity 2:
Write a program that will give a user the opportunity to guess a number that
will be generated randomly. If the guess of the user is too high, it should
display, "guess too high. Try again", if the guess of the user is too low, it
should display "guess too low. Try again". And when the user successfully
guesses correctly. It should display, "Your guess was correct after n
attempts".
Where n is the number of attempts the user made and then finally the
program should stop.
Activity 3:
If you have any questions, please ask. But digest the assignment properly before
asking.