ExamBank Scot · N5 Computing Science question bank · All N5 Computing Science questions
8 marks · Development process and analysis
Identify two processes for this program. Process 1 Process 2 The program will use a loop to ask if each person in the group would like refreshments. State the type of loop that should be used. Explain your answer. When a booking is made the user must create a password. The password is stored in userPass. Using a programming language of your choice, write the code to ask the user to enter their new password, and calculate the number of characters it contains. Complete the table below to state which data type should be used for the cost and refreshments variables. Variable Sample data Data type cost 27.50 refreshments Y SkySprings Trampoline Park is developing a program to allow customers to book group entry to the park. The program will ask the user how many people are in the group and if each person would like refreshments (Y or N). The program will display the total cost.
• calculate total cost • calculate number of people that require refreshments • calculate the initial/entrance cost • calculate cost of refreshments • check if Y or N selected • validate entry of Y or N Award 1 mark for each bullet. Maximum 2 marks. • fixed (loop) • (to repeat) number of times entered as input/number of people in the group Do not accept generic answer for 2nd bullet – must refer to this scenario. • input of password into userPass • calculate length of input • real • character/string