I have spent much time trying to figure out what is wrong and am still unable to get it.
What it should do...
I would like it to show the name of a product, the person guess's the price, then it tells them how off they were followed by a new product.
Thanks for the help, its much appreciated!!
Cannot find symbol variable theCountCode:class priceIsRight { public priceIsRight(double guessPrice, double count) { double theguessPrice; double theCount; theguessPrice = guessPrice; theCount = count; } public String getProductName() { String productName; switch(theCount) { case 1: productName = "HP Laptop"; break; case 2: productName = "Used HP Laptop"; break; } return productName; } public String getProductPrice() { double productPrice; switch(theCount) { case 1: productPrice = 1250; break; case 2: productPrice = 1000; break; } return productPrice; } public String toString() { String result; result = ""; result = getProductName(); return result; } public static void main (String args []) { for (int count =0; count <10; count++) { double guessPrice; priceIsRight myPrice = new priceIsRight(guessPrice,count); System.out.println ("Guess Amount: "); guessPrice = TextIO.getInt(); System.out.println(myPrice); } } }
-Line 15
-Line 33
Incompatible types
-Line 42


Reply With Quote


Bookmarks