Question
Draw flowchart and write pseudocode for the following problem Create an array of size 50. Store randomly generated number (between 0 and 10) into this
Draw flowchart and write pseudocode for the following problem
Create an array of size 50. Store randomly generated number (between 0 and 10) into this array. Ask users what number they want to search in the array. Make sure user given number is between 0 and 10. Search the user given number in the array: If the program found the number in the array then display all the indexes where the number was found. If the program does not find the number in the array then give an appropriate message e.g. number not found! Write a function to solve this problem.
Note: Add comments and use proper indentation and naming convention
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------example:
Read 5 numbers from users and store these numbers into an array. Then find the largest number by reading the array values. Then display the largest value.
Solution:
Declare integer data[5]
Declare integer index, max
//reading 5 values and storing them in the array For index = 0 to 4
Display Enter a number
Input data[index]
End For
//storing first index value in the max variable
Set max = data[0]
/if max is smaller than the current number, changing the max/
For index = 1 to 4
If max < data[index] then
Set max = data[index]
End if End
For Display max
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started