Problem 1: [7 points]
Write an algorithm (in the form of a flowchart) to perform the following task:
Find the maximum integer in a given sequence of 100 integers.
Problem 2: [13 points]
Given below is a C++ program that performs the task mentioned in Problem 1.
#include <iostream.h>
// This program reads a sequence of 100 integers and produces as output
// the value of the largest.
int main()
{
int number, maximum, counter;
// Prompt the user
cout << "Please type 100 integers" << endl;
// Read the first integer
cin >> maximum;
// Read and process the rest of the integers
counter = 1;
while (counter < 100)
{
cin >> number;
if (number > maximum)
maximum = number;
counter = counter + 1;
}
cout << "The largest number is " << maximum << endl;
return 0;
}