Purchase Solution

Multidimensional Arrays and Vectors

Not what you're looking for?

Ask Custom Question

I need the following in C++

Suppose that a certain automobile dealership sells ten different models of automobiles and employees eight salespersons. A record of sales for each month can be represented by a table in which each row contains the number of sales of each model by a given salesperson and each column contains the number of sales by each salesperson of a given model. For example, suppose that the sales table for a certain month is as follows:

0 0 2 0 5 6 3 0
5 1 9 0 0 2 3 2
0 0 0 1 0 0 0 0
1 1 1 0 2 2 2 1
5 3 2 0 0 2 5 5
2 2 1 0 1 1 0 0
3 2 5 0 1 2 0 4
3 0 7 1 3 5 2 4
0 2 6 1 0 5 2 1
4 0 2 0 3 2 1 0

Write a program to produce a monthly sales report, displaying the monthly sales table in the form:

Salesperson
Model : 1 2 3 4 5 6 7 8: Totals
-------------------------------------------------------------------
1 : 0 0 2 0 5 6 3 0 : 16
2 : 5 1 9 0 0 2 3 2 : 22
3 : 0 0 0 1 0 0 0 0 : 1
4 : 1 1 1 0 2 2 2 1 : 10
5 : 5 3 2 0 0 2 5 5 : 22
6 : 2 2 1 0 1 1 0 0 : 7
7 : 3 2 5 0 1 2 0 4 : 17
8 : 3 0 7 1 3 5 2 4 : 25
9 : 0 2 6 1 0 5 2 1 : 17
10 : 4 0 2 0 3 2 1 0 : 12
-------------------------------------------------------------------
Totals : 23 11 35 3 15 27 18 17

As indicated, the report should also display the total number of automobiles sold by each salesperson and the total number of each model sold by all salespersons.

Purchase this Solution

Solution Summary

Using multidimensional arrays and aectors in C++ is demonstrated.

Purchase this Solution


Free BrainMass Quizzes
C# variables and classes

This quiz contains questions about C# classes and variables.

Java loops

This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.

Javscript Basics

Quiz on basics of javascript programming language.

Basic Networking Questions

This quiz consists of some basic networking questions.

Word 2010: Tables

Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.