I need help with this problem!
I can't get all three to display.
Write a program that prompts a user to enter their hourly pay and rate. Understanding that "time and a half" applies to hours in excess of forty, calculate and print the user's regular pay, overtime pay, and total pay for the week.
Shianne_1 0 Newbie Poster
rproffitt 2,662 "Nothing to see here." Moderator
Shianne_1 0 Newbie Poster
Fifth Horseman commented: The regular pay is never displayed when you have overtime pay because of the if/else block you've used. To fix, just remove the if/else statements +0
rproffitt 2,662 "Nothing to see here." Moderator
Reverend Jim 4,968 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster
Shianne_1 0 Newbie Poster
Reverend Jim 4,968 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster
Shianne_1 commented: I understand that. I can't get the code to behave correctly that's what I need help with. +0
Shianne_1 0 Newbie Poster
Fifth Horseman commented: Rprofitt is correct, the code does what you told it to. You seem to misunderstand what the if/else statements do. +0
Reverend Jim 4,968 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster
toneewa 81 Junior Poster in Training
Reverend Jim commented: You are not helping by writing the code for them. -3
Reverend Jim 4,968 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster
rproffitt commented: They learn when the teacher does a web search. Also, I didn't write it and gave attribution. It's a wonder why folk want code that is on the web. +16
Shianne_1 commented: I learned what I needed. I am I visual learner. I need to see the code so I could evaluate it and understand the difference between mine and this. +0
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.