My project is I have to write a program that reads out an employee’s first name, last name, their hours worked, their pay rate, and overtime hours. Along with calculating the gross pay of each employee. I just need help understanding what I’m doing wrong, so I put a copy of my code on this post https://docs.google.com/document/d/e/2PACX-1vRaGgzfbG9mxAEWt1HYwLUmiT4PVp6QX-KynyJcrQ_MNcuyZkNPL5eLsYvAzKdOVzIJzD97Z9rbqis8/pub
You did not put your code in a Google document, oh my.
EDIT:
Firstly consider using hastebin, pastebin or github gist to quickly share code and not Google docs.
Secondly, your if statements don’t do anything because they’re terminated with a semicolon everytime.
Thirdly, you’re comparing an integer payrate to a string right after assigning it and even if it was the number alone that would be a float not an int.
Don’t count on us doing it for you, half of the code is missing, and we won’t paste it in for you. I feel like you’re missing a core understanding of programming and/or variable types and you should start by going though some tutorials tailored for C# that explain the primitive types.
The hell is that suppose to mean?
Great start, but 1) why do you ask for the full name and 2) why are you testing for certain names – and doing nothing if the test is satisfied?
I’m pretty much a dumbass when it comes to c#. Doesn’t help where everywhere I look doesn’t tell me how to fix my problem, but gives either the definition of an error or other people’s problems. This subreddit is probably gonna be the only place I’ll get something useful to help me
https://pastebin.com/ndgEbdqn
Dumbed down code, with many repetitions. Hope it helps.
Uh, thanks. I was just asking for pointers in the right direction, but I’ll first learn all this stuff, then look at your stuff
First, when you say read out, do you already have the data or do you need to first get the data? I would say create a class with properties of employee, and function to calculate the pay.
Once that’s done, you can manually create a list or get the input from console to create a list of employees.
For output, you can basically loop through the list and print the corresponding properties.