ExamBank Scot · N5 Computing Science question bank · All N5 Computing Science questions
12 marks · Development process and analysis
Complete the analysis below. Input Process Output Cost of stay The code below calculates the cost of the stay. … Line 7 RECEIVE name FROM (STRING) KEYBOARD Line 8 RECEIVE numberOfPeople FROM (INTEGER) KEYBOARD Line 9 RECEIVE arrival FROM (STRING) KEYBOARD Line 10 RECEIVE nightsStaying FROM (INTEGER) KEYBOARD Line 11 <calculate cost of stay> Line 12 SEND "The cost of your stay is £" & cost TO DISPLAY … Using a programming language of your choice, write the code for Line 11. To pay a deposit, users will have to provide bank account details. State how this information could be transferred securely to the booking system. The number of guests who stayed at the campsite each night in 2023 is stored in the array guests. Index 0 1 2 … 364 Value 271 240 153 … 87 The campsite want to know the total number of guests who stayed at the site in 2023. Using a programming language of your choice, write the code to calculate this total. A map of the campsite is stored as a bit‑mapped graphic. Describe how this map is represented in a computer system’s memory. A campsite booking system is being developed to calculate the cost of a stay at £35 per night, per person. The cost will be displayed to the user before they confirm the booking. The system will ask users for their name, number of people, arrival date and length of stay.
• Input - name - number of people - date of arrival - length of stay • Process - calculate overall cost (of stay) Award 1 mark for identifying all inputs and 1 mark for process Ignore ‘confirm booking’ if added as input • nightsStaying * 35 • * numberOfPeople • assignment of final calculation to cost variable Calculation may be implemented over one or two lines Order of numberOfPeople and nightsStaying may change in bullets 1 and 2 35 could be replaced by a cost per night variable. cost = numberOfPeople * nightsStaying * 35 encryption • set running total to 0 • loop 365 times • running total adding guests to total in loop • use of incrementing array index in running total If a collection loop is used award the last two bullets for use and increment of the array.eg FOR EACH value FROM guests DO SET total TO total + value END FOR for value in guests: total = total + value • each pixel • is stored as a binary value (bits) Accept ‘1s and 0s’ as binary