# 2023 Write a program to compare how long it will take to pay off | Assignment Collections

Computer Science 2023 Java Program

2023 Write a program to compare how long it will take to pay off | Assignment Collections

The class will have the following private properties:  current balance  annual interest rate (percentage – e.g. 12.5%)  percent of current balance to pay each month (e.g. 10%) Within the CreditCardAccount class you will define methods, as follows:  Define a constructor, with parameters that pass in the user entered values for only two of the properties, the initial balance and annual interest rate. o Use the parameters to initialize:  the current balance property to the initial balance parameter value  the annual interest rate property to the annual interest rate parameter value o Initialize the percent to pay off each month to 0.  Define a second constructor, with parameters that pass in the user entered values for all three of the properties, and use them to initialize the property values.  Define a getter for the percent of current balance to pay each month.  Define an instance method to determine and return the minimum required payment for a month: o Define and use three local constants:  A low balance minimum payment (\$50)  A high balance percentage (5%)  A low balance limit (\$1000) o If the current balance is below the low balance limit, then the minimum required payment will be the low balance minimum payment. o Otherwise, the minimum required payment will be the high balance percentage of the current balance. o Return the correct minimum required payment  Define a make payment instance method to record and display a payment for one month (note that there will be no loops in this method). This method will: o Calculate values and display one line of output, containing the data about one month’s payment, as follows:  Display the current (starting) balance.  Use the current balance to calculate the interest to be applied for the month, and add that interest to the current balance.  Display the interest charge and current balance (with interest).  Using the current balance (with interest), calculate the payment for the month, based on the percent of current balance to pay each month data field.  Call the instance method to determine the minimum required payment.  Check to see if the calculated payment is less than the minimum required payment. o If so, set the calculated payment to the minimum required payment.

The calculated payment may be higher than the remaining balance. So check to see if the calculated payment is higher than the remaining balance. o If so, set the calculated payment to the remaining balance.  Display the calculated payment that will be paid for the month.  Subtract the calculated payment from the current balance (with interest).  Display the new current balance (i.e. the ending balance, after the payment has been made).  Define a payoff instance method to calculate and display information each month until the credit card is paid off. This method will: o Display a line describing the percent of current balance that will be paid each month  If the percent is 0, display “minimum payment” instead of a percent. o Display headers for the results (see sample output below). o Use a while loop to update and display information about the credit card account every month, as follows:  Display the month number (starting with month 1, and incrementing by 1 each time the code loops).  Call the above defined make payment method to update and display the data values for the month. o Stop looping when the current balance reaches 0. o Return the number of months needed to pay off the card. NOTE: When one instance method needs to call another instance method, the second instance method should be called using the this reference to reference the current object. 2. Define a second class containing a main method, and additional methods, to compare paying only the minimum required payment each month with paying a larger amount each month. Name the class: PayoffComparison Within the PayoffComparison class:  Define a static method to prompt for, read, and validate an initial credit card balance. The method will: o Define and use a constant to hold the lowest initial balance allowed (\$500). This constant should be used to specify the lowest value allowed in the prompts, and to test for it within conditions. o Prompt for and read the initial balance. o If the user enters an initial balance that is below the lowest initial balance allowed:  Issue an error message, and loop to re-prompt the user and read another value o Loop until a valid value is entered. o Return a valid initial balance.

Sample Description and Input o Display a couple of blank lines after reading all of the user input. o Call the payoff method with the first object, and store the returned number of months. o Call the payoff method with the second object, and store the returned number of months. o Display a statement comparing the number of months required to pay off the credit card with only the minimum monthly payments, vs paying off the credit card with a larger monthly payment (use a getter to get the payoff percentage per month). (The figures in each column should line up with each other on the right – see Sample Output on next page for example) 3. The program must implement both a while and do-while loop somewhere in the code. 4. The program must follow the CS210 Coding Standards from Content section 6.10. Be sure to include the following comments: o Comments at the top of each code file describing what the class does  Include tags with the author’s name (i.e. your full name) and the version of the code (e.g. version 1.0, Java Assn 5) o Comments at the top of each method, describing what the method does  Include tags with names and descriptions of each parameter and return value. WARNING: The objects, classes, and methods must be implemented exactly as specified above. If your program produces correct output, but you did not create and use the object as specified, and implement the required classes and methods, you will lose a significant number of points. Testing  Run, debug, and test your Java program with different inputs, until you are sure that all control structures within your program work correctly.  The sample inputs and output can be used as the initial test to test your program. But be sure you thoroughly test it using other values as well.

