import java.util.Scanner;
public class TipCalculator {
public static void main(String[] args){
//Welcome
System.out.println("Welcome to the Tip Calculator App");
//declare variables
double billAmount, tipPercentage, tipAmount, totalBill;
// Prompt user to enter total bill amount - scanner class
Scanner scanner = new Scanner (system.in);
system.out.print("Enter the total bill amount: ");
billAmount = scanner.nextDouble();
// Create edge case if user enters 0 or negative Number
if (billAmount <= 0){
system.out.println("Bill amount cannot be 0 or a negative please try again.");
scanner.close();
return
// Prompt user to input the tip percentage they want to tip
System.out.print("Tip Percentage: ");
tipPercentage = scanner.nextDouble();
// Calculate tip amount
tipAmount = billAmount * (tipPercentage / 100.0);
// Calculate total billAmount
totalBill = billAmount + tipAmount;
// Display the tip amount
System.out.println("Tip amount: $" + String.format(tipAmount));
// Display total amount to Display
System.out.println("Total amount to pay: $" + String.format(totalBill));
// Goodbye
System.out.println("Have a great day!");
Scanner.close();
}