d. Applied Task
🧑💻 VCE Software Development – Student Task Sheet
Unit 3 Outcome 1 – Data Types and Data Structures (KK 3.1.4 & 3.1.5)
Based on Nelson/Cengage 2nd Ed. Chapter 1 – Introduction to Programming
🔹 Task 1 – Choosing the right data type
Context:
You are developing a program to manage a small gym's membership system.
Instructions:
- Declare three variables to store:
- member's name
- membership fee
- whether the member has paid (true/false).
- Write pseudocode that prints a message such as:
- Modify your pseudocode so the membership fee is shown to two decimal places.
- In a short comment, justify why you selected each data type.
🔹 Task 2 – Working with Boolean logic
Context:
The gym has restricted access between 9 p.m. and 5 a.m.
Instructions:
- Create Boolean variables for isStaff, hasPass, and afterHours.
- Use a decision structure to print:
- "Access granted" only if the user is staff and has a pass; otherwise "Access denied".
- Add one extra logical condition that restricts entry after hours.
- Comment each conditional statement with a plain-English explanation.
🔹 Task 3 – Array of daily steps
Context:
A fitness tracker app records the number of steps each day for a week.
Instructions:
- Create an integer array named steps containing seven values.
- Calculate and print:
- the total steps
- the average steps per day.
- Add a statement to print "Goal achieved!" if the average ≥ 10 000.
- Comment on how the index is used to access array elements.
🔹 Task 4 – Two-dimensional data
Context:
You are collecting temperature readings (°C) for three days, morning and afternoon.
Instructions:
- Create a two-dimensional array temps[3,2].
- Store six temperature values of your choice.
- Display output in this format:
- Add code that calculates and prints the average temperature across all readings.
🔹 Task 5 – Record structure (class)
Context:
A gym wants to store information about each member: name, age, and active status.
Instructions:
- Define a Member class with the three fields above.
- Create two Member objects and assign them values.
- Use Console.WriteLine() to display each member's details in one line.
- Add one Boolean field isTrainer and display a message if the member is a trainer.
🔹 Task 6 – Array of records
Context:
You are extending the gym system to manage multiple members.
Instructions:
- Create an array of five Member objects.
- Populate the array with sample data (names, ages, active status).
- Use a loop to print only the active members.
- Add code that counts how many members are active and prints the total.