- 1

Can anyone understand me simple language?

You are cheering on your favorite team. After each play, if your team got over 10 yards further down the field, you stand up and give your friend a high five. If they don't move forward by at least a yard you stay quiet and say 'shh', and if they move forward 10 yards or less, you say 'Ra!' for every yard that they moved forward in that play. Task Given the number of yards that your team moved forward, output either 'High Five' (for over 10), 'shh' (for <1), or a string that has a 'Ra!' for every yard that they gained.

11th Nov 2020, 12:10 PM
born2code
born2code - avatar
4 odpowiedzi
+ 3
there are 3 conditions. User will input the number of yards, ok? Lets call it "yards" 1) if yards is greater than 10 then you will output in the terminal "High Five" 2) if yards is smaller than 1, you will output "shh" 3) if yards is between 1 and 10, including 1 and 10, you would output "Ra!" as many times as the yards, such as if it is 3 yards, you would output "Ra! Ra! Ra!"
11th Nov 2020, 12:23 PM
maf
maf - avatar
+ 2
Yes, you need to use if else statements to print correct output. I'd use a for statement to output the needed amount of Ra's. Feel free to ask if you need more help but give it a go by yourself first 🙂
11th Nov 2020, 12:20 PM
Olivia
Olivia - avatar
+ 1
Yes, condition 2 create an if statement. Condition 1 add and else if statement. Condition 3 create a for statement inside and else statement to print the input amount of "Ra!"
11th Nov 2020, 12:27 PM
Olivia
Olivia - avatar