public class SnitSoft {
public static void main(String[] args) {
double amount;
amount = 155.21;
amount = amount + 66.19;
System.out.print("We will bill $");
System.out.print(amount);
System.out.println(" to your credit card.");
}
}
public class SnitSoft {
public static void main(String[] args) {
double cash;
cash = 5.95;
cash = cash + 25.00;
System.out.print("We will bill $");
System.out.print(cash);
System.out.println(" to your credit card.");
}
}
public class SnitSoft {
public static void main(String[] args) {
double amount;
amount = 5.95;
amount = amount + 1_000_000.00;
System.out.print("We will bill $");
System.out.print(amount);
System.out.println(" to your credit card.");
}
}
import java.util.Scanner;
public class Parking {
public static void main(String[] args) {
Scanner keyboard = new Scanner(System.in);
double amount;
System.out.print("What's the price to park your car? ");
amount = keyboard.nextDouble();
amount = amount + 2.00;
System.out.print("You will pay $");
System.out.print(amount);
System.out.println(" in total.");
keyboard.close();
}
}
import java.util.Scanner;
public class VersatileSnitSoft {
public static void main(String[] args) {
Scanner keyboard = new Scanner(System.in);
double amount;
System.out.print("What's the price of a flash drive? ");
amount = keyboard.nextDouble();
amount = amount + amount;
System.out.print("We will bill $");
System.out.print(amount);
System.out.println(" to your credit card.");
keyboard.close();
}
}
Defined field double bananaCalories = 100.0
Defined field double appleCalories = 95.0
Defined field double dietSodaCalories = 0.0
Defined field double cheeseburgerCalories = 500.0
bananaCalories + appleCalories +
dietSodaCalories + cheeseburgerCalories = 695.0