Improve your solution to EXERCISE 1.2.25 by adding code to check that the values of the command-line
Question:
Improve your solution to EXERCISE 1.2.25 by adding code to check that the values of the command-line arguments fall within the ranges of validity of the formula, and by also adding code to print out an error message if that is not the case.
Transcribed Image Text:
1.2.25 Wind chill. Given the temperature T (in degrees Fahrenheit) and the wind speed v (in miles per hour), the National Weather Service defines the effective tem- perature (the wind chill) as follows: w = 35.74 +0.6215 T+ (0.4275 T-35.75) v0.16 Write a program that takes two double command-line arguments temperature and velocity and prints the wind chill. Use Math.pow(a, b) to compute a. Note: The formula is not valid if T' is larger than 50 in absolute value or if v is larger than 120 or less than 3 (you may assume that the values you get are in that range).
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 50% (2 reviews)
Certainly Below is an improved Java program for the wind chill calculation with added code to check ...View the full answer
Answered By
Amit Kumar
I am a student at IIT Kanpur , which is one of the prestigious colleges in INDIA.
Cleared JEE Advance in 2017.I am a flexible teacher because I understand that all students learn in different ways and at different paces. When teaching, I make sure that every student has a grasp of the subject before moving on.
I will help student to get the basic understanding clear. I believe friendly behavior with student can help both the student and the teacher.
I love science and my students do the same.
4.90+
44+ Reviews
166+ Question Solved
Related Book For
Introduction To Programming In Java An Interdisciplinary Approach
ISBN: 9780672337840
2nd Edition
Authors: Robert Sedgewick, Kevin Wayne
Question Posted:
Students also viewed these Computer science questions
-
In this lab, you complete a partially prewritten C++ program that uses an array. The program prompts the user to interactively enter eight batting averages, which the program stores in an array. The...
-
1. Write a program that translates a letter grade into a number grade. Letter grades are A, B, C, D, and F, possibly followed by + or -. Their numeric values are 4, 3, 2, 1 and 0. There is no F+ or...
-
Case Study: Quick Fix Dental Practice Technology requirements Application must be built using Visual Studio 2019 or Visual Studio 2017, professional or enterprise. The community edition is not...
-
obias is a foreman at a factory that manufactures auto parts. When a health a safety inspector visits the plant, Tobias notices the inspector writing down several major labor and safety violations....
-
A horizontal plane supports a stationary vertical cylinder of radius R and a disc A attached to the cylinder by a horizontal thread AB of length l0 (Fig. 1.32, top view). An initial velocity vo is...
-
Discuss characteristic findings for a stroke and how it affects the lives of patients and their families. Discuss the nurse's role in supporting the patient's psychological and emotional needs....
-
Taylor Company reports free cash flow of \(\$ 15,000\), total cash of \(\$ 18,000\), net income of \(\$ 50,000\), current assets of \(\$ 90,000\), average current liabilities of \(\$ 38,400\), and...
-
Your company currently has $1000 par, 6% coupon bonds with ten years to maturity and a price of $1078. If you want to issue new ten-year coupon bonds at par, what coupon rate do you need to set?...
-
Problem 11-10 (Replacement Analysis) Question 5 of 6 Check My Work Replacement Analysis St. Johns River Shipyards' welding machine is 15 years old, fully depreciated, and has no salvage value....
-
Suppose that i and j are both of type int. What is the value of j after each of the following statements is executed? a. for (i = 0, j = 0; i < 10; i++) j += i; b. for (i = 0, j = 1; i < 10; i++) j...
-
Write a program RollLoadedDie that prints the result of rolling a loaded die such that the probability of getting a 1, 2, 3, 4, or 5 is 1/8 and the probability of getting a 6 is 3/8.
-
During the last couple years many countries faced depopulation. Ten counties of a certain country are selected and the number of elementary schools closed are found: a. Find the mean, median, and...
-
This week we will look at the Conference Board's Economic Forecast for the U.S. Economy.The Conference Board is a non-profit Global Research Organization that studies national economies and industry...
-
The following product costs are available for Haworth Company on the production of chairs: direct materials, $ 1 3 , 9 5 0 ; direct labor, $ 2 2 , 0 0 0 ; manufacturing overhead, $ 2 1 , 2 0 0 ;...
-
A physical inventory of Liverpool Company taken at December 31 reveals the following. Per Unit Item Units Cost Market Car audio equipment Speakers 352 $ 107 $ 115 Stereos 267 128 118 Amplifiers 333...
-
A North-East University has committed to invest in building two building complexes, one an innovation and educational facility, and the second a residential mid-rise mixed mode building complex at a...
-
West Coast Tours runs boat tours along the west coast of British Columbia. On March 5 , 2 0 2 3 , it purchased, with cash, a cruising boat for $ 9 0 0 , 0 0 0 , having a useful life of 1 0 years or 1...
-
During the current year, merchandise is sold for $1,375,000. The cost of the merchandise sold is $880,000. a. What is the amount of the gross profit? b. Compute the gross profit percentage (gross...
-
On 1 July 2018, Parent Ltd acquired all the shares of Son Ltd, on a cum-div. basis, for $2,057,000. At this date, the equity of Son Ltd consisted of: $ 1,000,000 Share capital 500 000 shares...
-
For each of the following four networks, discuss the consequences if a connection fails. a. Five devices arranged in a mesh topology b. Five devices arranged in a star topology (not counting the hub)...
-
Categorize the four basic topologies in terms of line configuration.
-
What is an internet? What is the Internet?
-
6 H 9 A $6,382.11 loan was charged a simple interest rate of 3.00%. The loan accrued interest of $120.00. How many years ago was the loan made? (Hint: Also try to think about the number of...
-
7.1. Companies A and B have been offered the following rates per annum on a Rs. 1,00,00,000 loan for 5 years. Fixed rate Floating rate Company A Company B MIBOR +0.1% MIBOR +0.9% 12.0% 14.4% Company...
-
Required: Download the group / consolidated financial statements for the MTN and Vodacom Groups for the periods ending 2 0 2 0 - 2 0 2 3 . ( They have different year ends - but for the purposes of...
Study smarter with the SolutionInn App