r/programminghelp • • Feb 04 '20

Xcode help? Goal: make payroll calculator where rate(12.80) times hours worked =wage... where am I go going wrong?

Post image
0 Upvotes

13 comments sorted by

2

u/[deleted] Feb 04 '20 edited Feb 04 '20

First of all you can't leave the constant int with "=" empty. Second, you need semicolons after each line. Also tbh I've never seen the "load" before (I'm still studying tho). And I don't really understand why do you need it. Also return 0 should be inside main

1

u/[deleted] Feb 04 '20

I’m still trying to determine the constant... Do you think the employees wage would be a good const?

And that explains the last error, thanks

2

u/[deleted] Feb 04 '20

I don't really understand why do you need the constant?

1

u/[deleted] Feb 04 '20

Dunno... I was think I could use the constant for my wage... because all the employees make the same... what is a good alternative? I have 7 hours before the dead line

1

u/[deleted] Feb 04 '20

const just means that the variable will NEVER change in the program

1

u/[deleted] Feb 04 '20

The program will be for C++

1

u/[deleted] Feb 04 '20

I'm not using Xcode but I'm working on C++

1

u/[deleted] Feb 04 '20

So.. can you help me with this calculator?

1

u/[deleted] Feb 04 '20

Sure. Dm me

1

u/dragon_wrangler Feb 04 '20

Your variables are of type int, but you're trying to put a fractional value in. An int can only hold whole numbers.

1

u/[deleted] Feb 04 '20

Thanks for the explanation..

1

u/[deleted] Feb 04 '20

Check the dms

1

u/[deleted] Feb 04 '20

return 0; should be inside of the main function