Photo AI

During the period leading up to the Christmas holidays, P-Cubed hires temporary staff - Edexcel - GCSE Computer Science - Question 3 - 2018 - Paper 1

Question icon

Question 3

During-the-period-leading-up-to-the-Christmas-holidays,-P-Cubed-hires-temporary-staff-Edexcel-GCSE Computer Science-Question 3-2018-Paper 1.png

During the period leading up to the Christmas holidays, P-Cubed hires temporary staff. Staff are hired for each of the six weeks prior to Christmas week. Here is th... show full transcript

Worked Solution & Example Answer:During the period leading up to the Christmas holidays, P-Cubed hires temporary staff - Edexcel - GCSE Computer Science - Question 3 - 2018 - Paper 1

Step 1

Percentage of staff needed in 6 weeks prior to Christmas

96%

114 rated

Answer

The algorithm starts by defining the percentage of staff needed for each week leading up to Christmas. This is held in an array named staffRates, with values corresponding to the staff needed from week -6 to -1. The weekNumber array indicates the specific weeks.

Step 2

Validate the input

99%

104 rated

Answer

The algorithm prompts the user to enter the number of staff for week -7. It checks if the input, currentCount, is valid (greater than or equal to 200). If valid, it proceeds; otherwise, it shows an error message, and the input process repeats until valid data is provided.

Step 3

Print requirements

96%

101 rated

Answer

Finally, the system calculates the required staffing for the subsequent six weeks. It iterates through the weekNumber array using a loop, calculating neededStaff as currentCount multiplied by the corresponding percentage from staffRates. Each week's requirement is then displayed.

Join the GCSE students using SimpleStudy...

97% of Students

Report Improved Results

98% of Students

Recommend to friends

100,000+

Students Supported

1 Million+

Questions answered

;