Question: 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

 

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!