Skip to content

Commit

Permalink
complete objective4lab1
Browse files Browse the repository at this point in the history
  • Loading branch information
A-Shumway42 committed Sep 28, 2021
1 parent 81a81ce commit 19b9d1d
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions Labs/Objective4Lab1.java
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 + ".");

}
}

0 comments on commit 19b9d1d

Please sign in to comment.