1. A company that makes cakes stores data about the cakes it makes! What is the most appropriate data type for storing the following information?
2. A game user needs to press a button to request the game to stop. State the data type that you would use to record whether the button has been pressed or not.
3. In the following code, if line 2 is executed out (the comment is removed), the output will be 46, instead of the current 2323. Why?
4. Mr Smith, a chemistry teacher, writes the following code to analyse the test scores (rounded to the nearest integer) of a pupil. Line 3 is missing. Complete line 3 so that the program calculates the total score
of the pupil
5. The program below calculates the cost of a delicious pizza in pounds(£) at a fast food restaurant. A standard plate costs £3.50 with additional costs for sauce and eating in the restaurant. List all the variables in this program.
6. A coder has suggested that the 0.5 (attached the additional sauces) should have been declared as a constant. Why is this?
7. The following code seeks to calculate the value of an investment after one year.
Can you spot any problems with the code?
8. A swimming pool club issues a card to its customers that they swipe to get in and out. If the pool is full i.e. 20 members, then the card denies the customer access. What are two variables and one constant that could be used to code this program?
9. The following algorithms each use data values. Can you work out which of these is using fixed values?(some of them use variable data)
10. Fill in the blanks below:
11. The term "Casting" refers to:
12. The statement "A or B" implies that the variable type of A and B is:
13. Fill in the blanks in the paragraph below.
14. In Physics, we can look at an object falling from rest. The formula for its velocity after a time of t seconds is shown below. Which of the following could be set as a CONSTANT?
15. Why would it be better to rename the variable "b2" below to "result"?