Purchase Solution

Multidimensional Arrays and Vectors

Not what you're looking for?

Ask Custom Question

**I need the following in C++**
The output needs to be in a table format.

A company has a product line that includes five items that sell for $100, $75, $120, $150, and $35. There are four salespersons working for this company, and the following report is for a given week:


Item Number

1 2 3 4 5

1 10 4 5 6 7
2 7 0 12 1 3
3 4 9 5 0 8
4 3 2 1 5 6

Write a program to:
-Compute the total dollar sales for each salesperson.
-Compute the total commission for each salesperson if the commission rate is 10 percent.
-Find the total income for each salesperson for the week if each salesperson receives a fixed salary of $500 per week in addition to commission payments.

Purchase this Solution

Solution Summary

Using multidimensional arrays and vectors in C++ is explained.

Solution Preview

// sales.cpp : Defines the entry point for the console application.


#include <iostream>
#include <conio.h>
using namespace std;

static const int MAX_ITEMS = 5 ;
static const int MAX_SP = 4 ; // sales persons

static float s_price [MAX_ITEMS] = { 100.00, 75.00, 120.00, 150.00, 35.00} ; // $100, $75, $120, $150, and $35
static int s_sales [MAX_SP] [MAX_ITEMS] = // ...

Purchase this Solution

Free BrainMass Quizzes
Word 2010: Table of Contents

Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.

C++ Operators

This quiz tests a student's knowledge about C++ operators.

Inserting and deleting in a linked list

This quiz tests your understanding of how to insert and delete elements in a linked list. Understanding of the use of linked lists, and the related performance aspects, is an important fundamental skill of computer science data structures.

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.

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.