Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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,

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 companys 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 The program should read in sales data from a text file named sales2014.dat as shown
in Figure 3.1.
o 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.
o The average sales per month.
o The highest sales. Print the store, month and the sales whose the highest sales.
o The lowest sales. Print the store, month and the sales whose the lowest sales.
o 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.
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

Database Technology And Management Computers And Information Processing Systems For Business

Authors: Robert C. Goldstein

1st Edition

0471887374, 978-0471887379

More Books

Students also viewed these Databases questions