Example
#{example}"); ipb.editor_values.get('templates')['togglesource'] = new Template(""); ipb.editor_values.get('templates')['toolbar'] = new Template(""); ipb.editor_values.get('templates')['button'] = new Template("
Emoticons
"); // Add smilies into the mix ipb.editor_values.set( 'show_emoticon_link', false ); ipb.editor_values.set( 'bbcodes', $H({"snapback":{"id":"1","title":"Post Snap Back","desc":"This tag displays a little linked image which links back to a post - used when quoting posts from the board. Opens in same window by default.","tag":"snapback","useoption":"0","example":"[snapback]100[/snapback]","switch_option":"0","menu_option_text":"","menu_content_text":"","single_tag":"0","optional_option":"0","image":""},"topic":{"id":"5","title":"Topic Link","desc":"This tag provides an easy way to link to a topic","tag":"topic","useoption":"1","example":"[topic=1]Click me![/topic]","switch_option":"0","menu_option_text":"Enter the topic ID","menu_content_text":"Enter the title for this link","single_tag":"0","optional_option":"0","image":""},"post":{"id":"6","title":"Post Link","desc":"This tag provides an easy way to link to a post.","tag":"post","useoption":"1","example":"[post=1]Click me![/post]","switch_option":"0","menu_option_text":"Enter the Post ID","menu_content_text":"Enter the title for this link","single_tag":"0","optional_option":"0","image":""},"spoiler":{"id":"7","title":"Spoiler","desc":"Spoiler tag","tag":"spoiler","useoption":"0","example":"[spoiler]Some hidden text[/spoiler]","switch_option":"0","menu_option_text":"","menu_content_text":"Enter the text to be masked","single_tag":"0","optional_option":"0","image":""},"acronym":{"id":"8","title":"Acronym","desc":"Allows you to make an acronym that will display a description when moused over","tag":"acronym","useoption":"1","example":"[acronym='Laugh Out Loud']lol[/acronym]","switch_option":"0","menu_option_text":"Enter the description for this acronym (EG: Laugh Out Loud)","menu_content_text":"Enter the acronym (EG: lol)","single_tag":"0","optional_option":"0","image":""},"hr":{"id":"12","title":"Horizontal Rule","desc":"Adds a horizontal rule to separate text","tag":"hr","useoption":"0","example":"[hr]","switch_option":"0","menu_option_text":"","menu_content_text":"","single_tag":"1","optional_option":"0","image":""},"php":{"id":"14","title":"PHP Code","desc":"Allows you to enter PHP code into a formatted/highlighted syntax box","tag":"php","useoption":"0","example":"[php]$variable = true;\n\nprint_r($variable);[/php]","switch_option":"0","menu_option_text":"","menu_content_text":"","single_tag":"0","optional_option":"0","image":""},"html":{"id":"15","title":"HTML Code","desc":"Allows you to enter formatted/syntax-highlighted HTML code","tag":"html","useoption":"0","example":"[html]\n \n[/html]","switch_option":"0","menu_option_text":"","menu_content_text":"","single_tag":"0","optional_option":"0","image":""},"sql":{"id":"16","title":"SQL Code","desc":"Allows you to enter formatted/syntax-highlighted SQL code","tag":"sql","useoption":"0","example":"[sql]SELECT p.*, t.* FROM posts p LEFT JOIN topics t ON t.tid=p.topic_id WHERE t.tid=7[/sql]","switch_option":"0","menu_option_text":"","menu_content_text":"","single_tag":"0","optional_option":"0","image":""},"xml":{"id":"17","title":"XML Code","desc":"Allows you to enter formatted/syntax-highlighted XML code","tag":"xml","useoption":"0","example":"[xml]3 Replies - 0 Views - Last Post: 6 minutes ago
#1
Reputation: 0
- Posts: 7
- Joined: 28-October 12
Posted 48 minutes ago
Hello everyone, I'm doing a project for my java class, but I've run into a problem with my code. There are 2 classes, but my problem resides in the RentalCarCompany class.Here is the Car class
public class Car { private String carRenter; //describe each var private int carNum; private String carName; private String carType; private int carDoor; private static double rate; private int days; /** *Default constructor for class Car, sets values to default of 0 or null. */ public Car() { carRenter = ""; carNum = 0; carName = ""; carType = ""; carDoor = 0; rate = 0.0; days = 0; } /** *Parameterized constructor for class Car, allows the parameters to be set to values other than null or 0. *@param renter The car renter *@param number The car number *@param name The car name *@param type The car type *@param door The number of doors on the car *@param initRate The rate the car is rented at *@param initDays The number of days the car is rented for */ public Car(String renter, int number, String name, String type, int door, double initRate, int initDays) { carRenter = renter; carNum = number; carName = name; carType = type; carDoor = door; rate = initRate; days = initDays; } /** *@return The car renter */ public String getCarRenter() { return carRenter; } /** *@return The car number */ public int getCarNum() { return carNum; } /** *@return The car name */ public String getCarName() { return carName; } /** *@return The car type */ public String getCarType() { return carType; } /** *@return The car's number of doors */ public int getCarDoor() { return carDoor; } /** *@return The rate the car is rented at */ public static double getCarRate() { return rate; } /** *@return The number of days the car is rented */ public int getNumOfDays() { return days; } /** *@param newRenter The new car renter */ public void setCarRenter(String newRenter) { newRenter = carRenter; } /** *@param newNum The new car number */ public void setCarNum(int newNum) { newNum = carNum; } /** *@param newName The new car name */ public void setCarName(String newName) { newName = carName; } /** *@param newType The new car type */ public void setCarType(String newType) { newType = carType; } /** *@param newDoor The new number of doors on the car */ public void setCarDoor(int newDoor) { newDoor = carDoor; } /** *@param newRate The new rate the car is rented at */ public void setCarRate(double newRate) { newRate = rate; } /** *@param newDays The new number of days the car is rented */ public void setNumOfDays(int newDays) { newDays = days; } //toString() method public String toString() { return("Car renter's name: " + getCarRenter() + "\n" + "Car number: " + getCarNum() + "\n" + "Car name: " + getCarName() + "\n" + "Car type: " + getCarType() + "\n" + "Car door: " + getCarDoor() + "\n" + "Rate: $" + getCarRate() + "\n" + "Rented for " + getNumOfDays() + "days"); } }
And the RentalCarCompany class
/** * *@author *@version 1.0 April 7th 2013 * */ public class RentalCarCompany { Car[] theCars; String name; int totalDays; double totalRate; int doorCount2; int doorCount4; int rentCnt; static final int NUM_CARS = 20; static final int NOT_FOUND = -1; public RentalCarCompany() { name = ""; totalDays = 0; totalRate = 0.0; doorCount2 = 0; doorCount4 = 0; rentCnt = 0; } public RentalCarCompany(String compName) { compName = name; theCars = new Car[NUM_CARS]; } public double getTotalSales() { double sum = 0.0; int i = 0; for (Car c: theCars) { for (i = 0; i <= c.getLength(theCars); i++) //this is where the error is thrown { sum = c.getCarRate() + sum; } }return sum; } public double getAvgDays() { } public double getAvgRate() { } public int get2DoorCount() { int count = 0; for (Car c: theCars) { if (c.getCarDoor() == 2) { count ++; } }return count; } public int get4DoorCount() { int count = 0; for (Car c: theCars) { if (c.getCarDoor() == 4) { count ++; } }return count; } public String printRentalList() { } }
The problem starts when I compile the RentalCarCompany class, it throws an error saying "cannot find symbol" it occurs on line 42.
I've tried looking through the API for Array, thinking it might be an error there. I've changed some things around which solved multiple errors I had before, but this one won't stop popping up. Its got me stumped! Any help is appreciated!
Is This A Good Question/Topic? 0
Replies To: "Cannot Find Symbol" Error, Stumped!
#2
Reputation: 2030
- Posts: 8,476
- Joined: 20-September 08
Re: "Cannot Find Symbol" Error, Stumped!
Posted 17 minutes ago
You needpublic double getTotalSales() { double sum = 0.0; for (Car c : theCars) { sum += c.getCarRate(); } return sum; }
#3
Reputation: 0
- Posts: 7
- Joined: 28-October 12
Re: "Cannot Find Symbol" Error, Stumped!
Posted 14 minutes ago
Thank you, that works! But, why does it work?
#4
Reputation: 2030
- Posts: 8,476
- Joined: 20-September 08
Re: "Cannot Find Symbol" Error, Stumped!
Posted 6 minutes ago
Well it removes the error of trying to treat the array in some odd way twice (that you were doing)
Page 1 of 1
Source: http://www.dreamincode.net/forums/topic/318506-cannot-find-symbol-error-stumped/
Comcast Pokemon X and Y Rob Ryan bethenny frankel sacramento kings alex jones Google Docs
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.