National+5+Conditional+Statements

media type="custom" key="27759477"

media type="custom" key="27759479"

[|Bill Gates on IF statements]
 * Video**


 * Questions**

1. Free Cakes A program should print a message when a customer has bought 6 cakes to inform them they are entitled to a free cake. Copy and complete the pseudocode below replacing the asterisks

1 IF cakes * 6 THEN 2 SEND "You have bought 6 cakes, so you get one free" TO DISPLAY 3 END **

2. Film Rating A program which should print a message if a film rating is 8 or more. The pseudocode has been started for you

1 IF film_rating >= 8 THEN 2 ... 3 ...

3. What would you expect the output of this program to be?

4. What would you expect the output of this program to be

5. What would you expect the output of this program to be

6. Happy Birthday A program has been written which asks the user if it is their birthday today and stores the answer in a variable birthday_today. Write a conditional statement in pseudocode which displays "Happy Birthday" if the user had answered "yes"

7. Driving Test A program should display "Well done you have passed your driving test" if the test score is 32 or more. Write the pseudocode.

8. Bonus life A program should add 1 to the variable lives if the variable game_score reaches 1000 Write the pseudocode.

9. Discount A program should display a message "Discount is 10%" if a variable total_sales is more than 500, or a message "No discount" if total_sales is not greater than 500. Write the pseudocode.

10. Medals A program should display "Gold Medal" if a variable position is 1, "Silver Medal" if the variable position is 2, "Bronze Medal" if the variable position is 3 or "No Medal" if it is none of these. Write the pseudocode.