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: 63% (11 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...
-
(a) Calculate the speed of a proton that is accelerated from rest through a potential difference of 120 V. (b) Calculate the speed of an electron that is accelerated through the same potential...
-
Question: Megan is a freshman at her local public high school; her older sister Jenna attends a nearby private high school. Both girls are angry because their schools prohibit them from joining their...
-
Powells Book Warehouse distributes hardcover books to retail stores and extends credit terms of 2/10, n/30 to all of its customers. At the end of May, Powells inventory consisted of books purchased...
-
Suppose that stock in Ski Gear Corp. has a beta of .90. The market risk premium is 7 percent, and the risk-free rate is 8 percent. Ski Gear's last dividend was $1.80 per share, and the dividend is...
-
An orchard has a acre of specialty fruit trees and is preparing for summer harvest. Historically, this acre has yielded and average of 1,800 lbs of fruit with a standard deviation of 800 lbs. A...
-
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
-
A sample of season performance measures for 29 NBA teams was collected for a season. A regression analysis was performed on two of the variables with Y = total number of free throws made and X =...
-
What is Taylorism? In what ways could Taylorism be implemented in ethical or unethical ways? What are some examples of emotional labor and how does the concept differ from simply experiencing...
-
Explain the following change management models/theories, how are they similar and different and provide references. 1. Lewin's Change Management Model 2. Kotter's Eight-Step Change Model 3. The Jeff...
-
Social Issue Analysis and Response Final Draft Start Date Due Date Points Apr 17, 2023, 12:00 AM Apr 30, 2023, 11:59 PM 210 Assessment Traits Requires Lopeswrite Assessment Description Honors...
-
How does the data model determine which table is the date table?
-
Distinguish the primary functions of human resource management within the long term care industry. Evaluate the applicable federal and state laws, rules, regulations, and requirements in terms of...
-
In Exercises 1-4, use the results of following Exercises to find the exact value of the expression. 1. arcsec 2 2. arcsec 1 3. arccot (-1) 4. arccot (- 3)
-
Compile data on consumption and expenditures for the following categories in 30 different countries: (1) food and beverages, (2) clothing and footwear, (3) housing and home operations, (4) household...
-
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...
-
28. Under the perpetual inventory system, a cash discount received will be recorded as A. Credit Purchase Discount B. Credit Merchandise Inventory C. Debit Accounts Payable D. Credit Accounts...
-
On a variable costing income statement, costs are split between Group of answer choices high and low direct and indirect product and period variable and fixed
-
Collections on accounts receivable ______ operating cash flows while payments on accounts payable decrease _______ cash flows. Multiple choice question. increase, investing increase, operating...
Study smarter with the SolutionInn App