Question: IN C++ QUESTION ONE (1) A program has been developed to define the largest number from a set of 10 numbers. The function larger is

IN C++

QUESTION ONE (1)

A program has been developed to define the largest number from a set of 10 numbers. The function larger is used to determine the largest number. The program will read the first number of the dataset has been assigned by the user. It will assume that the first number entered is the largest number and will store it in a variable called max. The program then will read the second number and store it in num. The system will compare max and num and store the larger number into max. Now max contains the larger of the first two numbers. The program will read the third number, compare it with max and store the larger number into max. At this point, max contains the largest of the first three numbers. The program then will read the next number, compare it with max, and store the larger into max. The program will repeat this process for each remaining number in the dataset. Eventually, max will contain the largest number in the data set.

Input data is:

15 20 7 8 28 21 43 12 35 3

The following questions based on the scenario above:

  1. Identify the best method to be used. (2 marks)
  2. Define an appropriate assigned data type for function larger (2 marks)
  3. Write declared identifiers to be used with appropriate comment for each (6 marks)
  4. Define the analysis requirements. (5 marks)
  5. Write an algorithm to solve the problem (10 marks)
  6. Write a pseudocode (15 marks
  7. Draw a flowchart to solve the problem (20 marks)
  8. Write a program in C++ to solve the problem above. (30 marks)
  9. Write a sample output based on answer in question 1(h) (6 marks)
  10. Explain any FOUR (4) techniques to verify the program correctness in programming

(4 marks

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!