error: cannot find symbol symbol: variable userInput location: class Main

Опубликовано: 29 Сентябрь 2024
на канале: Legendary Computer Programmer
11,770
27

subscribe and like video!
Try it for yourself, here is the unfixed code:
import java.util.Scanner;

class Main {
public static void main(String[] args) {

// This variable holds the amount of pay employees can earn each pay period.
double payAmount = 2200.0;
payAmount = userInput.nextDouble();

// This variable will hold the number of pay periods in a year.
double payPeriods = 26;

// This variable will hold the employees total annual pay.
double annualPay = payAmount * payPeriods;
double bonusPay = .05 * annualPay;

double totalPay = annualPay + bonusPay;
System.out.printf("The total annual pay is $%.2f\n", totalPay);



}
}