The aquarium at Aqua Wonderland is setting up a new rectangular shark tank - NSC Information Technology - Question 1 - 2016 - Paper 1
Question 1
The aquarium at Aqua Wonderland is setting up a new rectangular shark tank. The administrators need a software program to manage the income from visitors and the dai... show full transcript
Worked Solution & Example Answer:The aquarium at Aqua Wonderland is setting up a new rectangular shark tank - NSC Information Technology - Question 1 - 2016 - Paper 1
Step 1
Button [Question 1_1]
96%
114 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
To calculate the volume of the tank, we first need to obtain the dimensions from the user interface.
Extract Length, Width, and Height from the text boxes and convert them to real values.
Use the formula for volume:
Volume=Length×Width×Height
Display the calculated volume in the text box.
Step 2
Button [Question 1_2]
99%
104 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
To calculate the cost of filling the tank with water, follow these steps:
Use the volume calculated in Question 1.1, and multiply it by 1000 to convert cubic metres to litres.
Determine the cost based on the volume:
If volume <= 500, use the formula:
Cost=Volume×0.25
If 500 < volume <= 800, use:
Cost=500×0.25+(Volume−500)×0.35
If volume > 800, use:
Cost=500×0.25+300×0.35+(Volume−800)×0.45
Display the cost in the text box.
Step 3
Button [Question 1_3]
96%
101 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
The lifespan of a shark will be calculated as follows:
Extract the lifespan in months from the text box.
Calculate years and months using:
Years = lifespan divided by 12
Months = lifespan mod 12
Display the results in the format:
x years and y months.
Step 4
Button [Question 1_4]
98%
120 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
To calculate the financial information, perform these steps:
Extract the setup cost and income from the text boxes.
Display headings in the output area for clarity.
Initialize yearNumber to 1 and use a loop:
Check if setupCost > 0. If true, display the current year, income, and setup cost.
Increase income by 10% for the next year.
Increment yearNumber.
If the initial cost is paid off, display 'Paid off' in the Balance column.
Format all monetary values to two decimal places.
Step 5
Button [Question 1_5_1]
97%
117 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
This section simulates dice throwing:
Generate two random numbers for the dice, ensuring they are within the correct range (1-6).
Display the values labeled appropriately in the output area.
Check if the numbers rolled are consecutive (i.e., difference of 1).
If they are, enable the next question's button.
Step 6
Button [Question 1_5_2]
97%
121 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
To create a reference number for a visitor:
Use a dialog box to capture the visitor's four-digit ticket number.
Extract the system date.
Select a course from the radio buttons.
Construct the reference number formatted as follows:
TicketNumber<Date><FirstTwoLettersOfCourse>.
Display the generated reference number in the output area.