Starting Out with C++: Early Objects Plus MyLab Programming with Pearson eText -- Access Card Package (9th Edition)
9th Edition
ISBN: 9780134520520
Author: Tony Gaddis, Judy Walters, Godfrey Muganda
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Chapter 9, Problem 21RQE
Program Plan Intro
A)
Given:
The array of structures is in order by the customer ID, where customer ID ranges from 101 to 500.
Program Plan Intro
B)
Given:
The array of structures is in order by the customer ID, where customer ID ranges from 101 to 500.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Assume an array of structures is in order by the customerlD field of the record,where customer IDs go from 101 to 500.A) Write the most efficient pseudocode algorithm you can to find the record witha specific customerlD if every single customer ID from 101 to 500 is used andthe array has 400 elements.B) Write the most efficient pseudocode algorithm you can to find a record with acustomer ID near the end of the IDs, say 494, if not every single customer IDin the range of 101 to 500 is used and the array size is only 300
Array TypesObjective: Based on the given values and initializations, give what is being required of each statement.1. Given A[10], α=2000, esize=4 bytes:a) Find the number of elements.b) Find the address of the 6th element.c) Find the index no. of the 8th element.2. Given E[3][4], α=2020, esize=4 bytes:a) Find the total no. of elements.b) Find the address of the last element.c) Find the address of the 10th element.
Please Help me with This Problem
Language = C++
Write a Menu Driven C++ program that creates a two-dimensional array/Matrix of size n X m where nrepresent the students and m represent the subjects and initialize it with user. The program should dofollowing Tasks using Menu, the menu operations are implemented using functions:a) Total_Marks: Calculates total/sum of the values in the specified row (student).b) Avg_Subject: Calculates Average of the values in the specified column (subject).c) Stud_Highest: Finds highest value in the specified row of the array and return that subjectname.d) Stud_Lowest: Finds lowest value in the specified row of the array and return that subject name.
Chapter 9 Solutions
Starting Out with C++: Early Objects Plus MyLab Programming with Pearson eText -- Access Card Package (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...
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
- (Data processing) A bank’s customer records are to be stored in a file and read into a set of arrays so that a customer’s record can be accessed randomly by account number. Create the file by entering five customer records, with each record consisting of an integer account number (starting with account number 1000), a first name (maximum of 10 characters), a last name (maximum of 15 characters), and a double-precision number for the account balance. After the file is created, write a C++ program that requests a user-input account number and displays the corresponding name and account balance from the file.arrow_forwardplease answer all questions You need to generate a (5x12) rain matrix (Rain[5][12]) that contains the average rainfall over 12 months for a 5 year period. You program should do the following steps: 1) Create a 5x12 integer rainfall matrix 2) Create a 5 element array of int pointers(int * Rain[5]) and assign each pointer to the address of the first element of each row 3) Populate the elements of the matrix with pseudo-random numbers having a range from 0-100 inches. Use the rand( ) function to generate your temperatures. The output of rand() should be mod with 100 (rand()%100) in order to get reasonable rainfall values. Init the random number generator with long seed = srand(67) This task should be performed by a function, void RainGen(int* Rain[ ], int R, int C), that populates all the matrix entries. 4) After generating all rainfall matrix entries, print the entire matrix using the function, void Print(int* Rain[ ], int R, int C); 5) Calculate the…arrow_forwardAirplane Records Write a program to keep data and perform statistical analysis for a set of 4 passengers. The information of each passenger contains Name, NumberOfFlights, Sex and Boolean Priority Boarding mark. Information for each passenger should be entered from the keyboard and stored in the array of structures. The program will find and print out the Sex of passengers who chose Priority Boarding. Use 2 ways for access to elements of array of structure: using name of array and using pointers c++.arrow_forward
- in C++, pls put comments in the code 1. Create a 10x10 matrix using rand function to fill the said matrix with random numbers 2. Print all the numbers in matrix form 3. Ask the user the following options here are the options A. Sum per row B. Sum per column C. Display all ODD numbers horizontally D. Display all EVEN numbers horizontally E. Display all PRIME numbers horizontally F. Generate new set of random numbers G. Close the program After asking what option to display, Display again the previous numbers entered and the same options.arrow_forwardWrite a program to store the information of any biological entity in a struture array. Data members in the structure should be of int and char dataype. Also include strings in it. Your program should read the data from user and then store it in structure and display in tabular format. ** do not use structure to pointer or structure to function **biological entity means the information of any dna or protein or virus etc refrence picture has been attached Solve the program in carrow_forwardAirplane Records Write a program to keep data and perform statistical analysis for a set of 4 passengers. The information of each passenger contains Name, NumberOfFlights, Sex and Boolean PriorityBoarding mark. Information for each passenger should be entered from the keyboard and stored in the array of structures. The program will find and print out the Sex of passengers who chose PriorityBoarding. Use 2 ways for access to elements of array of structure: using name of array and using pointers c++.arrow_forward
- DESIGN YOUR OWN SETTING Task: Devise your own setting for storing and searching the data in an array of non-negative integers redundantly. You may just describe the setting without having to give an explicit algorithm to explain the process by which data is stored. You should explain how hardware failures can be detected in your method. Once you have described the setting, complete the following: Write a pseudocode function to describe an algorithm where the stored data can be searched for a value key: if the data is found, its location in the original array should be returned; -1 should be returned if the data is not found; -2 should be returned if there is a data storage error Include a short commentary explaining why your pseudocode works Describe the worst-case and best-case inputs to your search algorithm Derive the worst-case and best-case running times for the search algorithm Derive the Theta notation for the worst-case and best-case running times Maximum word count…arrow_forwardC++ need help with part d to g only Assume the Product structure is declared as follows: struct Product { string description; // Product description int partNum; // Part number double cost; // Product cost }; (c) Declare a dynamic array of Products of size 5 and name it ”items”. Then initilize it with user input values. (d) Write a print function (not as a member of the struct) and pass a pointer to the pointer that points to the array (double pointer) and print all the items of the array in that function. (e) Define a max function (not as a member of the struct) that gets an array of items as an input and returns a pointer to the max element of the array. (f) Declare a 3 by 3 two dimensional dynamic array and populate it. (g) Define an output function that takes a stream object and a pointer to a 2D array as arguments and outputs data members of objects in format of 3*3 table into the given stream. Test your function both with an output file…arrow_forwardCode in Perl Create an array which holds a list of Video Games, consisting of title, the year it was released (guess if you don’t know) , platform (NES, XBOX One, etc) and publisher (in that order). Add at least ten albums to the list. Then, use the split function and a for or foreach loop to display the publisher followed by the title and platform for each list element.arrow_forward
- IN MATLAB SOFTWARE answer the task 6 I need the codes to be use Task 5 Create a 1-by-1000 row vector called M containing random integer numbers between 8 and 256. Using logical array indexing, assign all elements with value greater than 200 to a variable called up200. Display the dimension of variable up200. Task 6 Continuing previous task, create another variable called up100 containing all elements in M that are greater than 100 but less than 200. Display the dimension of vector up100. Append variable up200 to variable up100.arrow_forwardC++ programming Assume an integer array of size 12 named arrSales stores the sales of a product for eachmonth. For example, sales for January should be stored in 1st position of the array, andFebruary is stored in 2nd position of the array and so on for the rest of the months.Write a segment of code in C++ that perform the following: 1. Define a string array of size 12 and initialise the values of the array with the values tothe calendar months from “January” to “December”.2.. Prompt user to enter a month in integer (e.g 1 for January). Then, display the salesfigure based on that month. Make sure month is display in letter format by using thearray defined in (i). Sample program runs as below:Enter a month:2The sales for February is RM60003.. Using loop structure, count the number of months where the sales is below RM2000.You should display the result, list the affected months (by using the array defined in(i)) and its actual sales figures respectively. For example if April, September…arrow_forwardFunction Name: odd_even_diagParameters: a 2D list (list of lists)Returns: list of lists Description: Given a 2-dimensional matrix (list of lists) with any size (n*n), modify it according to the following rules: Find the sum of the main diagonal. If the sum is an odd number, change all the values of the given matrix (except the main diagonal) to 0. If the sum is an even number, change all the values of the given matrix (except the main diagonal) to 1. Return the resulting matrix. Example 1:If argument is: [[1, 2], [4, 3]] odd_even_diag should return: [[1, 1], [1, 3]] because the sum 1 + 3 is even. Example 2:If argument is: [[1, 2, 3], [4, 5, 6], [7, 8, 9]] odd_even_diag should return: [[1, 0, 0], [0, 5, 0], [0, 0, 9]] because the sum 1 + 5 + 9 is odd.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 PtrC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning