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
Concept explainers
Textbook Question
Chapter 7, Problem 7.13E
(Duplicate Elimination with array) Use a one-dimensional array to solve the following problem. Read in 20 numbers, each of which is between 10 and 100, inclusive. As each number is read, validate it and store it in the array only if it isn’t a duplicate of a number already read. After reading all the values, display only the unique values that the user entered. Provide for the “worst case” in which all 20 numbers are different. Use the smallest possible array to solve this problem.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
(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.
Correct the errors in the following statements.
Each row in a one-dimensional array could be treated as a two-dimensional array.
Alert dont submit AI generated answer.
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
- Totaled columns. (Ending of sentence on attachment) please assist with Java code. Please attachment screenshot of successful output.arrow_forward(See attached photo) Please explain the exact running time of the program. The attached photo's answer is already correct only the explanation of getting the exact running time is needed.arrow_forwardUse a single-subscripted array to solve the following problem. Read in 10 numbers, as each number is read, save it in the array only if it is not a duplicate of a number already read. If user enter 5 times duplicated number, then stop taking numbers and print the array. Write a C codearrow_forward
- Problem 3: Use a one dimensional array to solve the following problem: Read in 10 numbers, each of which is between 10 and 100. As each number is read, print it only if it’s not a duplicate of a number that has already been read. Provide for the “worst case,” in which all 10 numbers are different. Use the smallest possible array to solve the problem.arrow_forwardCorrect 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.…arrow_forwardANSWER IN JAVA: Write an application that inputs five numbers, each between 10 and 100, inclusive. As each number is read, display it only if it’s not a duplicate of a number already read. Provide for the “worst case,” in which all five numbers are different. Use the smallest possible array to solve this problem. Display the complete set of unique values input after the user enters each new value. NOTE: looking for the output to appear on three lines as shown in the results STANDARD OUTPUT: Enter·an·integer·between·10·and·100:This·is·the·first·time·100·has·been·entered↵ Enter·an·integer·between·10·and·100:Enter·an·integer·between·10·and·100:This·is·the·first·time·10·has·been·entered↵ Enter·an·integer·between·10·and·100:This·is·the·first·time·20·has·been·entered↵ Enter·an·integer·between·10·and·100:The·complete·set·of·unique·values·entered·is:↵ Unique·Value·1:·is·100↵ Unique·Value·2:·is·10↵ Unique·Value·3:·is·20↵arrow_forward
- 1.Write the code to take an array (int stuff[100]) and initialize each element of stuff to -1. 2.Write the code to take an array (int stuff[100]) and initialize each element with user input a.Update the program to sum the values in the array. b.Update the program to print all elements of the array in reverse order. c.Update the program to search through the array and find the smallest value in the array. d.Update the program to search through the array for the value 6, and print “found it”, if it exists. #####java only#####arrow_forward: Declare a two-dimensional array which can be used to store a yearly budget.Each row of the array corresponds to a particular budgeted item like rent, electric,etc. There are at most 15 items to be budgeted. Each column of the array correspondsto a month, January, February, etc. Of course there are 12 columns corresponding tothe 12 months of the year. All the data to be placed in the array consists of realnumbersarrow_forward(See attached photo) Please explain the flow of finding the exact running time of the program. The attached photo's answer is already correct only explanation is needed.arrow_forward
- (1) Prompt the user to enter five numbers, being five people's weights. Store the numbers in an array of doubles. Output the array's numbers on one line, each number followed by one space. Ex: Enter weight 1: 236.0 Enter weight 2: 89.5 Enter weight 3: 142.0 Enter weight 4: 166.3 Enter weight 5: 93.0 You entered: 236.0 89.5 142.0 166.3 93.0 (2) Output the total weight, by summing the array's elements. (3) Output the average of the array's elements, with 2 decimal places. (4) Output the max array element. Ex: Enter weight 1: 236.0 Enter weight 2: 89.5 Enter weight 3: 142.0 Enter weight 4: 166.3 Enter weight 5: 93.0 You entered: 236.0 89.5 142.0 166.3 93.0 Total weight: 726.8 Average weight: 145.36 Max weight: 236 Code: import java.util.Scanner; public class PeopleWeights { public static void main(String[] args) { /* Type your code here. */ }}arrow_forwardDeclare an array to hold the tax for up to 10 different sales.arrow_forwardUse a one-dimensional array to solve the following problem. Read in 20 numbers, each of which is between 10 and 100, inclusive. As each number is read, validate it and store it in the array only if it is not a duplicate of a number already read. After reading all the values, display only the unique values that the user entered. Provide for the “worst case” in which all 20 numbers are different. Use the smallest possible array to solve this problem.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 LearningProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:Cengage
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
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
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
9.1: What is an Array? - Processing Tutorial; Author: The Coding Train;https://www.youtube.com/watch?v=NptnmWvkbTw;License: Standard Youtube License