Creates an array of six divsales objects

Assignment Help C/C++ Programming
Reference no: EM13168129

A corporation has six divisions, each responsible for sales to different geographic locations. Design a DivSales class that keeps sales data for a division, with the following members:

  • An array with four elements for holding four quarters of sales figures for the division.
  • A private static variable for holding the total corporate sales for all divisions for the entire year.
  • A member function that takes four arguments, each assumed to be the sales for a quarter. The value of the arguments should be copied into the array that holds the sales data. The total of the four arguments should be added to the static variable that holds the total yearly corporate sales.
  • A function that takes an integer argument within the range of 0-3. The argument is to be used as a subscript into the division quarterly sales array. The function should return the value of the array element with that subscript.

 

Write a program that creates an array of six DivSales objects. The program should ask the user to enter the sales for four quarters for each division. After the data are entered, the program should display a table showing the division sales for each quarter. The program should then display the total corporate sales for the year.

Reference no: EM13168129

Questions Cloud

You are to create a program : You are to create a program that will input a group of floating point values, storing them as double values in an array. This array will then be sent to three functions.
You are the admissions office at abc medical university : You are the Admissions Office at ABC Medical University. You have a large number of applicants for a very few number of available openings at your school. As a result, you need to set some high admission standards. To be accepted, a student ..
Numbers until the user wants and in the end display : Write a C program to enter the numbers until the user wants and in the end display the product of numbers entered by the user. The program should terminate once the user enters the character 'n' and continue computing product if user enters 'y'
Karatsuba''s divide-and-conquer algorithm : In class we discussed Karatsuba's divide-and-conquer algorithm for integer multiplication, which multiplies n-bit numbers by recursively multiplying n bit numbers. We take two numbers X and Y and split them each into their most significant half a..
Creates an array of six divsales objects : Write a program that creates an array of six DivSales objects. The program should ask the user to enter the sales for four quarters for each division. After the data are entered, the program should display a table showing the division sales for ..
Create a class in java to enable its object to be persiste : How do you create a class in Java to enable its object to be persistent? What are Java data streams and how are they used to facilitate storage and retrieval of persistent objects?
A sorting algorithm is described as stable : A sorting algorithm is described as stable if equal elements are in the same relative order in the sorted sequence as in the original sequence.
Create a flowchart that programs a robot to recognize : Create a flowchart that programs a robot to recognize how many playing cards you have and to put them in order from smallest to largest
Explain the eguation fot the neutralization reaction : write the balance the eguation fot the neutralization reaction between H2 SO4 KCH

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Dynamically allocates an array large enough

Write a program that dynamically allocates an array large enough to hold a number of test score. The size of the array should be input by the user

  Requires the number of bits for the exponent

Write a program that requires the number of bits for the exponent and significant of a Floating Point representation; then requires two decimal real numbers and an operation either sum

  Program that evaluates a infix expression

Program that evaluates a infix expression using stacks terminated by an equal sign. for example: (4-2)-5)/(2+1)-2))=the expression will contain single digit and the operators +, -, *,/. Make sure to consider the operator precedence.

  State diagram to recognize one form

Design a state diagram to recognize one form of the comments of the C-based programming languages, those that begin with /* and end with */. and also Write and test the code to implement the state diagram.

  Calculate the trajectory of a soccer ball

Write a program to calculate the trajectory (flight path) of a soccer ball

  Write the class definition for a class called complex

. Write the class definition for a class called complex.

  Implement a simplified version of the set class

You will implement a simplified version of the set class. You must implement all functions defined in the provided file set.h. You may add other member functions and variables as necessary.

  C program that compare the time required

Write a C program that compare the time required to compute the product of two 10,000 x 10,000 matrices with and without optimization for locality.

  Computing value of the return statement

In the following code snippet, what is the value of the return statement for x = 4 and n = 4? int foo(int x, int n)

  Write function that finds the minimum of three double value

1. Write a function that finds the minimum of three double values. This function should use another function that finds the minimum of two double values.

  Write a c program to compute dr if f1=50 lb and f2 = 4000

make a program for:A hydraulic lift as shown below from fluid mechanics, it can be shown that a small force F1     acting over a piston of diameter D 1    can be multiplied into a large force   F 2    acting over a piston of diameter D 2  .

  Define the class bankaccount

Define the class bankAccount to implement the basic properties of a bank account. An object of this class should store the following data: Account holder's name (string), account number (int), account type (string, checking/saving), balance (double),..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd