Creates a Raptor program that will find and display the largest of a list of pos
ID: 3707699 • Letter: C
Question
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
ANSWER:
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
IF Count equals 0 Then
Set Largest = Number[Count]
Set Smallest = Number[Count]
End IF
IF Largest < Number[Count] Then
Set Largest = Number[Count]
End IF
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
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.