Ask coding questions

← Back to all posts
Hi everyone, can you tell me what is wrong with this code in java?
king3000 (2)

import java.util.Scanner;
class Main{
public static void main(String args[]){
class Parent{
private char store = "Payprice:";
private double number = 66.00 ;
public double discount = 2.00;}
Scanner userInput = new Scanner(System.in);
System.out.println("Enter your "+ store);
double price = userInput.nextInt();
while(price < number) {System.out.println("You have to pay: "+ price);}
while(price >= number) {System.out.println("You have to pay: " + price - discount);}

}

}

Comments
hotnewtop
[deleted]

The { needs to be on line 4