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

  Use a for loop to generate 100 random numbers.

Use a For Loop to generate 100 random numbers. Determine the most current maximum and minimum number as the random numbers are being generated. This is referred tp as a "running" maximum and minimum. Display the running maximum and minimum values as ..

  Write a c program that reads a data file of floating numbers

Write a program that reads a data file of floating numbers into an array and prints the array elements along with the number of items in the array

  Calculates the average of three test scores

Write a program that calculates the average of three test scores. The program should contain three value-returning functions: main, getTestScore, and calcAverage

  Create a global array of structures

Create a global array of structures with the following data. Each structure should store the data (Employee Table - Name, age, salary information) . Array size must be at least 10

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

  Write a function num_digits(n)

C programing, not C++ write a function num_digits(n) that returns the number of digits in a nonnegative integer n.

  Write program which prompts user to enter numbers

Write down the program which prompts the user to enter numbers, findsout how many positive and negative values have been entered, and calculates sum and average of numbers entered.

  C program to randomly generate more than ten ip address

Write C or C++ program which Randomly generates more than 10 IP addresses written in decimal format and write results in text file (e.g. Dec_IPAddresses.txt)

  Your program will read the array

Your program will read the array from the file, check the diagonal and print a report containing the size and the status of the diagonal. A typical report would look like: The matrix is 3x3 and all the numbers on the main diagonal are the same.

  Write a program for a college''s admissions office

Write a program for a college's admissions office. Create variables that store a numeric high school grade point average andan admission test score.Print the message "Accept" if the studenthas any of the following:

  Assign passed value to function to return value

Assign passed value to this member and another function to return value. Your main should read the integer from an input data file, and write the output to the output data file.

  C program to solve the quadratic equation of rocket launch

Write a C program to solve the quadratic equation of rocket launch by computing the roots (t1 and t2) of that quadratic equation: gt2 + vt + l = 0 (or) for simplicity ax2 + bx + c = 0. Get the values of g, v, and l from the user. The program should d..

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