Homework 2 Csc211.
Due Tuesday Jan 27, 11:59pm
Problem 1 (25 Points)
Do all the problems in written exercise 1. You can find those exercises here
Turn in Instructions
- Type your answers into a text file.
- Upload the text file to COL. using the link hw2a
- After you upload a file you can click on it to see what you submitted.
- You can upload a file multiple times, each time it will overwrite the previous submission.
Problem 2 (25 Points)
Due lab2 question 3. Your class must be named SphereInfo
Except your answer must be displayed to two decimal places. Use class DecimalFormat
Your output should look like this: For example if I enter 5 into the dialog box, your program should display to the screen.
A sphere with radius 5.0 has a volume of 523.33 A sphere with radius 5.0 has a surface area of 314.00If I enter 3.4, your program should display to the screen.
A sphere with radius 3.4 has a volume of 164.55 A sphere with radius 3.4 has a surface area of 145.19
Note: Each program file should start out with comments, listing your name, date and a description of what the program will do.
Turn in Instructions
- Upload SphereInfo.java to COL. using the link hw2B
- Upload the .java file NOT the .class file.
- After you upload a file you can click on it to see what you submitted.
- You can upload a file multiple times, each time it will overwrite the previous submission.
- The time stamp will log the most recent submission
Problem 3 (25 Points)
Write a program to compute the volume of a cylinder.You must name your class CylinderVolume
Your program must input two values. One for the radius, the other for the
height. You can find the formula here Cylinder Formula
Your program must output the volume rounded to two places. Use either System.out or JOptionPane to display the output.
Turn in Instructions
- Upload CylinderVolume.java to COL. using the link hw2C
- Upload the .java file NOT the .class file.
- After you upload a file you can click on it to see what you submitted.
- You can upload a file multiple times, each time it will overwrite the previous submission.
- The time stamp will log the most recent submission