Posted at 06:02h
in
Uncategorized
by admin
Question:
Being able to send encoded messages during World War II was very important to the Allies. The messages were always sent after being encoded with a known password. Having a fixed password was of course insecure, thus there was a need to change it frequently....
Question 1:
You are in a bike race which goes up and down a hill. You could create two variables: uphillDistance and downhillDistance give the distance (in km) of both parts of the race. Write a program that will print out the total distance for the...
Question: (Hint: Dijkstra)
The young explorer came to a tribe. There he fell in love with the chief's daughter, so he went to the chief to ask for marriage. The chief asked him to use 10,000 gold coins as a dowry before agreeing to marry his...
Posted at 05:22h
in
Uncategorized
by admin
Question:
Continue modify the war-robot program we made in the class, so that:
if enemy’s hp is lower or equal to 0, use msgbox to display message ‘you win’, and the while program finish.
it will be the enemy’s turn to strike you back. Enemy can...
Question:
Martha takes a jar of quarters to the casino with the intention of becoming rich. She plays three machines in turn. Unknown to her, the machines are entirely predictable. Each play costs one quarter. The first machine pays 30 quarters every 35th time it is played; the second machine...
Question:
Write a program to ask the user for five names. The program should store the names in a list, and print them all out in alphabetical order at the end. It should look something like this:
Sample input:
Enter 5 names:
Tony
Paul
Nick
Michel
Kevin
Sample output:
The names are Kevin, Michel, Nick,...