Help me here i tried make success , program but theres a mistakes here can? any one solve it and send it , If the customer pays less than the ticket price, I want to print the money less than the ticket price and print the rest to pay, or if the customer pays more than the ticket price, the rest of the money is printed to the customer, and finally if he pays the ticket amount, you print welcome
import java.util.Scanner;
public class Flow {
static Scanner input = new Scanner(System.in);
static int age;
static double ticketpricetax = 0.15 * 100 + 10;
public static double remainigamount = ticketpricetax;
public static double howmuchpay = 10;
public static void main(String[] args) {
System.out.println("Age");
int age = input.nextInt();
if (age > 12 || age <= 50) {
System.out.println("ticket price is ");
System.out.println(ticketpricetax);
System.out.println("Please pay your ticket");
}
input.nextInt();
if (ticketpricetax > howmuchpay) {
System.out.println("the money less than ticket price");
} else if (ticketpricetax > howmuchpay) {
System.out.println("the money is greater than ticket price");
} else {
System.out.println("welcome");
}
}
}
Aucun commentaire:
Enregistrer un commentaire