I got stuck at the questions 2 here : https://www.codecademy.com/courses/learn-java/lessons/learn-java-methods/exercises/returns
Been looking for hours, driving me crazy.
I get this error message :
error: constructor Store in class Store cannot be applied to given types;
Store store = new Store(“Lemonade”, 1);
required: String,double,double
found: String,int
reason: actual and formal argument lists differ in length
Here is the code i wrote. Eclipse sees no mistake but it won´t work on codecademy. Wtf?
public class Store {
// instance fields
String productType;
double price;
double tax;
// constructor method
public Store(String product, double initialPrice, double tax) {
productType = product;
price = initialPrice;
this.tax = tax;
}
// increase price method
public void increasePrice(double priceToAdd){
double newPrice = price + priceToAdd;
price = newPrice;
}
// get price with tax method
public double getPriceWithTax(double totalPrice){
totalPrice= price + price*tax;
return totalPrice;
}
// main method
public static void main(String[] args) {
Store lemonadeStand = new Store("Lemonade", 3.75, 0.08);
}
}
Please guys, i m begging for help!