package cusack; // Basic Java Program to Learn the Basics // Author: Joe Cusack // // insert your standard heading here. // // fix your file names. import java.util.Scanner; // Allows user input public class HelloJava { public static void main(String[] args) { // Step 1: Print a message System.out.println("Welcome to Java Programming!"); // Step 2: Create a Scanner object to read input Scanner input = new Scanner(System.in); // Step 3: Ask for user input System.out.print("Enter your name: "); String name = input.nextLine(); // Step 4: Greet the user System.out.println("Hello, " + name + "! Let's do some math."); // Step 5: Ask for two numbers System.out.print("Enter the first number: "); int num1 = input.nextInt(); System.out.print("Enter the second number: "); int num2 = input.nextInt(); // Step 6: Perform basic arithmetic int sum = num1 + num2; int diff = num1 - num2; int product = num1 * num2; // Step 7: Display results System.out.println("\nResults:"); System.out.println("Sum = " + sum); System.out.println("Difference = " + diff); System.out.println("Product = " + product); // Step 8: Close the scanner input.close(); } }