Question: import java.util.Scanner; / * * This program prints the price per ounce for a six - pack of cans. * / public class Volume 2
import java.util.Scanner;
This program prints the price per ounce for a sixpack of cans.
public class Volume
public static void mainString args
Read price per pack
Scanner in new ScannerSystemin;
System.out.printPlease enter the price for a sixpack: ;
double packPrice innextDouble;
Read can volume
System.out.printPlease enter the volume for each can in ounces: ;
double canVolume innextDouble;
Compute pack volume
final double CANSPERPACK ;
double packVolume canVolume CANSPERPACK;
Compute and print price per ounce
double pricePerOunce packPrice packVolume;
System.out.printfPrice per ounce: f pricePerOunce;
System.out.println;
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
