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

24.99 $

Programming resource
Digital learning resource
Category:
Practical programming resource
Suitable for guided study and reference
Tutor guidance available when needed

Description

5/5 - (6 votes)

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.

Resource details

Understand the Task Before You Use the Resource

Review the requirements, identify the programming concepts involved, study the implementation and test your understanding with your own examples and modifications.