It just won't. No matter what I try, it won't even output what I tell it to, muchless as me for input. Here's the code:

package javatask1;
import static java.lang.System.out;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
  
public static int moneyEarned = 0;
 Scanner myScanner = new Scanner(System.in);
 int userEnteredMoney = myScanner.nextInt();
 System.out.println("Please Enter Money Earned Tutoring");
        moneyEarned = moneyEarned + userEnteredMoney ;

        
       System.out.println("15" + " hours and " + userEnteredMoney + " dollars.");
};

Please help me :( I just want it to ask me to enter an amount.

Please try this code

import static java.lang.System.out;
import java.util.Scanner;

public class ReadMain {

	public static void main(String[] args){

		int moneyEarned = 0;

		Scanner myScanner = new Scanner(System.in);

		System.out.println("Please Enter Money Earned Tutoring");
		int userEnteredMoney = myScanner.nextInt();
		moneyEarned = moneyEarned + userEnteredMoney ;

		System.out.println("15" + " hours and " + userEnteredMoney + "dollars.");

	}
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.