/* This is a simple program that uses class variable & local variable It asks the user for first and last name then output their monthly salary * */ import java.util.Scanner; // Needed for scanner class public class Salary { static final double pay = 15.50; // Pay is a constatnt class variable public static void main(String[] args) { String first, last; final int hours = 20; // Hours is a constant integer double sum = 0.0; Scanner key = new Scanner(System.in); System.out.print("Enter your first name: "); first = key.nextLine(); System.out.print("Enter your last name: "); last = key.nextLine(); sum = hours * pay; // Calculates the monthly salary System.out.println(first + " " + last + " Your monthly salary is " + sum); } }