System.
out.printf ("Using balloons of radius %.Of inches," + "you will need %.Ofballoons", balloonRadius*12, balloonsRequired) ; }}
JAVA FINAL PROJECT:
System.in );
System.
out.println("Please enter your hourly rate"); This asks the user to enter the hourly wage for that employee
...
= input.nextDouble();
System.
...
that week.
double
double hours = input.nextDouble();
System.
out.println("Your total pay for this week"); This tells the user that the following displayed information is the employee's
...
publicclass cylinderVolume {
/
By: Andy Sage
ChapterSageChapter 8 Project
*/Project*/
publicstaticvoid main(String[] args) {
Scanner keyboard =
new Scanner(System.in);Scanner(System.
in);
/ It now asks for the radius of the cylinder
*/
...
out.println("What is the radius of the cylinder that you are trying to find the area of? ");
double radius = keyboard.nextDouble();
/ It
It now ask
...
the cylinder
*/
System.
*/System.
out.println("Now what is the height of the cylinder? ");
double height = keyboard.nextDouble();
...
*/
double Pi = 22/7; /calculate/
calculate area of
*/
double area = Pi*radius*radius*height;
...
}
}
chapter 9 book work:
import java.util.Scanner;
publicclass BaloonPrank {
publicstaticvoid main(String [] args) {
roommate's bedroom dimensions (in feet)
finaldouble LENGTH = 9.0;
finaldouble WIDTH = 8.0;
finaldouble HEIGHT = 7.0;
get the balloon radius
System.
out.print("Enter a balloon radius in inches:");
Scanner keyboard =
new Scanner (System.in);
double balloonRadius = keyboard.nextDouble();
balloonRadius /= 12.0;
convert inches to feet
Sphere balloon =
new Sphere (balloonRadius) ;
Box bedroom =
new Box (LENGTH, WIDTH, HEIGHT);
compute balloons in bedroom
double balloonsRequired = bedroom.volume() /balloon.volume();
System.
out.printf ("Using balloons of radius %.Of inches," + "you will need %.Ofballoons", balloonRadius*12, balloonsRequired) ; }}
System.
out.println("Your total pay for this week"); This tells the user that the following displayed information is the employee's double**double total_pay =
System.
out.printf("The total pay is $%.2f", total_pay);
...
out.println("Good job!");
System. out//.println("NOWout.println("NOW GET BACK TO WORK!!!");
}
}
Chapter 8 project:
import
java.util.Scanner;
publicclass cylinderVolume {
/
By: Andy Sage
Chapter 8 Project
*/
publicstaticvoid main(String[] args) {
Scanner keyboard =
new Scanner(System.in);
/ It now asks for the radius of the cylinder
*/
System.
out.println("What is the radius of the cylinder that you are trying to find the area of? ");
double radius = keyboard.nextDouble();
/ It now ask for the height of the cylinder
*/
System.
out.println("Now what is the height of the cylinder? ");
double height = keyboard.nextDouble();
/Pi variable
*/
double Pi = 22/7;
/calculate area of cylinder
*/
double area = Pi*radius*radius*height;
System.
out.print("The area of the cylinder that you are finding the area of is " + area);
System.
out//.print("Your Welcome!!!!!");
}
}
home
edited
... Alice final project (modified version of the game):
{firetruck actuall food.a2w}
Java Proj…
...
Alice final project (modified version of the game):
{firetruck actuall food.a2w}
Java Project1:
/Andys Payrole Program
*
*/
import
java.util.Scanner;
publicclass payrole_program {
publicstaticvoid main(String[] args) {
Scanner input =
new Scanner( System.in );
System.
out.println("Please enter your hourly rate"); This asks the user to enter the hourly wage for that employee
double rate = input.nextDouble();
System.
out.println("Please enter your hours worked"); This asks the user to input how many hours the employee worked for that week.
double hours = input.nextDouble();
System.
out.println("Your total pay for this week"); This tells the user that the following displayed information is the employee's
double** total_pay = (hours*rate);
System.
out.printf("The total pay is $%.2f", total_pay);
System.
out.println("Good job!");
System.
out//.println("NOW GET BACK TO WORK!!!");
}
}