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!
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!
Chapter7: Characters, Strings, And The Stringbuilder
Section: Chapter Questions
Problem 10PE
Related questions
Question
100%
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images
Knowledge Booster
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
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT