Answered step by step
Verified Expert Solution
Question
1 Approved Answer
QUESTION 2 120 MARKS The Maju Jaya Mart is a convenience store company that has five store located in Skudai At the end of each
QUESTION 2 120 MARKS The Maju Jaya Mart is a convenience store company that has five store located in Skudai At the end of each year, the management of the company wants to know the performance of their company. They have decided to use a computer program to help them in analyzing the company's sales. You, as a freelance programmer have been appointed to develop the program using C language. The requirements of the program are as follow: Input . Th e program should read in sales data from a text file The format of the input file is as follows: The first column is for the store branch code, second column is the sales of the first quarter, third column is for second quarter, and so forth. Figure 2 shows an example of input file named "sales2015.txt" containing sales data for the year 2015 Output . The program should print out a report into a text file named "report.txt" . The report should include The grand total of sales, over all stores sales throughout the year The highest sales. Print the store code and the highest sales. The total sales for each quarter o o o Figure 3 shows an example report file for the sales data of the year 2015 Arrays . The program should use array(s) to store the sales data. Functions The program should have the following function: grandTotal(). This function should return the grand total of sales over all stores throughout the year. It should accept array (representing sales) as its parameters. quarterTotal). This function should accept arrays and the index of a column in the array (representing a quarter) as its parameters. The function should return the total sales for the specified quarter highestSale(). This function should accept arrays (representing sales) as one of its parameters. It should determine the indices of row and column of a cell in the array which has the highest sales
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started