Photo AI
Question 3
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
Step 1
Answer
To display the sales information, start by setting up the appropriate headings to represent the department names and the week numbers. Next, loop through each department in the arrSales
array and display their corresponding sales figures for each week within the output component provided. For each monetary value displayed, ensure it is formatted to two decimal places to maintain currency standards.
Step 2
Answer
Begin by displaying the required headings for the report. To determine underperforming departments for each week, loop through the weeks and initialize a variable to sum the sales. Calculate the average sales figure for each week. Then, create a nested loop to go through each department and check if its sales figure is below the average. If so, display the department name and sales figure formatted in currency.
Step 3
Answer
Assign the filename based on the current week number, and ensure the previous week's data is saved in the specified format. Use a loop to move data from the arrSales
to archive the previous values as required. Generate new sales data randomly within the specified range of R500 to R5000 for the new week and update the display accordingly.
Report Improved Results
Recommend to friends
Students Supported
Questions answered