There are 4 fruits apples,oranges,bananas and grapes. Each student can pick up 2 fruits.There are some conditions which have to be used to pick up the fruits . Draw flowchart which can take name of first fruit as input and print name of 2nd fruit that can picked up.

Answer :

Answer:

start→ randomly pick a fruit from the list→ if the first fruit is 'apple', pick 'banana', else if 'orange', pick 'grape', else if 'grape', pick 'banana'→ print second fruit→end.

Explanation:

To pick a second fruit, some conditions have to be met,

  • if you pick an apple, the second fruit should be a banana.
  • if you pick an orange, the second fruit should be a grape.
  • if you pick a grape, the second fruit should be a banana.

MrRoyal

Flowcharts are used as prototypes of an actual program, and they are used to determine the flow of a program.

The conditions of the fruits picked are:

  • The second fruit should be banana if the first is an apple
  • The second fruit should be a grape, if the first is an orange
  • The second fruit should be a banana, if the first is a grape

So, the flow of the flowchart is:

  • Start
  • Input fruit
  • If fruit = "apple", then print "second fruit is banana"
  • If fruit = "orange", then print "second fruit is grape"
  • If fruit = "grape", then print "second fruit is banana"
  • Stop

See attachment for the flowchart

Read more about flowcharts at:

https://brainly.com/question/17373574

${teks-lihat-gambar} MrRoyal

Other Questions