Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted as JavaScript by lindsaydonovan ( 5 years ago )
/**
* This class prompts the user for 3 different strings anf places them in a print line
* 2-22-21
*Lindsay Donovan
*/
import java.util.Scanner; // this imports code, so we can accept user input
public class Prompt3
{
public static void main(String[] args)
{
//promt for weekday
System.out.println(" What day of the week is it? ");
Scanner in = new Scanner (System.in) ; // required for input (just do it once)
String weekDay = in.nextLine(); // stores input to variable weekDay
System.out.println(" Today is " + weekDay);
//prompt for weather
System.out.println(" Please enter the weather ");
String weather= in.nextLine();
//promt for temp
System.out.println(" Please enter the temperature ");
String temp = in.nextLine ();
System.out.println(" Today is " + weekDay + " it is " + weather + " outside ");
System.out.println(" The current temperature outside is " + temp + " degrees");
}
}
Revise this Paste
Parent: 115289