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

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education