Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction to Java Programming, Comprehensive Version

Authors: Y. Daniel Liang

10th Edition

133761312, 978-0133761313

More Books

Students also viewed these Programming questions

Question

Job type Retail sales, managerial, human resources, etc.

Answered: 1 week ago

Question

=+b. Calculate the probability P111.99 # x # 12.012 when n 5 64.

Answered: 1 week ago

Question

=+a. Calculate the probability P111.99 # x # 12.012 when n 5 16.

Answered: 1 week ago