Question: Write a simple program that prints out the answer to each of the following equations. You should first store each solution in a variable and
- Write a simple program that prints out the answer to each of the following equations. You should first store each solution in a variable and then use that variable when printing your results. You can put all of this in a single program. The objective here is to get used to using the Java arithmetic operators. You can look-up each of these equations online. Do not use a calculator to pre-calculate any of these values. All calculations should be done in code as per the following example. Refer to Chapter 2, Section 5 for more information on arithmetic operators. and please solve in java Example: Perimeter of a rectangle with a length of 3 and a width of 5 Solution: int rectPerimeter = (2 * 3) + (2 * 5); System.out.println(Rectangle perimeter is: + rectPerimeter);
- The diameter of a circle with a radius of 4
- The average of the numbers 17, 37, and 111
- The sum of a series of numbers from 1 to 100 (Hint: Is there a quicker way to do this than 1 + 2 + 3 + 4 + etc)
- 112.4 degrees Fahrenheit in Celsius and Kelvin
- The number of quarters, dimes, nickels, and pennies in 97 cents
- Calculate the hypotenuse for a right triangle with sides of 7 and 9.3. Write this twice, once using only arithmetic operators and a second time using the pow() method found in the Math class discussed in Chapter 2, Section 5 page 62.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
