Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

USE RAPTOR TO SOLVE IT Creates a Raptor program that will find and display the l

ID: 3708299 • Letter: U

Question


USE RAPTOR TO SOLVE IT

Creates a Raptor program that will find and display the largest of a list of positive numbers entered by the user. Stops input when the user enters a sentinel value. validate user input. Declares and uses valid variables with the appropriate data types. Evaluate the input, processes the data and determines the appropriate solution. Create formulas that can produce correct results. show mastery of algorithm design. incorporate logical conditions that covers all boundaries specified by the problem. uses defensive programming techniques. shows strong evidence of applying program development strategies as discussed in the reading.

USE RAPTOR TO SOLVE IT

Explanation / Answer

Algorithm : To find the Largest number , Intialize max 0; and compare it to the array elements store the highest number in the max variable......To find the Smallest number , Intialize min 0; and compare it to the array elements store the lowest number in the min variable......

////////////////////////////////////////Raptor Program/////////////////////////////////////////


Declare Number[100] As Integer
Declare X, Largest, Smallest, Count As Integer
Set Count = 0

Write "Enter a number:"
Input X

While Number != 0
Set Number[Count] = X

// Take the first value of array as smallest and largest initially
IF Count equals 0 Then
Set Largest = Number[Count]
Set Smallest = Number[Count]
End IF

// Find the largest value in the array
IF Largest < Number[Count] Then
Set Largest = Number[Count]
End IF

// Find the smallest value in the array
IF Smallest > Number[Count] Then
Set Smallest = Number[Count]
End IF

Set Count = Count + 1
Write "Enter a number:"
Input X
End While

For (K = Count - 1; K >= 0; K++)
Write Number[K]
End For