Mylab Programming With Pearson Etext -- Access Card -- For Starting Out With C++: Early Objects
10th Edition
ISBN: 9780135237946
Author: Tony Gaddis, Judy Walters, Godfrey Muganda
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Expert Solution & Answer
Chapter 9, Problem 1RQE
Program Description Answer
The “linear” search
Expert Solution & Answer
Explanation of Solution
Linear search:
- Linear search or sequential search is the process of searching the particular element in the array one by one until the searching element is found.
- Here, it uses the loop iteration to start from the beginning of the array to the last element until it finds out the searching element.
- This searching process is continued till the last element until the searching element is found from the array.
- If the searching element is not present in the array, then the search process returns the message according to unsuccessful search.
Want to see more full solutions like this?
Subscribe now to access step-by-step solutions to millions of textbook problems written by subject matter experts!
Students have asked these similar questions
C language please
find median value must be done by using looping through the array while comparing switching adjacent entries
Create a script that will generate a n x4 matrix and perform required works , n is the number of customer at a table. the first column item1 represent the $ amount spent on appetizer and salad the second column(item2) is the $ amount spent on entree. the 3rd column ( item 3 ) is the $amount spent on dessert and the 4th column ( item 4) is the $amount spent on booze and soda
example show below( picture)
7. find the average(mean ) and median on row sum- so we can tell the customer wheter they could like to divide the total by number of people at the table or each customer would like to pay individually bae on how much they spent ( display )
8. when you compute median , have row sums display in ascending order
9.lastly . have message [ spend more on booze than appetizer and saold!! I guess you are drinking too much !!] dispaly if the customer group is more on…
C language please
find median value must be done by using looping through the array while comparing switching adjacent entries
Create a script that will generate a n x4 matrix and perform required works , n is the number of customer at a table. the first column item1 represent the $ amount spent on appetizer and salad the second column(item2) is the $ amount spent on entree. the 3rd column ( item 3 ) is the $amount spent on dessert and the 4th column ( item 4) is the $amount spent on booze and soda
example show below( picture)
1)take down itemized $ amount each customer ownes.
2. display the matrix
3. compute how much individual customer ownes
4. compute how much money all customer at the table spent on each item - column sum display
5. compute how much the whoel group owes to the restaurant. the total bill - total sum of all elements disaplay
C language please
find median value must be done by using looping through the array while comparing switching adjacent entries
Create a script that will generate a n x4 matrix and perform required works , n is the number of customer at a table. the first column item1 represent the $ amount spent on appetizer and salad the second column(item2) is the $ amount spent on entree. the 3rd column ( item 3 ) is the $amount spent on dessert and the 4th column ( item 4) is the $amount spent on booze and soda
example show below( picture)
1)take down itemized $ amount each customer ownes.
2. display the matrix
3. compute how much individual customer ownes
4. compute how much money all customer at the table spent on each item - column sum display
5. compute how much the whoel group owes to the restaurant. the total bill - total sum of all elements disaplay
6. compute how much the suggest tips is (20% if the total bill is less than or equal to $200. 15% if total is more than $200. Display
7. find…
Chapter 9 Solutions
Mylab Programming With Pearson Etext -- Access Card -- For Starting Out With C++: Early Objects
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
Similar questions
- Multi Dimensional Activity Client Requirement: The customer wants a program that will ask the user to enter 2 numbers. these numbers will then be stored in the first two columns. the cycle will repeat until the 5 by 2 array will be completed. then the values will be prompted for checking.arrow_forwardLooking for this in Python, please. Shopping list assignment (Parallel Array) Create three global variables with the proper data types: sub_totaltotal_pricesales_tax Sales tax is 9.5% Seven items minimum Create a shopping list (List, Tuple or Dictionary) of your choice (Items in list) Create a price list (Price for each item in shopping list) Create and print your parallel array (match each item to its price) Print the list with its index numbers Select one or more items from the shopping list using the index number Print your selected items with price Print sub total (base price of item(s) before tax) Print sales tax amount (before adding it into total price) Calculate and print total price with tax included. (this is what you would pay walking out the door) Round to two decimal pointsarrow_forwardC 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,…arrow_forward
- using html and javascript. Write a function to search an item named searchKey in an array of 20 elements. Assumed the array has all integer value and also the search item is an integer.arrow_forwardPart A – Develop the algorithms The challenge in the project is developing algorithms that accomplishes basic operations over an array of integer numbers. The three operations are: Find the minimum (smallest) value that appears in the array Find the maximum (largest) value that appears in the array Determine the number of unique values that appear in the array Develop an algorithm for each of those tasks. The algorithms should work for any size of array. If the array is empty (i.e., doesn't include any elements/values) the algorithm should output a zero. Keep in mind that like any computational problem there are several approaches to achieve a solution. For this programming checkpoint your will need to utilize loops and conditional statements. Write the pseudocode or flowchart for the algorithm and store it in a file (file format can be text, pdf or doc) with the name arrayUtilSteps. Part B - Implement the class The goal for this part is to implement a class with the…arrow_forwardArray. 1. Search the web to discover the ten most common user-selected passwords and store them in an array. Design a program that prompts a user for a password and continue to prompt the user until the user has not chosen one of the common passwords. 2. Design a program that will use a pair of nested loop to read the company's sales amounts. The details are as follows: -KDS Company has 3 departments: 1. Dept X 2. Dept Y 3. Dept Z. Design a program that will read as input each department's sales for each quarter of the year, and display the result for all divisions. Use a two dimensional array that will have 3 rows and 4 columns and show how the data will be organized.arrow_forward
- AHPA #4: The C ATM Machine• Two people, "a" and "b", have checking and savings accounts.• Create a 2x2 array to hold their amounts: a – checking: $500, savings:$1,000; b – checking: $750, savings: $325.• Have the ATM machine ask the user their name.• Ask the user if they want to withdraw from their checking or their savingsaccount.• Use a switch statement to process different types of accounts.• Create software that will provide an ATM user with theproper change for any dollar amount up to $200.• Example: Run the code for $19, $55, and $200. Is the amount > $100, then provide a $100 bill & subtract $100• Is the amount >= $100, then provide a $100 bill & subtract $100• Is the amount > $20, then provide a $20 bill & subtract $20 [repeat 4times]• Is the amount > $10, then provide a $10 bill and subtract $10• Is the amount > $5, then provide a $5 bill and subtract $5• Provide the remaining amount in single $1 bills so the output should be like shown in…arrow_forwardq1 $a=array(1=>"Mohammed",40=>"Salam"); is an example of Indexed array Associative array Array index Array function ------------------------------------------- q2 In php the keyword to be used before function name is FunctionStaticSTATICfunction ------------------------------------------- q3 function coutElements(){$a=30;echo $a;} This is an example for: call by value call by reference both none of the above -------------------------------------------------- q4 To access a variable value declared outside a function we use? global local print none of the above -------------------------------- q5 The tag "tr" is : table row table table color table headerarrow_forwardUse the following array for questions 16 – 18. Dim intTemperatures() As Integer = {100,86,77,74,77,90,99,99,32,101,56,67,77} Write the code that will find the coldest temperature in the list. (OPTIONAL) Create an array that will store the frequency of each temperature. Populate the array with the correct data. Sort the array in ascending order.arrow_forward
- The following algorithm depicts a ____ search.// Prompt for customer number, search array for matchesDeclare Numeric searchValueDeclare Numeric index = 0Display "Enter the customer number you're looking for: "Input searchValueFor index = 0 to SIZE - 1 If custNumber[index] == searchValue Then Display "Match found at subscript: " + index End IfEnd Forarrow_forwardSpecial8 primes are two prime numbers whose difference is 8. Write a MATLAB script that finds and displays all the Special8 primes between 1 and 500. The numbers should be displayed in a two-column matrix M, where each row displays one pair. Export m inot an excel file and inot a sheet.arrow_forwardQuestion 5 Using the concept of parallel arrays, create an application that stores information for 5 people. The application will ask the user for the following data for each person: • First Name • Last Name • Age • Date of Birth • Email Address The application will then output the data to the user Full explain this question and text typing work only thanksarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Programming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageSystems ArchitectureComputer ScienceISBN:9781305080195Author:Stephen D. BurdPublisher:Cengage Learning
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Systems Architecture
Computer Science
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Cengage Learning