C++ How to Program (Early Objects Version)
10th Edition
ISBN: 9780134448824
Author: Paul Deitel; Harvey M. Deitel
Publisher: Pearson Education (US)
expand_more
expand_more
format_list_bulleted
Textbook Question
Chapter 7, Problem 7.21E
(Sales Summary) Use a two-dimensional array to solve the following problem. A company
has four salespeople (l to 4) who sell five different products (l to 5). Once a day, each salesperson
passes in a slip for each different type of product sold. Each slip contains the following:
- The salesperson number
- The product number
- The total dollar value of that product sold that day
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Python:
You must make a rock paper scissors game
Goal
Ask the player if they pick rock paper or scissors
ask for r, p, or s or 1, 2, or 3.
Have the computer chose its move
Compare the choices and decide who wins
Print the results
Sub-goals
Let the player play again
Keep a record of the score e.g. (Player: 3 / Computer: 6)
Keep a record of the games played (2 dimensional array)
Use a Functions for:
Comparing player choices
Error trap for choice
Correct answer will be upvoted else Multiple Downvoted. Computer science.
assume mid=⌊max(array)+min(array)2⌋, where max and min — are capacities that track down the maximum and the base array components. At the end of the day, mid is the amount of the maximum and the base component of array separated by 2 adjusted down.
Then, at that point, the array is parted into two parts left and right. The left array contains all components which are not exactly or equal mid, and the right array contains all components which are greater than mid. Components in left and right maintain their relative control from array.
During the third step we pick which of the left and right arrays we want to keep. The picked array replaces the current one and the other is permanently discarded.
You want to assist Mike with discovering the aftereffects of q beauty tests.
Note that you test the attractiveness of the array a, so you start each beauty test with the primordial (initial) array a.…
Warning ⚠️ Don't post AI generated answer or plagiarised answer. If I see these things I'll give you multiple downvotes and will report immediately.
Chapter 7 Solutions
C++ How to Program (Early Objects Version)
Ch. 7 - Exercises 7.6(Fill in the Blanks) Fill in the...Ch. 7 - (True or False) Determine whether each of the...Ch. 7 - (Write C++ Statements) Write C++ statements to...Ch. 7 - (Two-Dimensional array Questions) Consider a...Ch. 7 - (Salesperson Salary Ranges) Use a one-dimensional...Ch. 7 - (One-Dimensional array Questions) Write statements...Ch. 7 - (Find the Errors) Find the error(s) in each of the...Ch. 7 - (Duplicate Elimination with array) Use a...Ch. 7 - Prob. 7.14ECh. 7 - Prob. 7.15E
Ch. 7 - (Dice Rolling) Write a program that simulates...Ch. 7 - ( What Does This Code Do?) What does the following...Ch. 7 - (Craps Game Modification) Modify the program of...Ch. 7 - (Converting vector Example of Section 7.10 to...Ch. 7 - Prob. 7.20ECh. 7 - (Sales Summary) Use a two-dimensional array to...Ch. 7 - (Knight's Tour) One of the more interesting...Ch. 7 - (Knight's Tour: Brute Forty Approaches ) In...Ch. 7 - (Eight Queens) Another puzzler for chess buffs is...Ch. 7 - (Eight Queens: Brute Force Approaches) In this...Ch. 7 - Prob. 7.26ECh. 7 - (The Sieve of Eratosthenes) A prime integer is any...Ch. 7 - Prob. 7.28RECh. 7 - (Eight Queens) Modify the Eight Queens program you...Ch. 7 - (Print an array) Write a recursive function...Ch. 7 - Prob. 7.31RECh. 7 - Prob. 7.32RECh. 7 - (Maze Traversal) The grid of hashes (#) and dots...Ch. 7 - Prob. 7.34RECh. 7 - Making a Difference 7.35 (Polling) The Internet...
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
- Warning ⚠️ Don't post AI generated answer or plagiarised answer. If I see these things I'll give you multiple downvotes and will report immediately.arrow_forward(Evaluation of Trainees) Use a two-dimensional array to solve the following problem: A company has four trainees (1 to 4) who take five different programs (1 to 5). Once a week, the trainer creates evaluation results for each program taken. Each result contains the following: a. The trainee number b. The program number c. The score of that program taken that week (0 to 10 scores) Thus, the trainer creates 5 results per week for each trainee. Assume that the information from all the results for last month is available. Write an application that will read all this information for last month’s results and summarize the total scores by the trainee and by the program. All totals should be stored in the two-dimensional array. After processing all the information for last month, display the results in tabular format, with each column representing a trainee an each row representing a particular program. Average each row to get the average scores of each program for last month.…arrow_forwardWarning ⚠️ Don't post AI generated answer or plagiarised answer. If I see these things I'll give you multiple downvotes and will report immediately.arrow_forward
- Indicate true or false for the following statements: Every element in an array has the same type. The array size is fixed after it is declared. The array size declarator must be a constant expression. The array elements are initialized when an array is declared.arrow_forwardIn C++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
- (Numerical) Given a one-dimensional array of integer numbers, write and test a function that displays the array elements in reverse order.arrow_forward(FYI: Pseudocode is required (Not any programming language) Design a pseudocode program that loads an array with the following 7 values. Add one more word (of your own choosing) for a total of 8 words. biffcomelyfezmottleperukebedraggledquisling Be sure to use lowercase, as shown above. This will make the processing easier. Ask the user to enter a word Search through this array until you find a match with the word the user entered. Once you find a match, output "Yes, that word is in the dictionary". If you get to the end of the array and do NOT find a match, output "No, that word is not in the dictionary". The program should work with any set of words in the arrays. If I were to change the words in the arrays, it should still work. If you need help, look at the search example in your textbook.arrow_forwardI need help with this Java programming assignmentarrow_forward
- In C++arrow_forwardMonkey BusinessA 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 monkeys are represented by integers 1, 2, and 3; the weekdays are "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday". The program should first prompt the user to input the data for each monkey, starting with "Sunday" for monkey #1, then monkeys #2 and #3, followed by "Monday" for monkey #1, then monkeys #2 and #3 and so on, through "Saturday". The program then creates a report that includes the following information, each properly labeled (see below): 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…arrow_forwardi. Creates a matrix using: B=rand (20) a-write a program to find all numbers less than or equal 0.5 and put them in a new matrix with dimension 20x10. you can extend with zeros to fill the matrix. b- Do same as point a for all numbers above 0.5. c- Count all the numbers less or equal 0.3 , the numbers between 0.3 and 0.7 and count the numbers more than or equal 0.7.Put the results in a new vector with dimension 3x1. d- Replace the numbers of between 0.7 and 0.9 with 1. e- Add all the elements column wise.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrProgramming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher: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
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