Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Programming Assienment #1 Two-dimension arrays Program 1: A wholesale company has five branch offices. Provided below are quarterly sales figures for these branch offices for

image text in transcribed

Programming Assienment #1 Two-dimension arrays Program 1: A wholesale company has five branch offices. Provided below are quarterly sales figures for these branch offices for a particular year Branch-I Branch-2 ranch-3 nch Iranch-5 Total Quarter.] 150,00 57,00 39.540 . Quarter-2-1-123.350 100 500 277, 00 Quarter 3 67000232000 Quarter-4 95.000 letal; Wite a program to 1) Compute the sum of quarterly sales generated by all five branches for all four quarters (four row sums) and 21 compute the sums of sales generated by each branch over four quarters (yearly total sales) for all five branches (five column sums) In the main function of your program, Declare a 4 x 5 array named sales to store the sales figures shown in the gray cells of the above table. Declare a 1D array named gtrlysum to store the total sales generated by all five branches quarter 1, 2, 3, and 4 (shown in four brown celn the above table) Declare a 1D array named branchSum to store the total sales generated by branch 1, 2, 3, 4, and 5 (shown in . in the above table) The main function then calls the following functions fu2DArroyll to fill the 2D arry with values shown in gray cells .compute@triySumsi) to store computed values in qtriySum array . computeBranchSums) to store compted values in branchSum array displayYearly SalesReport) to display a summery sales table similar to the table shown above. void ri112DArray lint sal1ts).int nurawal void computegerlyguralint sales[115]' int qtrlysuall, ist nurgers. int nunB ranches) vosd computeRranchsuns int salea151.int branchaun1ist SurQtra, int sunbrancbesl : vold dieplayYearlysalesReport int salestl 151.iat gtriysunli. ist brancbSun1int nunGErs.Int Notice that 1) the pre and post conditions are intentionally left out and yau must properly provide them in your program. 2) You do not have to insert "commas" in numbers that appear in your output. 3] Use the values shown in the above table

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

Introduction To Constraint Databases

Authors: Peter Revesz

1st Edition

1441931554, 978-1441931559

More Books

Students also viewed these Databases questions

Question

Acceptance of the key role of people in this process of adaptation.

Answered: 1 week ago

Question

preference for well defined job functions;

Answered: 1 week ago