Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Page 1 of 2 In this assignment, you can use any Java IDE to write your program. Refer to the rubric at the end of

image text in transcribed
image text in transcribed
image text in transcribed
Page 1 of 2 In this assignment, you can use any Java IDE to write your program. Refer to the rubric at the end of this document to how your assignment will be graded. Question 1 Algorithm for Problem 2.19 on page 73 (Area of a triangle) Submit print out with your name on top. Question 2 Implementation of algorithm above. Refer to the rubric at the end of this document to how your assignment will be graded. Question 3 Algorithm for Problem 2.21 on page 74 (Future investment value) Submit print-out with your name on top. Question 4 Implementation of algorithe above. Refer to the rubric at the end of this document to how your assignment will be graded. Programming Exercises 73 Enter the length of the side: 5.5 The area of the hexagon is 78.5918 17 Science wind-chill temperature) How cold is it outside? The temperature alone is not enough to provide the answer. Other factors including wind speed, relative humidity, and sunshine play important roles in determining coldness outside. In 2001, the National Weather Service (NWS) implemented the new wind-chill temperature to measure the coldness using temperature and wind speed. The formula is - 35.74 +0.62156 - 35.750 16 + 0.4275.0.16 where is the outside temperature measured in degrees Fahrenheit, v is the speed measured in miles per hour, and is the wind-chill temperature. The formula cannot be used for wind speeds below 2 mph or temperatures below --58F or above 41F. Write a program that prompts the user to enter a temperature between-58 F and 41F and a wind speed greater than or equal to 2 then displays the wind-chill temperature. Use Math pow(a, b) to compute . Here is a sample run: 3.81 MI) is on ght in ko splays the 254 meten Enter the temperature in Fahrenheit between -58 F and 41'F: 5.3 - Enter the wind speed (>= 2) in miles per hour: 6 Inter The wind chill index is -5.56707 2.18 compts the (Print a table) Write a program that displays the following table. Cast floating point numbers into integers. a b pow(a, b) 1 2 1 2 38 3 4 81 4 5 1024 5 6 15625 (Geometry area of a triangle) Write a program that prompts the user to enter three points, (x1, y1). (x2, y2), and (x3, y3), of a triangle then displays its area. The formula for computing the area of a triangle is S = (sidel + side2 + side372: Stance. The be you can *2.19 - side 2)(s - side 3) area = Vs(s - side 1) Here is a sample run: Enter the coordinates of three points separated by spaces nike x1 y1 x 2 y2 x3 y3: 1.5 -3.4 4.6 5 9.5 -3.4 The area of the triangle is 33.6 w the balance and the te the interest on the next mon 74 Chapter 2 Elementary Programming Sections 2.13-2.17 *2.20 Financial application calculate interest if you know the hal w entare interest rate, you can compute the interest on the new men using the following formula: pe interest interest - balance X (annual Interest Rata/1200) Write a program that reads the balance and the annual percentage is displays the interest for the next month. Here is a sample run 3 for 3): 1000 3.5 Enter balance and interest rate (0.9.3 for 38): 1000 The interest is 2.91667 * 2.21 years and Financial aplication calculate future investment value) Write a me reads in investment amount, annual interest rate, and number of years the future investment value using the following formula: futureInvestment Value = investment Amount X (1 + monthlyInterest Rate brorreari2 For example, if you enter amount 1000, annual interest rate 3.25, and of years 1. the future investment value is 1032.98. Here is a sample run: Enter investment amount : 1000.56 - Enter annual interest rate in percentage: 4.25 - Enter number of years: 1 - Future value is $1043.92 *2.22 (Financial application: monetary units) Rewrite Listing 2.10, ComputeChung java, to fix the possible loss of accuracy when converting a double value o int value. Enter the input as an integer whose last two digits represent the cons For example, the input 1156 represents 11 dollars and 56 cents. (Cost of driving) Write a program that prompts the user to enter the distance drive, the fuel efficiency of the car in miles per gallon, and the price per then displays the cost of the trip. Here is a sample run: .2.22 Enter the driving distance: 900.5 F Enter miles per gallon: 25.5 - Enter price per gallon: 3.55 The cost of driving is $125.36 Note More than 200 additional programming exercises with solutions are prov instructors on the Instructor Resource Website Solutions are provided to the

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

Informix Database Administrators Survival Guide

Authors: Joe Lumbley

1st Edition

0131243144, 978-0131243149

More Books

Students also viewed these Databases questions

Question

b. What groups were most represented? Why do you think this is so?

Answered: 1 week ago