Import java.util.scanner;
public class rental
{
private double total;

public void settotal()
{
system.out.println("rental total set");
}
public static void main(string[] args)
{
scanner sc = new scanner(system.in);
system.out.print("enter rental type: \n"
+ "'c' for canoe rental\n"
+ "'j' for jet ski rental\n");
string rentaltype = sc.next();
rental rental = new rental();
if (rentaltype.equalsignorecase("c"))
rental = new canoerental();
else if (rentaltype.equalsignorecase("j"))
rental = new jetskirental();
rental.settotal();
}
}

Solved
Show answers

Ask an AI advisor a question