Sale!

CSCD 210 Homework #1

$35.00 $21.00

Category: You will Instantly receive a download link for .zip solution file upon Payment || To Order Original Work Click Custom Order?

Description

5/5 - (2 votes)

 

  1. Write a Java program that displays the following table:

 

a      a^2      a^3

  • 1 1
  • 4 8
  • 9 27
  • 16 64

 

  1. 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.)

 

  1. 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

  1. 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

 

  1. 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.