Question: Create the following Java command line Data Structures application Lab6.java on Linux or IntelliJ. Use the following types of loops - for, or for each,

Create the following Java command line Data Structures application Lab6.java on Linux or IntelliJ. Use the following types of loops - for, or for each, while, do while

Declare an enumeration named cars and add five different types.

Print each car out using iteration (loop)

Declare a BitSet named flags, and five bits, set each bit using a for the statement.

Print each flag value out using iteration (loop)

Declare a vector named collection and add three different types: integers, double, float

Print each collection value out using iteration (loop)

Declare a stack named processes, push and pop five values on the stack

Print each process value out using iteration (loop)

Declare a map named products, put five values in the map

Print each product value out using iteration (loop)

Declare a hashtable named customers, put five values in the hashtable

Print each customer value out using iteration (loop)

Enumeration Of Cars. Acura Audi Buick BMW Chevy Dodge Ford Bitset of Flags Inital pattern in bits1: 10, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30 Initial pattern in bits2: 11, 2, 3, 4, 6, 7, 8, 9, 11, 12, 13, 14, 16, 17, 18, 19, 21, 22, 23, 24, 26, 27, 28, 29, 31 Initial pattern in bits3: 10, 4, 8, 12, 16, 20, 24, 28 Initial pattern in bits4: 11, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 15, 16, 17, 18, 19, 20, 22, 23, 24, 25, 26, 27, 29, 30, 31) Initial pattern in bits5: Vector collection. Initial size:8 Capacity after addition of integer:8 Current capacity after addition of double:8 Current capacity after addition of float:8 First element: 10 Last element: 100 10 22.55 46.79 100 Stack: [ Stack: [75, 100, 125, 150, 175] pop -> Stack: [75, 100, 125, 150] pop -> Stack: [75, 100, 125] pop -> Stack: [75, 100] pop -> Stack: [75] pop -> Stack: [] pop -> Empty Stack Number of Products Map products: fYork-5, Twix-7, Hershey' s-13, Reese's-9, M&M' s-16 Number Of Hershey's: 13 Number Of M&M's: 16 Number Of Reese's: 9 Number Of York: 5 Number Of Twix: 7 Customers purchases Mike: 888.88 Larry: 1133.53 Jason: 500.0 Kirk: 4499.55 Paul: 79.95 Jason has a $50 coupon for a purchase made over $400 Jason 's new total 450.0

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 Databases Questions!