o both of question.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Do both of question. 

 

The output from your program should look like the following:
run:
Car Loan with:
Principal: $25000.00
Annual Interest Rate: 4.25%
Term of Loan in Months: 72
Monthly Payment: $393.98
Vehicle VIN: IRQ3458977
Primary Mortgage Loan with:
Principal: $250000.00
Annual Interest Rate: 3.10%
Term of Loan in Months: 360
Monthly Payment: $1067.54
PMI Monthly Amount: $35.12
Property Address:
321 Main Street
State College, PA 16801
Unsecured Loan with:
Principal: $5000.00
Annual Interest Rate: 10.75%
Term of Loan in Months: 48
Monthly Payment: $128.62
Transcribed Image Text:The output from your program should look like the following: run: Car Loan with: Principal: $25000.00 Annual Interest Rate: 4.25% Term of Loan in Months: 72 Monthly Payment: $393.98 Vehicle VIN: IRQ3458977 Primary Mortgage Loan with: Principal: $250000.00 Annual Interest Rate: 3.10% Term of Loan in Months: 360 Monthly Payment: $1067.54 PMI Monthly Amount: $35.12 Property Address: 321 Main Street State College, PA 16801 Unsecured Loan with: Principal: $5000.00 Annual Interest Rate: 10.75% Term of Loan in Months: 48 Monthly Payment: $128.62
public class IQANACCOUNE (
// properties
// private instance variable principal
private double principal;
//static variable "annualInterestRate"
private static double annual InterestRate:
// constructor
public LoanAccount double Principle) {
principal Principle;
{
}
// method called calculateMonthlyPayment
public double calculateMonthly Payment(int numberofRavmenta) (
double monthlyinteresat = annualinterestRate / 12:
double monthlyPayment
principal
Math Bowl + monthlvinterest, -numberofRaTENFR) ) );
return monthlyPayment:
}
(monthivinterest / (1 -
// a static method serAnnualInterestBate
public static void setannualInterestRate(double AnnualInterestRate)
annualInterestRate = AnnualInterestRate:
}
public static void main(String[] args) {
// principal loan amounts of $5000.00 and $31000.00
double principlelAmount = 5000, principle2Amount = 31000:
// Instantiate two loan objects
LoanAccount, loan1 = new LoanAccount (principlelAmount);
LoanAccount, loan2 = new IQARAGGOURE (principle2Amount);
// display results
SKAREM QUE DEÍn("Monthly payments for loanl of $%.2f and loan2
$%.2f for 3, 5, and 6 year loans at 1 & infexeshin”,
principlelAmount, principle 2 Amount);
// Set annualIntexestrate to 1%,
serAnnualInterstate (0.01);
System.out.println("Loan 3 years 5 years 6 years"
// calculate the monthly payment for each loan for 36 months, 60
months, and 72 months and print the monthly payment amounts for both
loans.
Skatem.que Brinkf("Loan1 .2 %.2f $.2f\n",
loanl.calculateMonthlyPayment (3 * 12),
loanl.calculateMonthlyPayment (5 * 12),
loanl.calculateMonthlyPayment (6 * 12)):
Skatem. QUEDEINEE("Loan2.2 %.2f $.2f\n",
n2.calculateMonthlyPayment (312),
loan2.calculateMonthlyPayment (5 * 12),
loan2.calculateMonthlyPayment (6 * 12):
Skatem.out.prİNER("Monthly payments for loan1 of $%.2f and loan2.
$%.2f for 3, 5, and 6 year loans at 5 & interestin",
principlelAmount, principle 2 Amount);
// set the annualIntexestRate to 5%
}
serAnnualInterestRate(0.05);
Svatem.out.println("Loan
3 years 5 years 6 years"):
Skatem que printf("Loani .21 %.2f $.2fin",
loanl.calculateMonthlyPayment (312),
loanl.calculateMonthlyPayment (5 * 12),
loan1.calculateMonthlyPayment (6 * 12):
Skatem. Que printf("Loan2 .2f $.2f $.2f%n",
loan2.calculateMonthlyPayment (3 * 12),
loan2.calculateMonthlyPayment (5 12),
loan2.calculateMonthlyPayment (6 * 12):
(Ctrl)
Transcribed Image Text:public class IQANACCOUNE ( // properties // private instance variable principal private double principal; //static variable "annualInterestRate" private static double annual InterestRate: // constructor public LoanAccount double Principle) { principal Principle; { } // method called calculateMonthlyPayment public double calculateMonthly Payment(int numberofRavmenta) ( double monthlyinteresat = annualinterestRate / 12: double monthlyPayment principal Math Bowl + monthlvinterest, -numberofRaTENFR) ) ); return monthlyPayment: } (monthivinterest / (1 - // a static method serAnnualInterestBate public static void setannualInterestRate(double AnnualInterestRate) annualInterestRate = AnnualInterestRate: } public static void main(String[] args) { // principal loan amounts of $5000.00 and $31000.00 double principlelAmount = 5000, principle2Amount = 31000: // Instantiate two loan objects LoanAccount, loan1 = new LoanAccount (principlelAmount); LoanAccount, loan2 = new IQARAGGOURE (principle2Amount); // display results SKAREM QUE DEÍn("Monthly payments for loanl of $%.2f and loan2 $%.2f for 3, 5, and 6 year loans at 1 & infexeshin”, principlelAmount, principle 2 Amount); // Set annualIntexestrate to 1%, serAnnualInterstate (0.01); System.out.println("Loan 3 years 5 years 6 years" // calculate the monthly payment for each loan for 36 months, 60 months, and 72 months and print the monthly payment amounts for both loans. Skatem.que Brinkf("Loan1 .2 %.2f $.2f\n", loanl.calculateMonthlyPayment (3 * 12), loanl.calculateMonthlyPayment (5 * 12), loanl.calculateMonthlyPayment (6 * 12)): Skatem. QUEDEINEE("Loan2.2 %.2f $.2f\n", n2.calculateMonthlyPayment (312), loan2.calculateMonthlyPayment (5 * 12), loan2.calculateMonthlyPayment (6 * 12): Skatem.out.prİNER("Monthly payments for loan1 of $%.2f and loan2. $%.2f for 3, 5, and 6 year loans at 5 & interestin", principlelAmount, principle 2 Amount); // set the annualIntexestRate to 5% } serAnnualInterestRate(0.05); Svatem.out.println("Loan 3 years 5 years 6 years"): Skatem que printf("Loani .21 %.2f $.2fin", loanl.calculateMonthlyPayment (312), loanl.calculateMonthlyPayment (5 * 12), loan1.calculateMonthlyPayment (6 * 12): Skatem. Que printf("Loan2 .2f $.2f $.2f%n", loan2.calculateMonthlyPayment (3 * 12), loan2.calculateMonthlyPayment (5 12), loan2.calculateMonthlyPayment (6 * 12): (Ctrl)
Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Troubleshooting
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education