Starting Out With C++, Early Objects - With Access Package
Starting Out With C++, Early Objects - With Access Package
8th Edition
ISBN: 9780133441840
Author: GADDIS
Publisher: PEARSON
bartleby

Videos

Textbook Question
Book Icon
Chapter 8, Problem 9PC

Stats Class and Rainfall Statistics

Create a Stats class whose member data includes an array capable of storing 30 double data values, and whose member functions include total, average, lowest, and highest functions for returning information about the data to the client program. These are general versions of the same functions you created for Programming Challenge 8, but now they belong to the Stats class, not the application program. In addition to these functions, the Stats class should have a Boolean storeValue function that accepts a double value from the client program and stores it in the array. It is the job of this function to keep track of how many values are currently in the array, so it will know where to put the next value it receives and will know how many values there are to process when it is carrying out its other functions. It is also the job of this function to make sure that no more than 30 values are accepted. If the storeValue function is able to successfully store the value sent to it, it should return true to the client program. However, if the client program tries to store a thirty-first value, the function should not store the value and should return false to the client program.

The client program should create and use a Stats object to carry out the same rainfall analysis requested by Programming Challenge 8. Notice that the Stats object does no I/O. All input and output is done by the client program.

Blurred answer
Students have asked these similar questions
please help me with the pseudocode for this I need it.  Student Name Student Id Student Grades (an array of 3 grades) A constructor that clears the student data (use -1 for unset grades) Get functions for items a, b, and c, average, and letter grade Set functions for items a, n, and c Note that the get and set functions for Student grades need an argument for the grade index. Need another class which will contain: An Array of Students (1 above) A count of the number of students in the use You need to create a menu interface that allows you to: Add new students Enter test grades Display all the students with their names, ids, test grades, average, and letter grade Exit the program
Array Processing. In this problem, you have two tasks: To create the header file, arrayOptn.h, and add the function declarations of the following functions listed below. To create the file, arrayOptn.c, which implements the functions in the arrayOptn.h You are already provided with the main() function. Do not edit anything there in the main.c file. List of functions to be implemented: 1 - void createArray(int arr[], int count, int maxCapacity) Parameters: int arr[] - a reference to an array int count - the number of elements to be inputted by the user and to be stored in the array int maxCapacity - the max capacity of the array Description: Asks the user for the elements of the array. The prompt message is: "Enter element at index N: " where N is the current index position being scanned. Each inputted integer must be unique. If an element already exists in the array, you prompt the user the message "Inputted element already exists, try another number" If the count is…
(CP6) Write a function that is passed an array of structs and performs calculations.  The function should locate the highest gpa from a group of students.  The function is passed the array of structs, the first element to be searched, and the last element to be searched.  The return value of the function is the highest gpa in the search range.    struct data{  string name;  double gpa;}; double highestGpa( data [ ],  int, int  ); data [ ] - array of structs to search int - first element to be searched int - last element to be searched return  - highest gpa from group

Chapter 8 Solutions

Starting Out With C++, Early Objects - With Access Package

