Answered step by step
Verified Expert Solution
Question
1 Approved Answer
CSCI 1 3 0 1 : Introduction to Computing and Programming Project 1 : Credit Card Pay Off Introduction This project will allow you to
CSCI : Introduction to Computing and Programming
Project : Credit Card Pay Off
Introduction
This project will allow you to apply your knowledge of variables, assignments, expressions, type
casting, input, output, and basic algorithm design. The program can be completed using variable
assignment statements as well as input and output statements. You are free, however, to use any
other features of Java.
You will write a Java application to compute and display the number of months needed to pay
off credit card debt. Your program will prompt the user for the following three things:
the principal, which is the amount of money owed on the credit card;
the annual interest rate;
the monthly payment, the amount the user plans to pay the credit card company each month.
Based on these inputs, the program will compute the number of months required to pay the debt.
It will also compute the total amount paid to the credit card company after all payments are
made, the total the amount of interest paid, and the overpayment.
The number of months needed to pay off the debt can be calculated using the following formula.
times
In the formula, lnx is the natural logarithm of a real number x
The total amount paid to the credit card company is the ceiling of the number of months needed
to pay off the debt multiplied by the monthly payment. The total interest paid is simply the
principal amount which is provided by the user subtracted from the total amount paid to the
credit card company. The overpayment is the amount overpaid to the credit card company, which
is an algorithm youll have to figure out. Details about these computations are given in the
Program Requirements section.
The following is a sample run, and the input shown in red for
demonstration purposes only and output of your submitted program should be formatted the
same way when run in Eclipses console or on a command line. Additional sample runs are
included at the end of this document.
Principal:
Annual Interest Rate :
Monthly Payment:
Months Needed To Pay Off:
Total Amount Paid: $
Total Interest Paid: $
Overpayment: $
CSCI : Project Page
Program Requirements
The instructions below must be followed in order for full credit to be awarded. Following the
instructions is a vital part to this and all programming projects.
The name of the program file must be PayoffDebt.java.
The class name in the file must be PayoffDebt in Java, the class name and java file
name must match
The program must read inputs and display the results in exactly as indicated in the examples.
The annual interest rate should be entered as a percent as shown in the examples.
The Months Needed To Pay Off must be stored with two different variables. One variable
should store the raw value as a double computed by the formula above. The other variable
should be stored and written to output as a bit integer, and it should contain the ceiling of
the raw value the smallest integer greater than or equal to it For instance, the integer
ceiling of is
All other numeric variables must be double data types.
You must figure out the algorithm to compute the overpayment based on the examples given
at the end of this project. Hint: It uses both the floating point and integer values of The
Months Needed To Pay Off. Write its algorithm in pseudocode in the comments of your
project directly above the lines of source code that computes the overpayment.
The Total Amount Paid, Total Interest Paid, and Overpayment output must be formatted like
units of currency. They must have a $ in front of their values, and their values must show
only two digits after the decimal point. An example of formatting output can be done with
the printf method, and examples of this are shown in the th edition of the course
textbook. You can also round to two decimal places by using mathematical operations
divide type casting, and multiply Your answer must be within of the answer to receive
full credit.
You must include the Statement of Academic Honesty comment at the top of the programs
source file. Copy and agree to the entirety of the text contained in the file
StatementOfAcademicHonesty.txt and fill in the class name of your java file, your
name, submission date, and the programs purpose. In the future, every Java source file of
every project you submit must have a comment such as this at the top of every source file.
Otherwise, points will be deducted from your project.
When writing your program, you may safely assume that all input to the program is valid. That
is you do not need to write code to handle erroneous or illformed data entered by the user.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started