From 19b9d1dcd90eee9e61ab061d48f87416768281a7 Mon Sep 17 00:00:00 2001 From: Andrew Shumway Date: Tue, 28 Sep 2021 14:26:11 -0600 Subject: [PATCH] complete objective4lab1 --- Labs/Objective4Lab1.java | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Labs/Objective4Lab1.java diff --git a/Labs/Objective4Lab1.java b/Labs/Objective4Lab1.java new file mode 100644 index 0000000..ed49d43 --- /dev/null +++ b/Labs/Objective4Lab1.java @@ -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 + "."); + + } +}