1. Open Small Basic.
2. Type the following code:
cards = 52
TextWindow.WriteLine("Enter the number of players:")
players = TextWindow.Read()
cardsEach = cards / players
TextWindow.Writeline ("The number of cards per player is " + Math.Floor(cardsEach))
3. This code will ask the user for the number of players and then divide this by the number of cards. You now need to use TextWindow.WriteLine() to get it to say:
With X players, you should have X cards each
NOTE: You will need to replace X with the variables in the code above.
Extension:
Can you use Math.Floor(variableName) to round down the number of cards each player gets in case of a decimal number?
1. Open a new file in Small Basic.
2. Using the skills you have just learnt, create a program that:
asks the user to enter the start temperature and end temperature.
work out the difference
tells the user know the difference.
Use the success criteria below to help you:
Display the text "Enter the start temperature"
Store the user input in a variable called startTemp
Display the text "Enter the end temperature"
Store the user input in a variable called endTemp
Create a calculation taking the end temperature from the start temperature and store it in a variable called difference
Display the text "The difference between the starting temperature and end temperature is X" where X is the difference variable
1. Open a new file in Small Basic.
2. Using the same skills you need to create a program that:
asks the user how much pocket money and savings they have
ask them how much the DVD they bought costs
tell them how much money they have left
Use the success criteria below to help you:
Display the text "How much pocket money do you have?"
Store the user input with a sensible variable name
Display the text "How much savings do you have?"
Store the user input with a sensible variable name
Display the text "How much did the DVD cost?"
Store the user input with a sensible variable name
Create a calculation that adds the pocket money to the savings, then subtracts the DVD cost and store it in a variable with a sensible name
Display the text "After buying the DVD you have £X left" where X is the amount left variable