Sample Output Results when paying minimum required payment per month —————————————————————- Initial Month’s Balance End Month Balance Interest w/Interest Payment Balance —————————————————————- 1 1111.11 6.48 1117.59 55.88 1061.71 2 1061.71 6.19 1067.91 53.40 1014.51 3 1014.51 5.92 1020.43 51.02 969.41 4 969.41 5.65 975.06 50.00 925.06 5 925.06 5.40 930.46 50.00 880.46 6 880.46 5.14 885.59 50.00 835.59 7 835.59 4.87 840.47 50.00 790.47 8 790.47 4.61 795.08 50.00 745.08 9 745.08 4.35 749.43 50.00 699.43 10 699.43 4.08 703.51 50.00 653.51 11 653.51 3.81 657.32 50.00 607.32 12 607.32 3.54 610.86 50.00 560.86 13 560.86 3.27 564.13 50.00 514.13 14 514.13 3.00 517.13 50.00 467.13 15 467.13 2.72 469.86 50.00 419.86 16 419.86 2.45 422.30 50.00 372.30 17 372.30 2.17 374.48 50.00 324.48 18 324.48 1.89 326.37 50.00 276.37 19 276.37 1.61 277.98 50.00 227.98 20 227.98 1.33 229.31 50.00 179.31 21 179.31 1.05 180.36 50.00 130.36 22 130.36 0.76 131.12 50.00 81.12 23 81.12 0.47 81.59 50.00 31.59 24 31.59 0.18 31.78 31.78 0.00 Results when paying 20% of the balance per month —————————————————————- Initial Month’s Balance End Month Balance Interest w/Interest Payment Balance —————————————————————- 1 1111.11 6.48 1117.59 223.52 894.07 2 894.07 5.22 899.29 179.86 719.43 3 719.43 4.20 723.63 144.73 578.90 4 578.90 3.38 582.28 116.46 465.82 5 465.82 2.72 468.54 93.71 374.83 6 374.83 2.19 377.02 75.40 301.62 7 301.62 1.76 303.37 60.67 242.70 8 242.70 1.42 244.12 50.00 194.12 9 194.12 1.13 195.25 50.00 145.25 10 145.25 0.85 146.10 50.00 96.10 11 96.10 0.56 96.66 50.00 46.66 12 46.66 0.27 46.93 46.93 0.00 Paying minimum required payment per month, it will take 24 months to pay off the credit card. Paying 20% of the balance per month, it will take 12 months to pay off the credit card.

We give our students 100% satisfaction with their assignments, which is one of the most important reasons students prefer us to other helpers. Our professional group and planners have more than ten years of rich experience. The only reason is that we have successfully helped more than 100000 students with their assignments on our inception days. Our expert group has more than 2200 professionals in different topics, and that is not all; we get more than 300 jobs every day more than 90% of the assignment get the conversion for payment.

## Place Order Now

#write essay #research paper #blog writing #article writing #academic writer #reflective paper #essay pro #types of essays #write my essay #reflective essay #paper writer #essay writing service #essay writer free #essay helper #write my paper #assignment writer #write my essay for me #write an essay for me #uk essay #thesis writer #dissertation writing services #writing a research paper #academic essay #dissertation help #easy essay #do my essay #paper writing service #buy essay #essay writing help #essay service #dissertation writing #online essay writer #write my paper for me #types of essay writing #essay writing website #write my essay for free #reflective report #type my essay #thesis writing services #write paper for me #research paper writing service #essay paper #professional essay writers #write my essay online #essay help online #write my research paper #dissertation writing help #websites that write papers for you for free #write my essay for me cheap #pay someone to write my paper #pay someone to write my research paper #Essaywriting #Academicwriting #Assignmenthelp #Nursingassignment #Nursinghomework #Psychologyassignment #Physicsassignment #Philosophyassignment #Religionassignment #History #Writing #writingtips #Students #universityassignment #onlinewriting #savvyessaywriters #onlineprowriters #assignmentcollection #excelsiorwriters #writinghub #study #exclusivewritings #myassignmentgeek #expertwriters #art #transcription #grammer #college #highschool #StudentsHelpingStudents #studentshirt #StudentShoe #StudentShoes #studentshoponline #studentshopping #studentshouse #StudentShoutout #studentshowcase2017 #StudentsHub #studentsieuczy #StudentsIn #studentsinberlin #studentsinbusiness #StudentsInDubai #studentsininternational