I want to make a program for a boat. It will ask the passenger
number of passengers how much they each get paid. Then, it will give me the revenue and based on that, I will calculate the monthly revenue.
package com.company;
class Boat {
private int passenger; // total number of passengers
private int cost; // cost per passenger
private int RevenueCalculator;
public Boat(int newpassenger, int newcost) {
this.passenger = newpassenger;
this.cost = newcost;
}
public int computeRevenue() {
int RevenueCalculator;
RevenueCalculator = this.cost * this.passenger;
System.out.println("How many passengers");
System.out.println("Cost per passenger");
return RevenueCalculator;
}
}
I ran this program and this error pop up:
Error: Could not find or load main class com.company.Main Caused by: java.lang.ClassNotFoundException: com.company.Main.
How do I fix it?