Starting Out With C++: Early Objects (10th Edition)
10th Edition
ISBN: 9780135235003
Author: Tony Gaddis, Judy Walters, Godfrey Muganda
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Textbook Question
Chapter 8, Problem 16RQE
It’s best to think of a two -dimensional array as having _______ and ______
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Fill-in-the-Blank
To define a two-dimensional array, _________ size declarators are required.
You are provided a 2 dimensional array is created by the statement:
2
3
5
7
11
13
17
19
23
29
31
37
41
43
47
53
59
61
67
71
What value is accessed by the following statements:
num[1][7] = _________________
num[0][5] = __________________
num[1][4]= ___________________
num[0][9]= _____________________
num[1][0]=_____________________
Extra Credit: What is a common property of the values in the area?
You are implementing a Stack of chars The following statements are issued:
push (‘a’)
push (‘b’)
push (‘c’)
push (‘d’)
pop()
push(‘z’)
pop()
push(‘e’)
push(‘f’)
push (‘g’)
pop()
Display a representation of the stack at the end of the operations above from top to
bottom. You must label the top and bottom.
You have a queue of numbers and you issue the following instructions: (10 pts.)
add(33)
add(57)
add(75)
add(12)
remove()
remove()
add(101)
add(99)
remove()
add(67)
remove()
add(33)
remove()
List…
C LANGUAGE
Randomly generate 50 integers within the range of 0 – 999. Store the integers in an array.Pass the array to different functions that perform the tasks below:i. Print out the randomly generated integers in 5 rows, each row having 10 integer.Input: arrayreturn: none Random integer generation: #include<stdlib.h> rand(); //generate random integer rand()%999; //generate random integer between 0-999
ii. Show the range of integers generated: Output the smallest and largest integer and their index in the array.Input: arrayreturn: none
iii. Sort the integers in ascending orderInput: arrayreturn: none
findsmallestnumber(int start, int end, array)input: start index of array, end index of array, arrayreturn: smallest number index or position in array
iv. Generate another array of 50 integers. Compare the 2 arrays and count the similarity percentage of the 2 arrays.Input: Array1, Array2Return: none
** Use 2 for loops for this function,…
Chapter 8 Solutions
Starting Out With C++: Early Objects (10th Edition)
Ch. 8.3 - Define the following arrays: A) empNum, a 100...Ch. 8.3 - Prob. 8.2CPCh. 8.3 - Prob. 8.3CPCh. 8.3 - Assume a program includes the following two...Ch. 8.3 - What is array bounds checking? Does C++ perform...Ch. 8.3 - What is the output of the following code? int...Ch. 8.3 - Complete the following program skeleton so it will...Ch. 8.7 - Define the following arrays: A) ages, a 10-element...Ch. 8.7 - Indicate if each of the following array...Ch. 8.7 - Prob. 8.10CP
Ch. 8.7 - Given the following array definition: int values...Ch. 8.7 - Prob. 8.12CPCh. 8.7 - Prob. 8.13CPCh. 8.7 - What is the output of the following code? const...Ch. 8.9 - Write a typedef statement that makes the name...Ch. 8.9 - Prob. 8.16CPCh. 8.9 - What is the output of the following program...Ch. 8.9 - The following program segments, when completed,...Ch. 8.11 - Prob. 8.19CPCh. 8.11 - Prob. 8.20CPCh. 8.11 - Prob. 8.21CPCh. 8.11 - Prob. 8.22CPCh. 8.11 - Prob. 8.23CPCh. 8.11 - Fill in the empty table below so it shows the...Ch. 8.11 - Write a function called displayArray7. The...Ch. 8.11 - Prob. 8.26CPCh. 8.12 - Prob. 8.27CPCh. 8.12 - Write definition statements for the following...Ch. 8.12 - Define gators to be an empty vector of ints and...Ch. 8.13 - True or false: The default constructor is the only...Ch. 8.13 - True or false: All elements in an array of objects...Ch. 8.13 - What will the following program display on the...Ch. 8.13 - Complete the following program so that it defines...Ch. 8.13 - Add two constructors to the Product structure...Ch. 8.13 - Prob. 8.35CPCh. 8.13 - Prob. 8.36CPCh. 8.13 - Prob. 8.37CPCh. 8.13 - Write the definition for an array of five Product...Ch. 8.13 - Write a structure declaration called Measurement...Ch. 8.13 - Write a structure declaration called Destination ,...Ch. 8.13 - 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 - When you pass the name of an array as an argument...Ch. 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. 33RQECh. 8 - Prob. 34RQECh. 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 - Larger Than n Create a program with a function...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 - Lo Shu Magic Square The Lo Shu Magic Square is a...Ch. 8 - Baseball Champions This challenge uses two files...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. 14PCCh. 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...
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
Explain the term foreign key, and give an example.
Database Concepts (8th Edition)
(Printing Numbers from a Loop) Write a program that utilizes looping to print the numbers from 1 to 10 side by ...
C How to Program (8th Edition)
Course Grades In a course, a teacher gives the following tests and assignments: A lab activity that is observe...
Starting Out with C++ from Control Structures to Objects (9th Edition)
The method getValueFromFile is public and returns an int. It accepts no arguments. The method is capable of thr...
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
Run the hello, world program on your system. Experiment with leaving out parts of the program, to see what erro...
C Programming Language
Describe the advantages and disadvantages of DBMS-provided security.
Database Concepts (7th Edition)
Knowledge Booster
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
- (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().arrow_forward(Electrical eng.) a. An engineer has constructed a two-dimensional array of real numbers with three rows and five columns. This array currently contains test voltages of an amplifier. Write a C++ program that interactively inputs 15 array values, and then determines the total number of voltages in these ranges: less than 60, greater than or equal to 60 and less than 70, greater than or equal to 70 and less than 80, greater than or equal to 80 and less than 90, and greater than or equal to 90. b. Entering 15 voltages each time the program written for Exercise 7a runs is cumbersome. What method could be used for initializing the array during the testing phase? c. How might the program you wrote for Exercise 7a be modified to include the case of no voltage being present? That is, what voltage could be used to indicate an invalid voltage, and how would your program have to be modified to exclude counting such a voltage?arrow_forward(Statistics) a. Write a C++ program that reads a list of double-precision grades from the keyboard into an array named grade. The grades are to be counted as they’re read, and entry is to be terminated when a negative value has been entered. After all grades have been input, your program should find and display the sum and average of the grades. The grades should then be listed with an asterisk (*) placed in front of each grade that’s below the average. b. Extend the program written for Exercise 1a to display each grade and its letter equivalent, using the following scale: Between90and100=AGreaterthanorequalto80andlessthan90=BGreaterthanorequalto70andlessthan80=CGreaterthanorequalto60andlessthan70=DLessthan60=Farrow_forward
- use C++ programming language A local zoo wants to keep track of how many pounds of food each of its three monkeys eats each day during a typical week. Write a program that stores this information in a two-dimensional 3×7 array, where each row represents a different monkey and each column represents a different day of the week. The program should first have the user input the data for each monkey. Then it should create a report that includes the following information: Average amount of food eaten per day by the whole family of monkeys The least amount of food eaten during the week by any one monkey The greatest amount of food eaten during the week by any one monkey.arrow_forwardc#arrow_forwardMust use C language to create a BINGO game Criteria: 1. bingo array must be a 2D array of 5x5 2.Generate unique random number for each column and row of the bingo card 3. Create a function to fill the bingo card with random numbers. Each column has its own range. Column B is between 1-15, column I between 16-30, column N between 31-45, column G between 46-60, and column O between 61-75. Total unique random numbers generate are 75. 4. Write a function to print the bingo card 5. Write a function to pick a number that has not already been chosen. You will need to use a 1D array to keep track of which numbers between 1 and 75 have been used so that you don’t pick numbers that have already been called. If you randomly pick a number that was already called, then pick another. Continue this process until you find a number that has not been previously called. Print the number to the screen along with its corresponding letter. This function should return that value. 6. Write a function to…arrow_forward
- Must use C language to create a BINGO game Criteria: 1. bingo array must be a 2D array of 5x5 2.Generate unique random number for each column and row of the bingo card 3. Create a function to fill the bingo card with random numbers. Each column has its own range. Column B is between 1-15, column I between 16-30, column N between 31-45, column G between 46-60, and column O between 61-75. Total unique random numbers generate are 75. 4. Write a function to print the bingo card 5. Write a function to pick a number that has not already been chosen. You will need to use a 1D array to keep track of which numbers between 1 and 75 have been used so that you don’t pick numbers that have already been called. If you randomly pick a number that was already called, then pick another. Continue this process until you find a number that has not been previously called. Print the number to the screen along with its corresponding letter. This function should return that value. 6. Write a function to…arrow_forwardThe table below shows the exam marks of five students from a class. Student Marks 3 4 48 40 37 25 52 The passing marks for the exam is 40. Write a C program that displays 'PASS' or 'FAIL' for each student depending on their respective marks. The marks of the students must be stored in a one-dimensional array. Finally, the program should also display the number of students that pass the exam and the number of students that fail the exam. Write your C Program here:arrow_forwardQuestion Using C# make a one-dimensional array to solve the following problem: A company pays its salespeople on a commission basis. The salespeople receive $200 per week plus 9% of their gross sales for that week. For example, a salesperson who grosses $5000 in sales in a week receives $200 plus 9% of $5000, or a total of $650. Write an app (using an array of counters) that determines how many of the salespeople earned salaries in each of the following ranges (assume that each salesperson's salary is an integer). Summarize the results in tabular format. 1. $100-199 2. $200-299 3. $300-399 4. $400-499 5. $500-599 6. $600-699 7. $700-799 8. $800-899 9. $900 and overarrow_forward
- Program 3 SRC voting application You must write a small application in JAVA that stores SRC candidate names and the votes they received. Your program must: 1. Create an array of SRC candidate names. Populate the array with ten names. 2. Create an array of votes. Populate the array with the number of votes for every candidate. The two arrays work in parallel. 3. Print the name of every candidate with his/her number of votes. 4. Print the total number of votes casted. 5. Add votes for a specific candidate. a. Read the name of the candidate b. Add one vote for the specific candidate C. Print the name of the candidate and his/her number of votesarrow_forwardC Program/ C Language Make a C program for the array. Enter a bunch of integers then it should print the largest sum of a strictly ascending sequence of the array. A strictly ascending sequence is a sequence where the current number is always lesser than the next number.arrow_forwardquery the user for the size of an array of integers build an array of integers and fill it with random integer values. The values will range between 0 and 100 display the array clone the array display the cloned array sort the cloned array display the original array and the sorted cloned array create another array that is double the size of the cloned array and copy the data from the cloned array into the new array. Then fill the remaining cells in the new array with random values. These will also range between 0 and 100.Note: int[] newArray = new int[clone.lenght*2] Write program in jvaarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Programming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTProgramming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage Learning
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningC++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
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
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