0

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.

2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by sincerelibran
0

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.");

	}
}
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.