Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

answering it in java using net beans Problem #1: (35 pts] A bank provides two types of loans to its customers: personal and student loans.

image text in transcribed

answering it in java using net beans

Problem #1: (35 pts] A bank provides two types of loans to its customers: personal and student loans. Each type has its own interest rate. The loan duration can be for 3 or 5 years. The interest rate is shown in the below table: Personal Student 5 % 3 % 3 years 5 4 % 2.5 % years The monthly payment for each loan is calculated as follows: Total interest amount = loan amount * interest rate * number of years Loan duration in months = 12 * number of years Monthly payment = (loan amount + total interest amount) / loan duration in months . Write a program that prompts the user to enter: the loan type as character (P or S), the loan amount the number of years of the loan as an integer: 3 or 5 years The program will calculate the monthly payment and display it as shown in the sample runs below: Sample Run 1: Enter the loan type: P Enter the loan amount in dollars: 20000 Enter the number of year: 3 The monthly payment for your loan with interest 0.05 is: 638.88 Sample Run 2: Enter the loan type: S Enter the loan amount in dollars: 20000 Enter the number of year: 3 The monthly payment for your loan with interest 0.03 is: 605.55 Sample Run 3: Enter the loan type: f Invalid loan type. Sample Run 4: Enter the loan type: p Enter the loan amount in dollars: 20000 Enter the number of year: 4 Invalid number of years

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems An Application Oriented Approach Complete Version

Authors: Michael Kifer, Arthur Bernstein, Richard Lewis

2nd Edition

0321268458, 978-0321268457

More Books

Students also viewed these Databases questions

Question

Provide examples of KPIs in Human Capital Management.

Answered: 1 week ago

Question

What are OLAP Cubes?

Answered: 1 week ago