Computers and Technology

Find max Traversing a vector to find the max (or min) is common. Given a vector of integers, output the maximum integer found in the vector. If the input is 43 8 26, the output is 8. Hints: • Declare a variable named maxitem to hold the max value seen so far. Update that value if you ever see a larger value. • Initialize that variable to any element's value, NOT to 0. 262108.1539616 LAB ACTIVITY 11.11.1: LAB Vectors: Find max 0/10 main. cpp Load default template... 2 #include 3 using namespace std; 4 5 int main() { 6 int numitems; 7 vector int> listItems; int curritem; 9 int i; 10 11 // Get items 12 cin >> numitems; 13 for (i = 0; i < numItems; ++i) { 14 cin >> currItem; 15 listItems. push_back(curritem); 16 } 17 18 /* Type your code here */ 19 20 return; 21 ) Develop mode Submit mode Run your program as often as you'd like, before submitting for grading. Below, type any needed input values in the first box, then click Run program and observe the program's output in the second box.

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 12:30, gerardoblk5931
An atom's diameter is about 0.1 nanometer (1×10-9m), and a human hair is about 1×10-3m. how many times greater is a human hair than an atom's diameter? sorry pushed wronf button but this is math
Answers: 3
image
Computers and Technology, 23.06.2019 04:20, RandomLollipop
Which network media uses different regions of the electromagnetic spectrum to transmit signals through air? uses different regions of the electromagnetic spectrum to transmit signals through air.
Answers: 2
image
Computers and Technology, 23.06.2019 15:00, billlyyyyyyyyyy
Visually impaired individuals generally rely on the for navigation. thus, designers need to ensure that mouse-specific inputs, such as pointing, clicking, and hovering, can be done without a mouse.
Answers: 1
image
Computers and Technology, 23.06.2019 19:00, nayo2006
Acompany is hiring professionals for web designing. the firm is small with few resources. they want employees who possess problem-solving skills and can independently carry out responsibilities. which kind of employee should they select?
Answers: 2
Do you know the correct answer?
Find max Traversing a vector to find the max (or min) is common. Given a vector of integers, output...

Questions in other subjects: