[SOLVED] SOLVED:Lab-6-Using-Arrays-with-Methods

24.99 $

Category:
Click Category Button to View Your Next Assignment | Homework

You will receive the following solution file(s) instantly after successful payment:

zip file icon Lab-6-Using-Arrays-with-Methods.zip (1.4 KB)
Assignment Instructions Updated Recently? Submit Below and we will provide new Solution!
Submit New Instructions
🔒 Securely Powered by:
Secure Checkout
Rate this product

1) Create a class called CustomerLister with a main method that instantiates an array of String objects called customerName. The array should have room for five String objects. Use an initializer list to put the following names into the array:

Cathy
Ben
Jorge
Wanda
Freddie

Print the array of names using an enhanced for loop.

2) Replace the enhanced for loop in part 1 by a standard for loop to print the customer names.
3) Create a second double array called customerBalance in the main method. Allow room for five customer balances, each stored as a double. Add a loop that prompts the user with each customer name in order to enter a balance for that customer. Read the keyboard input with a Scanner object. Use the following balances for the input:

100.00
234.56
2.49
32.32
400.00

After all the balances have been entered, print out each customer and his/her balance.

  • Lab-6-Using-Arrays-with-Methods.zip