/* * 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 spr17jan26; import java.util.Scanner; /** * * @author jcmtiernan */ public class Spr17Jan26 { /** * @param args the command line arguments */ public static void main(String[] args) { Scanner input = new Scanner(System.in); int dog; double bacon = 3.6; dog = 3; bacon = 9.34; String tires = "6"; dog = dog + Integer.parseInt(tires); System.out.println("Please enter values of integer. Type 0 to stop: "); dog = input.nextInt(); //dog = (int) bacon; System.out.println("dog is "+dog+" and bacon is "+bacon+ " tires = "+tires ); // control structures while (dog != 0) { if (input.hasNextInt()) // >, <, >=, <=, ==, != { dog = input.nextInt(); System.out.println( "Dog "+dog+" eats bacon! because there is more data"); } else { tires = input.next(); System.out.println( "Bacon smacks dog!" + tires); } } } }