/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package firstfall16; import java.util.Scanner; /** * * @author jcmtiernan */ public class FirstFall16 { /** * @param args the command line arguments */ public static void main(String[] args) { // First program on first day of class int banana = 0; // declaration with initialization of 0 int apple = 5; double pie = 0; Scanner input = new Scanner(System.in); /* System.out.println("Hello world"); System.out.println("Value is " + 5 +" an integer"); System.out.println(banana); System.out.println(pie); System.out.println(banana + pie); */ banana = 11; // assignment pie = 10.5; System.out.println("banana value = " + banana); System.out.println(banana); System.out.println(pie); System.out.println(banana + pie); double dessert = (double) banana / apple; System.out.println("dessert is "+dessert); System.out.print("Enter a new double value for dessert: "); dessert = input.nextDouble(); System.out.println("New dessert is "+dessert); int pudding = (banana / apple); int sweet = banana % apple; System.out.println("pudding is "+pudding+" and sweet is "+sweet); dessert = Math.pow(pie, 2); System.out.println("dessert is "+dessert); } }