1. Ask the user to input the number of fruits he/she would like to catch. 2. Ask the user to choose a fruit to catch by pressing A for apple, O for orange 3. Display all the fruits that the basket has. 4. Ask the user to enter E to start eating a fruit. 5. Display the fruits remaining each time E is entered and 'No more fruits" whe

Programming with Microsoft Visual Basic 2017
8th Edition
ISBN:9781337102124
Author:Diane Zak
Publisher:Diane Zak
Chapter5: The Repetition Structure
Section: Chapter Questions
Problem 1MQ6: Write an Add method that adds the contents of the decPrice variable to the lstPrices control.
icon
Related questions
Question

C# program

Stack (Note: Enable the Interactive option in the online IDE to allow user input)
1. Ask the user to input the number of fruits he/she would like to catch.
2 Ask the user to choose a fruit to catch by pressing A for apple, O for orange, M for mango, or G for guava.
3. Display all the fruits that the basket has.
4. Ask the user to enter E to start eating a fruit.
5. Display the fruits remaining each time E is entered and "No more fruits" when the stack is empty.
Transcribed Image Text:Stack (Note: Enable the Interactive option in the online IDE to allow user input) 1. Ask the user to input the number of fruits he/she would like to catch. 2 Ask the user to choose a fruit to catch by pressing A for apple, O for orange, M for mango, or G for guava. 3. Display all the fruits that the basket has. 4. Ask the user to enter E to start eating a fruit. 5. Display the fruits remaining each time E is entered and "No more fruits" when the stack is empty.
Catch and eat any of these fruits : ('apple', 'orange', 'man
go', 'guava')
How many of these fruits would you like to catch? 5
Choose a fruit to catch. Press A, 0, M or G.
Fruit 1 of 5 : o
Fruit 2 of 5: m
Fruit 3 of 5: g
Fruit 4 of 5: g
Fruit 5 of 5 : a
Your basket now has [I'orange', . 'mango', , 'guava', . 'gua
va', , 'apple', 1]
Press E to eat a fruit:
e
Press E to eat a fruit:
Fruit(s) in the basket : [['orange', . 'mango', 'guava',
'guava', 11
e
Press E to eat a fruit:
Fruit(s) in the basket : [['orange', , 'mango', 'guava', 1
e
Press E to eat a fruit:
Fruit(s) in the basket : [['orange', . 'mango'. 1]
e
Press E to eat a fruit:
Fruit(s) in the basket : [['orange', 11
e
Press E to eat a fruit:
Fruit(s) in the basket : [[]
No more fruits
Transcribed Image Text:Catch and eat any of these fruits : ('apple', 'orange', 'man go', 'guava') How many of these fruits would you like to catch? 5 Choose a fruit to catch. Press A, 0, M or G. Fruit 1 of 5 : o Fruit 2 of 5: m Fruit 3 of 5: g Fruit 4 of 5: g Fruit 5 of 5 : a Your basket now has [I'orange', . 'mango', , 'guava', . 'gua va', , 'apple', 1] Press E to eat a fruit: e Press E to eat a fruit: Fruit(s) in the basket : [['orange', . 'mango', 'guava', 'guava', 11 e Press E to eat a fruit: Fruit(s) in the basket : [['orange', , 'mango', 'guava', 1 e Press E to eat a fruit: Fruit(s) in the basket : [['orange', . 'mango'. 1] e Press E to eat a fruit: Fruit(s) in the basket : [['orange', 11 e Press E to eat a fruit: Fruit(s) in the basket : [[] No more fruits
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Mathematical functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning