CASE STUDY 3 The Maslee Mart is a convenience store company operating in the state of...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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. 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.
Expert Answer:
Related Book For
Financial Accounting
ISBN: 978-0078025549
3rd edition
Authors: J. David Spiceland, Wayne Thomas, Don Herrmann
Posted Date:
Students also viewed these programming questions
-
Design a Java class that represents a cache with a fixed size. It should support operations like add, retrieve, and remove, and it should evict the least recently used item when it reaches capacity.
-
Let A, B be sets. Define: (a) the Cartesian product (A B) (b) the set of relations R between A and B (c) the identity relation A on the set A [3 marks] Suppose S, T are relations between A and B, and...
-
Using Figure 11.25 and the related text, describe the features of terracing, and list the major alterations to soil and water brought about by this agricultural method. Figure 11.25
-
This exercise requires that you have first done Exercise 3.199. In Example 3.12 on page 109, we found that, considering the five starting players on Team II a sample of all male starting college...
-
What are the potential problems with using the traditional application management approach on a virtual desktop? Reference:
-
A commercial steel flow channel in a heat exchanger has an equilateral triangle cross section with each side measuring \(5.0 \mathrm{in}\). and a length measuring \(96.0 \mathrm{in}\). Water at...
-
Omega Chemicals Limited took a $ 420,000 two- year note receivable from a customer in connection with a major sale transaction on 1 May 20X7. The note required annual 31 April interest payments of...
-
The measured values for the experiment with the Francis Turbine are as in the table. Calculate the hydraulic efficiency of the pump according to the given values. Francis N T Q H P g m Trbini (pompa)...
-
A loan of $7,419 was repaid at the end of 14 months. What amount of repayment check (principal and interest) was written, if a 4.7% annual rate of interest was charged?
-
Can you find an n such that the possible remainders of a perfect square when divided by n are all numbers between zero and n - 1? If you can, how many different such n can you find? If not, can you...
-
Write a method removeAfter() that takes a linked-list Node as its argument and removes the node following the given one (and does nothing if either the argument is nu11 or the next field of the...
-
A binary tree is heap ordered if the key at the root is larger than the keys in all of its descendants. Implement a linear-time method heapOrdered() that returns true if the tree is heap ordered, and...
-
A connected component in a graph is a maximal set of vertices that are mutually connected. Write a Graph client CCFinder that computes the connected components of a graph. Include a constructor that...
-
A binary tree is balanced if both its subtrees are balanced and the height of its two subtrees differ by at most 1. Implement a linear-time method balanced () that returns true if the tree is...
-
Develop a recursive solution to the previous question. Data from in previous question. Write a method \(\max ()\) that takes the first Node in a linked list as its argument and returns the value of...
-
Carry out the writing of codes in assembly language masm 615 a) Create a nested loop program in assembly which will produce exactly the following pattern on the screen: 55555 5555 555 55 5 (Note: you...
-
In the busy port of Chennai, India, the number of containers loaded onto ships during a 15-week period is as follows: 1. Develop a linear trend equation to forecast container loadings. 2. Using the...
-
Describe the operating, investing, and financing sections of the statement of cash flows.
-
Explain the difference between conservative and aggressive accounting practices.
-
On January 1, 2015, Splash City issues $500,000 of 9% bonds, due in 20 years, with interest payable semiannually on June 30 and December 31 each year. Required: Assuming the market interest rate on...
-
Why is it important to decompose a system into individual components?
-
If a pattern is used to model an overly broad portion of a system, the generality of resulting pattern is sacrificed. Explain with the help of an example.
-
Explain why a pattern representing rental system will not be complete and accurate.
Study smarter with the SolutionInn App