Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Expert Systems Applications 33rd International Conference Dexa 2022 Vienna Austria August 22 24 2022 Proceedings Part 1 Lncs 13426

Authors: Christine Strauss ,Alfredo Cuzzocrea ,Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil

1st Edition

3031124227, 978-3031124228

More Books

Students also viewed these Databases questions