Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CS 110, Spring 2013 Programming Assignment #2 100 points, Due 3/6/2018 Topics: Strings, class Math, expressions, variables, Scanner, and static Methods Write a solution to

image text in transcribed
image text in transcribed
CS 110, Spring 2013 Programming Assignment #2 100 points, Due 3/6/2018 Topics: Strings, class Math, expressions, variables, Scanner, and static Methods Write a solution to each of the following problems and submit 2 java files to your TA. 1. Problem: Circles The formula to find the distance between 2 points is: distance =-(x2-x1)2 + (y2-y1): Given the coordinates of the center of a circle, and another point on the perimeter of the circle you can use this formula and the radius of the circle to calculate the diameter, circumference and area of the circle. Your main program should prompt the user to input the x/y coordinates of the two points and use methods to calculate the following values: distance: This method takes the x/y coordinates of the two points as type double, and returns a value of type double that is the distance between the two points radius: This method takes the x/y coordinates of the two points as type double, and then calls the distance method to calculate the radius of the circle and returns it. . diameter: Give the radius of a circle as a parameter calculates and returns the diameter of a circle. (2R) . circumference: This method takes a parameters that is the radius of a circle and returns the circumference of the circle. (2xR) area: This method takes as a parameter a number that is the radius of a circle and returns the area of the circle (aR?) Your main program should print out the circle's radius, diameter, circumference, and area. Use the printf method covered in lab to print these values with only 2 places after the decimal point. 2. this problem you will create a program that given some basic information calculates an estimated monthly payment for an auto loan, and the amount of the loan remaining after making 12, 24, &36 payments. Your program should prompt the user for the make, model, and year of an automobile, the auto's price, and the amount of the down payment. You will assume that all autos will be financed for 72 months at an interest rate of 6.9% annually. Your program MUST implement the following methods calculatePayment: which receives the interest rate (rate), loan amount (principle) and number of months for which the auto is financed (months) as parameters and will calculate the monthly payment as: payment as: o is financed (mon (Rate/12)/ (1-(1+Rate/12)eat . payment Principle

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_2

Step: 3

blur-text-image_3

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 Fundamentals Study Guide

Authors: Dr. Sergio Pisano

1st Edition

B09K1WW84J, 979-8985115307

More Books

Students also viewed these Databases questions

Question

Which approach is least fitting for the job? Explain.

Answered: 1 week ago

Question

How is the compensation for sales representatives determined?

Answered: 1 week ago