public class Assignment2
{
public static void main(String[] args)
{
Scanner scan = new Scanner(System.in);
NumberFormat fmt1 = NumberFormat.getCurrencyInstance();
// Variables are defined as.
int hamburger, cheeseburger, fries, drinks;
double hamburgerCost, cheeseburgerCost, fryCost, drinkCost,
numItems, totalCost;
final double HAMBURGER_PRICE = 2.75;
final double CHEESEBURGER_PRICE = 3.25;
final double FRIES_PRICE = 2.50;
final double DRINK_PRICE = 1.50;
System.out.print("How many hamburger(s) do you
want? :"); //Enter the amount of items you would like to order
hamburger = scan.nextInt();
System.out.print("How many cheeseburger(s) do you
want?:"); //Enter the amount of items you would like to order
cheeseburger = scan.nextInt();
System.out.print("How many orders of fries?:"); //Enter the
amount of items you would like to order
fries = scan.nextInt();
System.out.print("How many drinks do you want?:"); //Enter
the amount of items you would like to order
drinks = scan.nextInt();
hamburgerCost = hamburger * HAMBURGER_PRICE;
cheeseburgerCost = cheeseburger * CHEESEBURGER_PRICE;
fryCost = fries * FRIES_PRICE;
drinkCost = drinks * DRINK_PRICE;
numItems = hamburger + cheeseburger + fries + drinks;
totalCost = hamburgerCost + cheeseburgerCost + fryCost + drinkCost;
System.out.println("Total cost of hamburger(s):" +
fmt1.format(hamburgerCost));
System.out.println("Total cost of cheeseburgers:" +
fmt1.format(cheeseburgerCost));
//******************************************************************************
**
// AUTHOR: Christopher Tullous
// FILENAME: Assignment2.java
// SPECIFICATION: Calculates total items and total cost of items entered by
user.
// FOR: CSE 110- Assignment 2
// TIME SPENT:1hr 15min
// 1:a)True
// b)False
// c)
// d)
// 2:System.out.print("Enter first name:")
// scan.in.next();
// System.out.print("Enter last name:")
// scan.in.nextLine();
// 3:H
//******************************************************************************
**
import java.util.Scanner;
import java.text.NumberFormat;