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

image

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: O O 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: o The program should print out a report into an output file as shown in Figure 3.2. O The report should include: o 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. o The total sales for each store. o The list of profitable stores. A store is considered profitable if it manages to achieve minimum annual sales of RM600,000.00. O O O O o 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.

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

Financial Accounting

Authors: J. David Spiceland, Wayne Thomas, Don Herrmann

3rd edition

9780077506902, 78025540, 77506901, 978-0078025549

More Books

Students also viewed these Programming questions

Question

Using (1) or (2), find L(f) if f(t) if equals: t cos 4t

Answered: 1 week ago