Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a program to ask the user enter a list and then display this list. The user should specify the length of the list
Write a program to ask the user enter a list and then display this list. The user should specify the length of the list and the data type of the elements of the list. The program should work exactly as in the following examples. The text in bold indicates the user input. Example 1. Enter the length of the list: 4 Choose the type of data (integer (I) string (S) / decimal (D)): I Enter the list element: 10 Enter the list element: 20 Enter the list element: 5 Enter the list element: 10 You have entered an integer list: 10, 20, 5, 10 Example 2. Enter the length of the list: 2 Choose the type of data (integer (I) string (S) decimal (D)): S Enter the list element: hi there Enter the list element: uow You have entered a string list: "hi there", "uow" Example 3. Enter the length of the list: 1 Choose the type of data (integer (I) string (S) decimal (D)): D Enter the list element: 1.7 You have entered a decimal list: 1.7
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started