A B IUDv A v Ap ... Write a Python program in which the user enters either 'A', 'a', 'B', 'b', 'C' or 'c'. If 'A' or 'a' is entered, the program should display the word 'Apple'; if 'B' or 'b' is entered, it displays 'Banana'; and if 'C' or 'c' is entered, it displays 'Coconut'. Use nested if statements for this as depicted in Figure 1 or in slides. The first line should print out a title that says something like "Problem 3: Practice using Nested if statements". If the user enters an invalid input, the program should print 'INVALID INPUT'. Four sample outputs: -----Problem 3: Practice nested if statement------ Enter 'A' for apple, 'B' for banana, and 'C' for coconut: a Apple -----Problem 3: Practice nested if statement------ Enter 'A' for apple, 'B' for banana, and 'C' for coconut: B Banana -----Problem 3: Practice nested if statement------ Enter 'A' for apple, 'B' for banana, and 'C' for coconut: c Coconut -----Problem 3: Practice nested if statement Enter 'A' for apple, 'B' for banana, and 'C' for coconut: D Invalid Input!

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter7: Characters, Strings, And The Stringbuilder
Section: Chapter Questions
Problem 10PE
icon
Related questions
Question
100%
A uncw4-my.sharepoint.com
Hello Python! | Python
Word
Example Problems
lems - Saved
O Search (Option + Q)
Layout
References
Review
View
Help
Grammarly
O Editing v
Body) v 11
U Dv Av Ao
A
B
Av
Write a Python program in which the user enters either 'A', 'a', 'B', 'b', 'C' or 'c'. If 'A' or 'a' is entered,
the program should display the word 'Apple'; if 'B' or 'b' is entered, it displays 'Banana'; and if 'C' or 'c'
is entered, it displays 'Coconut'. Use nested if statements for this as depicted in Figure 1 or in slides.
The first line should print out a title that says something like "Problem 3: Practice using Nested if
statements". If the user enters an invalid input, the program should print 'INVALID INPUT'.
Four sample outputs:
-----Problem 3: Practice nested if statement------
Enter 'A' for apple, 'B' for banana, and 'C' for coconut: a
Apple
-----Problem 3: Practice nested if statement------
Enter 'A' for apple, 'B' for banana, and 'C' for coconut: B
Banana
-----Problem 3: Practice nested if statement------
Enter 'A' for apple, 'B' for banana, and 'C' for coconut: c
Coconut
-----Problem 3: Practice nested if statement------
Enter 'A' for apple, 'B' for banana, and 'C' for coconut: D
Invalid Input!
glish (US.)
Text Predictions: On
MacBook Air
80
888
DII
DD
F2
F3
F4
F5
F6
F9
F7
F8
F10
23
2$
&
3
4.
7
8
< CO
Transcribed Image Text:A uncw4-my.sharepoint.com Hello Python! | Python Word Example Problems lems - Saved O Search (Option + Q) Layout References Review View Help Grammarly O Editing v Body) v 11 U Dv Av Ao A B Av Write a Python program in which the user enters either 'A', 'a', 'B', 'b', 'C' or 'c'. If 'A' or 'a' is entered, the program should display the word 'Apple'; if 'B' or 'b' is entered, it displays 'Banana'; and if 'C' or 'c' is entered, it displays 'Coconut'. Use nested if statements for this as depicted in Figure 1 or in slides. The first line should print out a title that says something like "Problem 3: Practice using Nested if statements". If the user enters an invalid input, the program should print 'INVALID INPUT'. Four sample outputs: -----Problem 3: Practice nested if statement------ Enter 'A' for apple, 'B' for banana, and 'C' for coconut: a Apple -----Problem 3: Practice nested if statement------ Enter 'A' for apple, 'B' for banana, and 'C' for coconut: B Banana -----Problem 3: Practice nested if statement------ Enter 'A' for apple, 'B' for banana, and 'C' for coconut: c Coconut -----Problem 3: Practice nested if statement------ Enter 'A' for apple, 'B' for banana, and 'C' for coconut: D Invalid Input! glish (US.) Text Predictions: On MacBook Air 80 888 DII DD F2 F3 F4 F5 F6 F9 F7 F8 F10 23 2$ & 3 4. 7 8 < CO
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Constants and Variables
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
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT