Issue: Boudreaux needs help paying his bills each month. He would like you to cr
ID: 3621414 • Letter: I
Question
Issue:
Boudreaux needs help paying his bills each month. He would like you to create a
program that asks him the date for which bills are due. Then it asks how many bills
Boudreaux has due that day. From there he would like to enter the bill amount for each of those bills. After he finishes giving the bill amounts he would like an itemized receipt so he can print it for his records. Boudreaux is trying to be good with his money.
Specifications:
Create a file named ArrayBillPayer.java. This program should ask for a bill due date
using either a message box or scanner. After asking for the date the program will then
ask for how many bills are due that day. The user should be told they have a maximum of 10 bills they can enter for one day. Pass this information into a method which will ask the user for each bill’s name. Store each bill name in one array then ask for each bill amount. Store the bill amount in an another array. After the last bill is entered, call a method to display an itemized list of the bills paid for that day. This list should include the due date, all the bill amounts and then a total (use a method to compute the total) for the day. The user should then be prompted to enter another date or exit.
Program Help:
• Make sure to include comments above each method with Author, date and
description. (There should be a minimum of four methods aside from main)
• Make sure the user entered a valid quantity of bills. There should be more then 0
and no more than 10 bills entered. If they enter in an invalid number, tell them
and then return to the quantity of bills prompt.
• Assume the user will enter a proper bill amount. They won’t try to use characters
or something like 11.567.
• The exit strategy I used was to have the user type ‘E’ or ‘e’ to exit. You can use
any exit strategy you like just make sure they can exit before typing in another
date.
BONUS: (+10 points)
Verify that the name of the bill the user entered was not already entered. If it was already
entered, ask them to input a different bill name.
Explanation / Answer
Dear, Here is the code public class ArrayBillPayer { /** * This program asks a date to pay bills, * the name and amount of the bills and print them */ public static void main(String[] args) { // declair varibles and array's double[] moneyList = new double[10]; String[] BillList = new String[10]; String date=""; int maxinumNumberOfBills = 0; Scanner input = new Scanner(System.in); // Ask user for date System.out.print("Enter a due date or e to Exit:"); date = input.next(); // Activate the exit key while (date.charAt(0)!='E'&&date.charAt(0) !='e'); //loop for Maxinum Number and check for maxinum number while (maxinumNumberOfBills10){ System.out.println("Enter the number of bills you want to pay"); maxinumNumberOfBills=input.nextInt(); System.out.println("error: enter a number between 1 and 10"); if((maxinumNumberOfBills10)) System.out.println("Enter how many bill you want to pay"); maxinumNumberOfBills = input.nextInt(); //call method billName(moneyList,BillList,maxinumNumberOfBills); billamount(moneyList,maxinumNumberOfBills,BillList); int counter = 0; printRoster(moneyList, BillList, date, counter); double output = 0; Total( output); } } // bill Name method public static void billName(double[] moneyList,String[] BillList , int maxinumNumberOfBills){ // decailer varible int billcounter = 1; Scanner input = new Scanner(System.in); // ask the bill name System.out.println("Enter the bill name"); for (int counter=0;counterRelated Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.