Skip to content

Latest commit

 

History

History
32 lines (11 loc) · 1.45 KB

Challenges 1-10.md

File metadata and controls

32 lines (11 loc) · 1.45 KB

Challenges 1 - 20: "Starting small"

  1. Display a message such as 'Hello World!'.

  2. Using a loop, display your name 10 times.

  3. Ask the user for their name. Using a loop, display their name 15 times but do not advance to the next line between prints.

  4. Ask the user for their name. Ask them how many times they would like it to be displayed. Using a loop, display their name this number of times.

  5. Ask the user for their name. If it is the same as yours, display a message such as "Hello Bob.". Otherwise, display something like "But, you're not Bob!".

  6. Validation: Ask the user to enter a number. If it is not an integer, keep asking until it is.

  7. Create a dice roll subroutine that will generate a random number between 1 and 6 (inclusive). The number should be returned by the subroutine. No messages need to be displayed on the screen.

  8. Modify the dice roll subroutine to accept two parameters. They should indicate the number of dice to roll and the number of sides on the dice. So DiceRoll(3, 8) would roll three, eight sided dice. The result should be returned as a list - even if only one dice was rolled.

  9. Ask the user to repeatedly enter a positive number (0 is included). The program should stop when they enter a negative number. Make sure they can only enter numbers.

  10. Ask the user to enter a sequence of positive integers. When they enter a negative number, stop. Display the smallest and largest number from the input provided.