Starting Out with C++: Early Objects (9th Edition)
9th Edition
ISBN: 9780134400242
Author: Tony Gaddis, Judy Walters, Godfrey Muganda
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Textbook Question
Chapter 9, Problem 3PC
Lottery Winners Modification
Modify the program you wrote for
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Finding the common members of two dynamic arrays: Write a program that first reads two arrays and then finds their common members (intersection). The program should first read an integer for the size of the array and then should create the two arrays dynamically (using new) and should read the numbers into array1 and array2 and then should find the common members and show it.
Note: The list of the common members should be unique. That is no member should be listed more than once.
Tip: A simple for loop is needed on one of the arrays (like array1) and one inner for loop for on array2. Then for each member of array1, if we find any matching member in array2, we record it.
Sample run:
Enter the number of elements of array 1: 7
Enter the elements of array 1: 10 12 13 10 14 15 12
Enter the number of elements of array 2: 5
Enter the elements of array 2: 17 12 10 19 12
The common members of array1 and array2 are: 12 10
C++ Lexicographical Sorting
Given a file of unsorted words with mixed case: read the entries in the file and sort those words lexicographically. The program should then prompt the user for an index, and display the word at that index. Since you must store the entire list in an array, you will need to know the length. The "List of 1000 Mixed Case Words" contains 1000 words.
You are guaranteed that the words in the array are unique, so you don't have to worry about the order of, say, "bat" and "Bat."
For example, if the array contains ten words and the contents are
cat Rat bat Mat SAT Vat Hat pat TAT eat
after sorting, the word at index 6 is Rat
You are encouraged to use this data to test your program.
you must include a while loop in this function
you should not us any of the following:
dictionaries or dictionary methods
try-except
break and continue statements
recursion
map / filter
Chapter 9 Solutions
Starting Out with C++: Early Objects (9th Edition)
Ch. 9.2 - Prob. 9.1CPCh. 9.2 - Prob. 9.2CPCh. 9.2 - Prob. 9.3CPCh. 9.2 - Prob. 9.4CPCh. 9.3 - True or false: Any sort can be modified to sort in...Ch. 9.3 - Prob. 9.6CPCh. 9.3 - Prob. 9.7CPCh. 9.3 - Prob. 9.8CPCh. 9.3 - Prob. 9.9CPCh. 9.6 - Prob. 9.10CP
Ch. 9.6 - Prob. 9.11CPCh. 9.6 - Prob. 9.12CPCh. 9.6 - Prob. 9.13CPCh. 9.6 - Prob. 9.14CPCh. 9.6 - Prob. 9.15CPCh. 9 - Prob. 1RQECh. 9 - Prob. 2RQECh. 9 - Prob. 3RQECh. 9 - Prob. 4RQECh. 9 - Prob. 5RQECh. 9 - Prob. 6RQECh. 9 - Prob. 7RQECh. 9 - A binary search will find the value it is looking...Ch. 9 - The maximum number of comparisons that a binary...Ch. 9 - Prob. 11RQECh. 9 - Prob. 12RQECh. 9 - Bubble sort places ______ number(s) in place on...Ch. 9 - Selection sort places ______ number(s) in place on...Ch. 9 - Prob. 15RQECh. 9 - Prob. 16RQECh. 9 - Why is selection sort more efficient than bubble...Ch. 9 - Prob. 18RQECh. 9 - Prob. 19RQECh. 9 - Prob. 20RQECh. 9 - Prob. 21RQECh. 9 - Charge Account Validation Write a program that...Ch. 9 - Lottery Winners A lottery ticket buyer purchases...Ch. 9 - Lottery Winners Modification Modify the program...Ch. 9 - Batting Averages Write a program that creates and...Ch. 9 - Hit the Slopes Write a program that can be used by...Ch. 9 - String Selection Sort Modify the selectionSort...Ch. 9 - Binary String Search Modify the binarySearch...Ch. 9 - Search Benchmarks Write a program that has at...Ch. 9 - Sorting Benchmarks Write a program that uses two...Ch. 9 - Sorting Orders Write a program that uses two...Ch. 9 - Ascending Circles Program 8-31 from Chapter 8...Ch. 9 - Modified Bin Manager Class Modify the BinManager...Ch. 9 - Using Files-Birthday List Write a program that...Ch. 9 - Prob. 14PCCh. 9 - Using Files-String Selection Sort Modification...Ch. 9 - Using Vectors String Selection Sort Modification...
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
Suppose bla is an object, dobedo is a member function of the object bla, and dobedo takes one argument of type ...
Problem Solving with C++ (10th Edition)
Ingredient Adjuster A cookie recipe calls for the following ingredients: 1.5 cups of sugar cup of butter 2.75 c...
Starting Out with Java: Early Objects (6th Edition)
Fill in the blanks in each of the following statements: Thestatement, when executed in an iteration statement, ...
Java How To Program (Early Objects)
Consider the following skeletal C program: void fun1(void); / prototype / void fun2(void); / prototype / void f...
Concepts of Programming Languages (11th Edition)
Is overloading a method name an example of polymorphism?
Java: An Introduction to Problem Solving and Programming (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)
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
- Dictionary Swap Write a function called dictionary_swap that takes a dictionary as a parameter. It does not modify the original dictionary, but it creates and returns a new one. Keys from the original dictionary become values in the new one, and values become keys. For example, given the inputs below, your program should return the corresponding values. Input to the Function Returns {'one':1, 'two': 2, 'three':3} {1:'one', 2:'two', 3:'three'} {-1:-10, -2:-20, -3:-30} {-10:-1, -20:-2, -30:-3} {} {}arrow_forwardCreate class called Student:Attributes: char * street char * city char * state char * studentName long id Create a class with main: The program will ask the student for information and then print it out in the terminal. Using dynamic memory to create an array. Implementing a menu: Add Student Search for Student Show List of Students Exit Your program should be modular. Answer without using string and implement a dynamic array in c++arrow_forwardTask 3: Statistics using arrays: by java programming With the spread of COVID 19, the HR department in a company has decided to conduct some statistics among the employees in order to determine the number of infections according to some conditions. For each employee, they have to record the code, name, age, whether he/she was infected or no and the remaining days of leaves for him/her. You are requested to write the program that maintains the lists of details for the employees as mentioned above using the concept of arrays. The program repeats the display of a menu of services until the user decides to exit. 1. Start by initializing the employee details by reading them from the keyboard. 2. Repeat the display of a menu of 4 services, perform the required task according to the user’s choice and asks the user whether he/she wants to repeat or no. You need to choose one service from each category (‘A’,’B’,’C’,’D’) a. A. Display the total number of employees that were infected b. B.…arrow_forward
- Question > Not complete Marked out of 1.50 Flag question Previous page Write a recursive function named get_palindromes (words) that takes a list of words as a parameter. The function should return a list of all the palindromes in the list. The function returns an empty list if there are no palindromes in the list or if the list is empty. For example, if the list is ["racecar", "hello", "noon", "goodbye"], the function should return ["racecar", "noon"]. A palindrome is a word that is spelled the same forwards and backwards. Note: The get_palindromes() function has to be recursive; you are not allowed to use loops to solve this problem. For example: Test words = ["racecar", "hello", "noon", "goodbye", "test", 'aibohphobia'] ['racecar', 'noon', 'aibohphobia'] print (get_palindromes (words)) print (get_palindromes ([])) print (get_palindromes (['this', 'is', 'test'])) Answer: (penalty regime: 0, 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50 %) Result Precheck Check [] [] Next pagearrow_forwardRemove Char This function will be given a list of strings and a character. You must remove all occurrences of the character from each string in the list. The function should return the list of strings with the character removed. Signature: public static ArrayList<String> removeChar(String pattern, ArrayList<String> list) Example:list: ['adndj', 'adjdlaa', 'aa', 'djoe']pattern: a Output: ['dndj', 'djdl', '', 'djoe']arrow_forwardWrite a function to determine the resultant force vector R of the two forces F₁ and F2 applied to the bracket, where 0₁ and 02. Write R in terms of unit vector along the x and y axis. R must be a vector, for example R = [Rx, Ry]. The coordinate system is shown in the figure below: F₁ y 0₂ 0₁ F2arrow_forward
- In C++ Language Write a function that takes a 1 Demensional array and an integer n and returns the nubmer of times 'n' appears in the array. if 'n' does not appear in the array, return -1.arrow_forwardRandomize_it Write a function in C++ that takes an array as a parameter and then randomize that array, i.e. shuffles the position of the elements in random order. To randomize the array your function should perform random 100 swaps of any two elements in the array. Return the randomized array from the function.vector<int> randomize(vector<int> input){// code here}arrow_forwardQ6: Write a complete program in C++ that declares a one-dimensional array of integers. First, you have to read and print the array elements then you have to find and print the number of positive numbers and the number of negative numbers. (10 Marks)arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education
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