Yosemite Visit

Yosemite Visit - String traffic = in.nextLine(); //Process...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
/* * Decide whether to go to Yosemite. */ package yosemitevisit; import java.util.Scanner; /** * * @author Manny */ public class YosemiteVisit { /** * @param args the command line arguments */ public static void main(String[] args) { // Input System.out.println("Is the weather nice at Yosemite today? (yes/no) "); Scanner in = new Scanner(System.in); String weatherIsNice = in.nextLine(); System.out.println("Is there traffic heading to Yosemite today? (yes/no) ");
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: String traffic = in.nextLine(); //Process String recommendation; if(weatherIsNice.equalsIgnoreCase("yes") && traffic.equalsIgnoreCase("yes")) { recommendation = "You should visit Yosemite today. "; } else { recommendation = "you should not visit Yosemite today. "; } // Output System.out.println(recommendation); } }...
View Full Document

This note was uploaded on 12/07/2011 for the course BUS 350 taught by Professor Leighjin during the Fall '11 term at S.F. State.

Ask a homework question - tutors are online