• Post Reply Bookmark Topic Watch Topic
  • New Topic

adding bill, tax and tip  RSS feed

 
Adrian Martinez
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone,

i'm trying to make a simple program that will show the amount of a bill, the tip, tax and total with all 3 added.

Right now i am having issues with line 12. I am getting the error "Variable amount might not have been initialized

I thought i did initialized it.

Any help is welcome.

thank you

 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where do you think it is being initialized? It seems some of the lines are out of order.
 
Charles D. Ward
Ranch Hand
Posts: 99
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf beat me to it.

You are adding tax + amount on line 12, but what value does amount have at that point?
 
Adrian Martinez
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I see what you saying, i'm not giving any value to the amount.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!