3 Replies - 242 Views - Last Post: 29 April 2019 - 09:42 PM Rate Topic: -----

#1 TeresaMartinez   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 29-April 19

GUI Application movie theater concession stand

Posted 29 April 2019 - 07:07 PM

Not sure why I keep getting an error in my code. I've tried changing things and adding more things, but it is just not working.
Is This A Good Question/Topic? 0
  • +

Replies To: GUI Application movie theater concession stand

#2 TeresaMartinez   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 29-April 19

Re: GUI Application movie theater concession stand

Posted 29 April 2019 - 07:15 PM

public double getConcessionItemCost()
            {
                double getConcessionItemCost = 0.0;
                
                if (sodaSmall.isSelected())
                      concessionItemCost += SODA_SMALL;
                if (sodaMedium.isSelected())
                      concessionItemCost += SODA_MEDIUM;
                if (sodaLarge.isSelected())
                      concessionItemCost += SODA_LARGE;
                if (water.isSelected())
                      concessionItemCost += WATER;
                if (icee.isSelected())
                      concessionItemCost += ICEE;
                if (juice.isSelected())
                      concessionItemCost += JUICE;
                if (pizza.isSelected())
                      concessionItemCost += PIZZA;
                if (hotDogs.isSelected())
                      concessionItemCost += HOT_DOGS;
                if (chickenTenders.isSelected())
                      concessionItemCost += CHICKEN_TENDERS;
                if (pretzels.isSelected())
                      concessionItemCost += PRETZELS;
                if (nachos.isSelected())
                      concessionItemCost += NACHOS;



it keeps saying the concessionItemCost is not working in my code.
Was This Post Helpful? 0
  • +
  • -

#3 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 14995
  • View blog
  • Posts: 59,872
  • Joined: 12-June 08

Re: GUI Application movie theater concession stand

Posted 29 April 2019 - 08:38 PM

Please copy/paste the full error message here.

What is concessionItemCost ?
Was This Post Helpful? 0
  • +
  • -

#4 andrewsw   User is offline

  • quantum multiprover
  • member icon

Reputation: 6792
  • View blog
  • Posts: 28,050
  • Joined: 12-December 12

Re: GUI Application movie theater concession stand

Posted 29 April 2019 - 09:42 PM

It is not a good idea to name a variable the same as its containing method.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1