Advertisement
HarrJ

Day 6

Jun 25th, 2024 (edited)
629
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.71 KB | None | 0 0
  1. package seagem2024b2;
  2. import java.util.Scanner;
  3.  
  4. public class Day06A {
  5.     public static void main(String[] args) {
  6.         Scanner sc = new Scanner(System.in);
  7.         String petName, petBreed, species;
  8.         int petAge;
  9.        
  10.         System.out.print("Enter Pet Name: ");
  11.         petName = sc.nextLine();
  12.         System.out.print("Age: ");
  13.         petAge = sc.nextInt();
  14.         System.out.print("Pet Breed: ");
  15.         petBreed = sc.next();
  16.         System.out.print("Pet Species: ");
  17.         species = sc.nextLine();
  18.        
  19.         System.out.println();
  20.         System.out.println(petName + " is a " + petBreed + " "
  21.                 + species + ". And is " + petAge + " years old");
  22.     }
  23. }
  24.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement