Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CASE STUDY 3 The Maslee Mart is a convenience store company operating in the state of Johor. The company has five stores located in several

CASE STUDY 3
The Maslee Mart is a convenience store company operating in the state of Johor. The company has five stores located in several branches; Johor Bahru, Segamat, Batu Pahat, Kota Tinggi and Mersing, respectively. 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:
The program should read in sales data from a text file named "sales2014.dat" as shown in Figure 3.1.
The format of the input file is as follows: The first to twelfth columns indicate the sales for each month, i.e., the first column is for the sales of January, second column is for February, third column is for March, and so forth. The last column indicates store branches. Note that sales in each cell is represented in multiple of RM 1000.00
Output: ?()
The program should print out a report into an output file as shown in Figure 3.2.
The report should include:
The grand total of sales, i.e., over all stores throughout the year.
The average sales per month.
The highest sales. Print the store, month and the sales whose the highest sales.
The lowest sales. Print the store, month and the sales whose the lowest sales.
The total sales for each month. The months should be printed with their abbreviated names, such as, "Jan", "Feb", "Mar", and so forth.
The total sales for each store.
The list of profitable stores. A store is considered profitable if it manages to achieve minimum annual sales of RM600,000.00.
Note that all money values have to be specified as with 2 decimal points, 10 spaces in width, and right-justified.
Use array (one-dimension or/and two-dimension) to store the input data from file and the output data.
The program should be written in several user-defined functions for example readFile() to read data from file, grandTotalSales() to calculate the total of sales over all store throughout the year, highestSale() to find the highest sale, lowestSale() to find the lowest sales, etc. Each function must be implemented with the concept of parameter passing. Use appropriate arguments for each function. Do not use global variables.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Databases And Information Systems 25th European Conference Adbis 2021 Tartu Estonia August 24 26 2021 Proceedings Lncs 12843

Authors: Ladjel Bellatreche ,Marlon Dumas ,Panagiotis Karras ,Raimundas Matulevicius

1st Edition

3030824713, 978-3030824716

More Books

Students also viewed these Databases questions