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
Textbook Question
Chapter 8, Problem 1RQE

The ________ indicates the number of elements, or values, an array can hold.

Expert Solution & Answer
Check Mark
Program Description Answer

The “size declarator” represents the number of elements that the array can hold.

Explanation of Solution

Array:

An array is a collection of data used to store the values of the same type.

The following is the syntax of an array:

datatype array_name[size_declarator];

  • The datatype is defined as the kind of data stored.
  • The array_name is a user defined name. 
  • The size_declarator is the size of the array and it should be greater than zero.

Consider the following example for an array declaration:

//Declare the size of an array

int values[5];

Explanation:

  • From the above example, “int” represents the data type of the array, “values[]” is the array name and the number assigned inside the brackets is the size declarator of the array.
  • The size declaratory “[5]” indicates the array holds “5” elements.

Want to see more full solutions like this?

Subscribe now to access step-by-step solutions to millions of textbook problems written by subject matter experts!
04:39

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
Similar questions
  • (Electrical eng.) Write a program that declares three one-dimensional arrays named volts, current, and resistance. Each array should be declared in main() and be capable of holding 10 double-precision numbers. The numbers to store in current are 10.62, 14.89, 13.21, 16.55, 18.62, 9.47, 6.58, 18.32, 12.15, and 3.98. The numbers to store in resistance are 4, 8.5, 6, 7.35, 9, 15.3, 3, 5.4, 2.9, and 4.8. Your program should pass these three arrays to a function named calc_volts(), which should calculate elements in the volts array as the product of the corresponding elements in the current and resistance arrays (for example ,volts[1]=current[1]resistance[1]). After calc_volts() has passed values to the volts array, the values in the array should be displayed from inside main().
    (Statistics) Write a program that includes two functions named calcavg() and variance(). The calcavg() function should calculate and return the average of values stored in an array named testvals. The array should be declared in main() and include the values 89, 95, 72, 83, 99, 54, 86, 75, 92, 73, 79, 75, 82, and 73. The variance() function should calculate and return the variance of the data. The variance is obtained by subtracting the average from each value in testvals, squaring the values obtained, adding them, and dividing by the number of elements in testvals. The values returned from calcavg() and variance() should be displayed by using cout statements in main().
    Write a statement that declares a procedure-level one-dimensional array named intorders. The array should contain 15 elements.
    Recommended textbooks for you
  • Programming with Microsoft Visual Basic 2017
    Computer Science
    ISBN:9781337102124
    Author:Diane Zak
    Publisher:Cengage Learning
    Microsoft Visual C#
    Computer Science
    ISBN:9781337102100
    Author:Joyce, Farrell.
    Publisher:Cengage Learning,
    Systems Architecture
    Computer Science
    ISBN:9781305080195
    Author:Stephen D. Burd
    Publisher:Cengage Learning
  • Programming Logic & Design Comprehensive
    Computer Science
    ISBN:9781337669405
    Author:FARRELL
    Publisher:Cengage
    C++ Programming: From Problem Analysis to Program...
    Computer Science
    ISBN:9781337102087
    Author:D. S. Malik
    Publisher:Cengage Learning
    C++ for Engineers and Scientists
    Computer Science
    ISBN:9781133187844
    Author:Bronson, Gary J.
    Publisher:Course Technology Ptr
  • Programming with Microsoft Visual Basic 2017
    Computer Science
    ISBN:9781337102124
    Author:Diane Zak
    Publisher:Cengage Learning
    Microsoft Visual C#
    Computer Science
    ISBN:9781337102100
    Author:Joyce, Farrell.
    Publisher:Cengage Learning,
    Systems Architecture
    Computer Science
    ISBN:9781305080195
    Author:Stephen D. Burd
    Publisher:Cengage Learning
    Programming Logic & Design Comprehensive
    Computer Science
    ISBN:9781337669405
    Author:FARRELL
    Publisher:Cengage
    C++ Programming: From Problem Analysis to Program...
    Computer Science
    ISBN:9781337102087
    Author:D. S. Malik
    Publisher:Cengage Learning
    C++ for Engineers and Scientists
    Computer Science
    ISBN:9781133187844
    Author:Bronson, Gary J.
    Publisher:Course Technology Ptr