Photo AI

The online-shopping website of a company called MajorMax allows customers to buy items online from various departments at their store - NSC Information Technology - Question 3 - 2017 - Paper 1

Question icon

Question 3

The-online-shopping-website-of-a-company-called-MajorMax-allows-customers-to-buy-items-online-from-various-departments-at-their-store-NSC Information Technology-Question 3-2017-Paper 1.png

The online-shopping website of a company called MajorMax allows customers to buy items online from various departments at their store. The manager of the company mus... show full transcript

Worked Solution & Example Answer:The online-shopping website of a company called MajorMax allows customers to buy items online from various departments at their store - NSC Information Technology - Question 3 - 2017 - Paper 1

Step 1

Button [3.1 - Sales information]

96%

114 rated

Answer

To display the sales information:

  1. Display the heading: Join 'Department' with week number (1 to 6).
  2. Loop through each department: Using a loop from 1 to 8 (for each department), initialize a line variable to hold the data.
  3. Inner loop for weeks: Use another loop from 1 to 6 for each week, joining the sales figures from the 2D array into the line variable. Each sales figure needs to be formatted to show two decimal places in currency format.
  4. Output the line variable: After looping through all weeks for a department, display the completed line.

Step 2

Button [3.2 - Display underperforming departments]

99%

104 rated

Answer

To display underperforming departments:

  1. Display the heading: Set the heading for underperforming departments for each week (1 to 6).
  2. Initialize sum variable: Start a sum variable at zero for calculations.
  3. Calculate weekly averages: Loop through each week to get the average sales figure.
  4. Loop for each week: For each department, check if sales are below average. If true, display the department name and sales figure formatted as currency. Repeat for all weeks.

Step 3

Button [3.3 - New week]

96%

101 rated

Answer

To add a new week:

  1. Assign the file name: Use the correct week number for the text file, e.g., 'Week 7.txt'.
  2. Rewrite command: Ensure the previous data is archived correctly by rewriting the file.
  3. Loop for departments: For each department (1 to 8), loop through the current week and archive data.
  4. Increasing start variable: After archiving, increment the start variable for the data movement process.
  5. Random data generation: Loop to populate sales data for the new week (Week 7) with random values in the range of R500 to R5000.
  6. Display updated arrays: Finally, output the updated sales figures including the newly added week.

Join the NSC students using SimpleStudy...

97% of Students

Report Improved Results

98% of Students

Recommend to friends

100,000+

Students Supported

1 Million+

Questions answered

;