In this exercise, you modify the highest number program from the chapter. If necessary, create a new
Question:
In this exercise, you modify the highest number program from the chapter. If necessary, create a new project named ModifyThis20 Project and save it in the Cpp8\Chap11 folder. Enter the C++ instructions shown earlier in Figure 11-27 into a new source file named ModifyThis20.cpp. Change the filename in the first comment to ModifyThis20.cpp. Modify the program to also display the lowest number in the array. Use a value-returning function named getLowest. Save and then run the program. Test the program appropriately.
Transcribed Image Text:
1 //Highest.cpp - displays the highest number in an array 2 //Created/revised by
1 //Highest.cpp - displays the highest number in an array 2 //Created/revised by on 4 #include 5 using namespace std; 7 //function prototype 8 int getHighest(int numArray[], int numElements); 10 int main() 11 { int numbers [4] = {13, 2, 40, 25}; 12 13 cout <« "The highest number in the array is <« getHighest(numbers, 4) << "." « endl; return 0; 14 15 16 17 } //end of main function 18 19 //***** function definitions***** 20 int getHighest(int numArray[], int numElements) 21 { 22 //assign first element's value to the high variable int high = numArray[0]; 24 //begin search with second element for (int sub = 1; sub < numElements; sub += 1) if (numArray[sub] > high) high = numArray[sub]; //end if 25 26 27 28 29 //end for return high; 32 } //end of getHighest function 30 31 A Highest Number The highest number in the array is 40. Press any key to continue Figure 11-27 Highest number program Z22N~2 222 33
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 58% (12 reviews)
ModifyThis20cpp displays the highest and lowest numbers in an array Createdrevised by on include usi...View the full answer
Answered By
Amos Kiprotich
I am a wild researcher and I guarantee you a well written paper that is plagiarism free. I am a good time manager and hence you are assured that your paper will always be delivered a head of time. My services are cheap and the prices include a series of revisions, free referencing and formatting.
4.90+
15+ Reviews
21+ Question Solved
Related Book For
Question Posted:
Students also viewed these Computer science questions
-
In this exercise, you will modify the currency converter program from the chapter. If necessary, create a new project named ModifyThis19 Project and save it in the Cpp8\Chap11 folder. Enter the C++...
-
In this exercise, you will modify the program from Computer Exercise 12. If necessary, create a new project named ModifyThis14 Project, and save it in the Cpp8\Chap09 folder. Enter (or copy) the...
-
In this exercise, you modify one of the ZIP code programs from the chapter. If necessary, create a new project named ModifyThis19 Project and save it in the Cpp8\Chap13 folder. Enter the C++...
-
A closed tank contains oil with a specific gravity 0.85. If the gauge pressure at a point 10 feet below the oil surface is 23. 7 psi (lb/in.2), determine the absolute pressure and gauge pressure (in...
-
Population b. How many immigrants do you think would arrive (or depart) in 10 years? Will the population grow? Suppose immigration and emigration change the sizes of four populations with the...
-
The following hypotheses have been proposed to explain the reminiscence bump: (a) self-image, (b) cognitive, and (c) cultural life script. lo1
-
In 2009, the most named man was Barack Obama at 30%. Use a technology tool to find a 95% confidence interval for the population proportion that would have chosen Barack Obama.
-
Using the following information for Gold Star National Bank, calculate that banks ratios of Tier 1 capital-to-risk-weighted assets and total-capital-to-risk-weighted assets. Does the bank have...
-
On October 5. Larkspur Company buys merchandise on account from Flounder Company. The selling price of the goods is $4,510, and the cost to Flounder Company is $2,910. On October 8, Larkspur returns...
-
South African Imports Company has assembled the (a) balance sheet and (b) income statement and change in retained earnings for 20X1 shown in Exhibit 16-23. On December 30, 20X1, South African Imports...
-
If necessary, create a new project named TryThis18 Project and save it in the Cpp8\Chap11 folder. Enter the C++ instructions shown earlier in Figure 11-23 into a source file named TryThis18.cpp....
-
The statement sales[1][3] += 10; will replace the number _____________________. a. 900 with 910 b. 500 with 510 c. 700 with 710 d. 800 with 810
-
Write the first five terms of each sequence. 4 an = n +- n
-
What are the key differences between OLTP (Online Transaction Processing) and OLAP (Online Analytical Processing) databases, and how do they cater to distinct business requirements ?
-
__________ refers to speaking up with good intentions about work-related issues, rather than remaining silent. Multiple Choice Neutralizing Micromanagement Filtering Voice Collaborating
-
Consider Michael Porter's Five Forces Model and use the enclosed form to evaluate the OCSIP industry in Jamaica.
-
Petesy Corporation is preparing its Master Budget for 2019. Budget information is as follows: Sales Production Cost Operating Expenses 2019 1 st Quarter P280,000 P192,000 P64,000 2 nd Quarter 320,000...
-
Design a DFA to recognize any valid fractional numbers of the form . where is at most 3 digits and is any number of digits. However, fractional part can never have more digits than the wholepart. If...
-
McQueen Motor Company manufactures automobiles. During September 2022, the company purchased 5,000 head lamps at a cost of $15 per lamp. Fifty of these lamps were used to replace the head lamps in...
-
Phosgene, COCl2, is a toxic gas used in the manufacture of urethane plastics. The gas dissociates at high temperature. At 400oC, the equilibrium constant Kc is 8.05 104. Find the percentage of...
-
In this exercise, you modify one of the Seminars applications from Chapter 4s Apply lesson. Open the Seminars Solution.sln file contained in the Seminars Solution-CheckBox folder. Create an...
-
In this exercise, you modify one of the Seminars applications from Chapter 4s Apply lesson. Open the Seminars Solution.sln file contained in the Seminars Solution-RadioButton folder. Create an...
-
The Donut Shoppe sells four varieties of doughnuts: Glazed ($1.05), Sugar ($1.05), Chocolate ($1.25), and Filled ($1.50). It also sells regular coffee ($1.50) and cappuccino ($2.75). The store...
-
Problem Set Time Value of Money 1. In 10 years, what is the value of $100 invested today at an interest rate of 8% per year, compounded annually? 2. In 10 years, what is the value of $100 invested...
-
The Blending Department of Luongo Company has the following cost and production data for the month of April. Costs: Work in process, April 1 Direct materials: 100% complete $120,000 Conversion costs:...
-
Q3 plz answer correctly and check work Builtrite's upper management has been comparing their books to industry standards and came up with the following question: Why is our operating profit margin...
Study smarter with the SolutionInn App