Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Programming help =*(
#1
Reply
#2
taxed is an integer. You try to assign it a double-value. Try taxed = (int) grossPay * 0.15;, or change taxed to a float value/double.
Reply
#3
Devil's Sunrise Wrote:taxed is an integer. You try to assign it a double-value. Try taxed = (int) grossPay * 0.15;, or change taxed to a float value/double.

tyty =D. I just changed the grossPay , taxed, and net to float rather than int, and i worked just fine. I'm here doin homework for the next 5 hours til class starts so I might have some more questions lol Excellent
Reply
#4
Offtopic remark (since there's no unanswered question as of now): I like how PHP syntax highlighting actually kind of works on C.
Reply
#5
Well I'm in class now so the teacher is answering the stuff that's confusing me, and yah the PHP is very nice Biggrin

Like we had to write a program that asks a user to input how many miles they drove, and how much gas they used. It would then calculate their MPG. Then it asked them the same question, and the user could repeat it as much as they want. After the user types -1, it calculates their average MPG. It was easy to continually ask for miles travelled, gas used, and spit out an MPG, trying to type code for tallying all the MPGs together and calculating the average was pretty tricky though.

Anyone good with RNG programs? I need to write a program that lists a bunch of random numbers between 1 and 50 depending on what number the user inputs. zzzzzzzzzz, I can't figure out how to friggen start the RNG
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)