-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
81a81ce
commit 19b9d1d
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import java.util.Scanner; | ||
|
||
public class Objective4Lab1 { | ||
public static void main(String[] args) { | ||
|
||
Scanner keyboard = new Scanner(System.in); | ||
|
||
String fname = ""; | ||
String lname = ""; | ||
String favoriteAnimal = ""; | ||
String favoriteFood = ""; | ||
String favoriteSong = ""; | ||
|
||
System.out.println("What is your first name?"); | ||
fname = keyboard.nextLine(); | ||
System.out.println("What is your last name?"); | ||
lname = keyboard.nextLine(); | ||
System.out.println("What is your favorite animal?"); | ||
favoriteAnimal = keyboard.nextLine(); | ||
System.out.println("What is your favorite food?"); | ||
favoriteFood = keyboard.nextLine(); | ||
System.out.println("What is your favorite song?"); | ||
favoriteSong = keyboard.nextLine(); | ||
|
||
System.out.println("My name is " + fname + " " + lname + "."); | ||
System.out.println("My favorite animal is the " + favoriteAnimal + "."); | ||
System.out.println("My favorite food is " + favoriteFood + "."); | ||
System.out.println("My favorite song is " + favoriteSong + "."); | ||
|
||
} | ||
} |