Description
- Write a Java program that displays the following table:
a a^2 a^3
- 1 1
- 4 8
- 9 27
- 16 64
- Write a Java program that displays the perimeter and the area of a rectangle with a width of 4.5 and a height of 8.0.
(Recall: perimeter = the sum of the lengths of all four sides.)
- Celsius to Fahrenheit conversion: write a Java program that reads a Celsius degree (a floating point of type double) from the console, converts it to degrees Fahrenheit (also as type double), and displays the result.
Show the output of your code for the following five values of degree Celsius: 0, 18, 36, -12.5, -40
- Write a Java program that, given the radius and the height, computes the volume of a cylinder. The formula for volume of a cylinder is:
Volume = Area * Height where Area = radius*radius*pi
- Assume you’ve just had dinner at a restaurant in a state with no sales tax (ever been to Delaware?) Write a Java program that takes as its input from the user i) the total $ amount billed for the dinner and ii) the desired tip %, a value between 10% and 25%; and then calculates the total after the tip, and displays that total on the screen. The $ amount should be of type double and have two decimal places (that stand for cents). Submit five sample runs showing the totals for different combinations of the pre-tip dollar amount and the tip percentage.