Write the pseudocode for an application that will prompt a user for a numeric value and then search for the value provided in the mark array
Pseudocode
Start
Declare array numbers
For i=0 to 3 step 1
Prompt a user for a number
Get a number from a keyboard
Add a number to the array numbers
end
Display message: "Would like to search for a value?y/n"
Get the answer from a keyboard
if answer = y then
Display a message: "Enter a value to search for"
Get a value from a keyboard
isFound=false
For i=0 to 3 step 1
if value=numbers(i) then
Display a message:"The number is found"
isFound=true
Exit loop
end if
end
if isFound =false then
Display a message: "The number is not found."
end if
end
Declare variable totalValues=0
For i=0 to 3 step 1
totalValues=totalValues+numbers(i)
end
Display a message: "The total of the values stored in the array is: "+totalValues
Stop
Comments
Leave a comment