Ch. 8.6 - Given the following array definition: int values...Ch. 8.6 - Prob. 8.12CPCh. 8.6 - Prob. 8.13CPCh. 8.6 - What is the output of the following code? const...Ch. 8.8 - Write a typedef statement that makes the name...Ch. 8.8 - Prob. 8.16CPCh. 8.8 - What is the output of the following program...Ch. 8.8 - The following program segments, when completed,...Ch. 8.10 - Prob. 8.19CPCh. 8.10 - Prob. 8.20CPCh. 8.10 - Prob. 8.21CPCh. 8.10 - Prob. 8.22CPCh. 8.10 - Prob. 8.23CPCh. 8.10 - Fill in the empty table below so it shows the...Ch. 8.10 - Write a function called displayArray7. The...Ch. 8.10 - Prob. 8.26CPCh. 8.11 - Prob. 8.27CPCh. 8.11 - Write definition statements for the following...Ch. 8.11 - Define gators to be an empty vector of ints and...Ch. 8.12 - True or false: The default constructor is the only...Ch. 8.12 - True or false: All elements in an array of objects...Ch. 8.12 - What will the following program display on the...Ch. 8.12 - Complete the following program so that it defines...Ch. 8.12 - Add two constructors to the Product structure...Ch. 8.12 - Prob. 8.35CPCh. 8.12 - Prob. 8.36CPCh. 8.12 - Prob. 8.37CPCh. 8.12 - Write the definition for an array of five Product...Ch. 8.12 - Write a structure declaration called Measurement...Ch. 8.12 - Write a structure declaration called Destination ,...Ch. 8.12 - Define an array of 20 Destination structures (see...Ch. 8 - The ________ indicates the number of elements, or...Ch. 8 - The size declarator must be a(n) _______ with a...Ch. 8 - Prob. 3RQECh. 8 - Prob. 4RQECh. 8 - The number inside the brackets of an array...Ch. 8 - C++ has no array ________ checking, which means...Ch. 8 - Prob. 7RQECh. 8 - If a numeric array is partially initialized, the...Ch. 8 - If the size declarator of an array definition is...Ch. 8 - Prob. 10RQECh. 8 - Prob. 11RQECh. 8 - Prob. 12RQECh. 8 - Arrays are never passed to functions by _______...Ch. 8 - To pass an array to a function, pass the ________...Ch. 8 - A(n) ________ array is like several arrays of the...Ch. 8 - Its best to think of a two -dimensional array as...Ch. 8 - Prob. 17RQECh. 8 - Prob. 18RQECh. 8 - When a two -dimensional array is passed to a...Ch. 8 - Prob. 20RQECh. 8 - Look at the following array definition. int values...Ch. 8 - Given the following array definition: int values...Ch. 8 - Prob. 23RQECh. 8 - Assume that array1 and array2 are both 25-element...Ch. 8 - Prob. 25RQECh. 8 - How do you establish a parallel relationship...Ch. 8 - Look at the following array definition. double...Ch. 8 - Prob. 28RQECh. 8 - Prob. 29RQECh. 8 - Prob. 30RQECh. 8 - Prob. 31RQECh. 8 - The following code totals the values in each of...Ch. 8 - In a program you need to store the identification...Ch. 8 - Prob. 34RQECh. 8 - Prob. 35RQECh. 8 - Prob. 36RQECh. 8 - Prob. 37RQECh. 8 - Prob. 38RQECh. 8 - Each of the following functions contains errors....Ch. 8 - Soft Skills Diagrams are an important means of...Ch. 8 - Perfect Scores 1. Write a modular program that...Ch. 8 - Roman Numeral Converter Write a program that...Ch. 8 - Chips and Salsa Write a program that lets a maker...Ch. 8 - Monkey Business A local zoo wants to keep track of...Ch. 8 - Rain or Shine An amateur meteorologist wants to...Ch. 8 - Lottery Write a program that simulates a lottery....Ch. 8 - Rainfall Statistics Write a modular program that...Ch. 8 - Chips and Salsa Version 2 Revise Programming...Ch. 8 - Stats Class and Rainfall Statistics Create a Stats...Ch. 8 - Stats Class and Track Statistics Write a client...Ch. 8 - Prob. 11PCCh. 8 - Drivers License Exam The State Department of Motor...Ch. 8 - Array of Payro11 Objects Design a PayRoll class...Ch. 8 - Drink Machine Simulator Create a class that...Ch. 8 - Bin Manager Class Design and write an object...Ch. 8 - Tic-Tac-Toe Game Write a modular program that...Ch. 8 - Theater Ticket Sales Create a TicketManager class...
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Text book image
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
1.1 Arrays in Data Structure | Declaration, Initialization, Memory representation; Author: Jenny's lectures CS/IT NET&JRF;https://www.youtube.com/watch?v=AT14lCXuMKI;License: Standard YouTube License, CC-BY
Definition of Array; Author: Neso Academy;https://www.youtube.com/watch?v=55l-aZ7_F24;License: Standard Youtube License