I'm so close to being done with my code for this one but my function is only retuning 2.000. I really wrapped my brain around this one and can't seem to figure out why it won't work.
Any thoughts?...
Type: Posts; User: Extropian
I'm so close to being done with my code for this one but my function is only retuning 2.000. I really wrapped my brain around this one and can't seem to figure out why it won't work.
Any thoughts?...
Thank you very much tonto I'm sure this will help, I'll compare your code to mine and see if I can fix it.
The only difference is it shoud only output:
Car Hours Charge
0 ...
Comments like thisdont help me, note the rules:
"Keep in mind that being helpful does not give license to be rude."
I normally wouldn't care but I get this all the time...
To the people...
Just wondered if this will put the titles in tabular format:
printf("%13s%13s%13s\n", "Car", "Hours", "Charge");
if not, what's wrong with it?
thanks,
Extro
Thanks, that ssemed to work but now I have the error:
too few arguments to function 'calculateCharges'
printf("%13d%13%13f\n," , car, stay , calculateCharges(charge) );
Thank for all the...
Ok I foxed that but now 'stay' is undeclared. Can I carry it over into the function somehow?
I got some working code but I'm getting a syntax error right at the end, any thoughts onw aht could be wrong would be a big help
Thanks,
Extro
include<stdio.h>
float calculateCharges...
I wanted it to be car <=3 but it says operator has no effect(on the stay argument too):
int stay;
int car = 0;
float charge;
I'm getting three or four errors in thi sone statement...?? I can't for the life of me see what they could be.
int stay;
int car = 0;
float charge;
Thank you
Yup, didnt work, just wondered if I can out an if statement in a user-defined function
Thanks,
Extro
Can I put if statements in a user defined function?
(You just know more questions about this assignment will be coming...hehe) ;)
Thanks,
Extro
Well I got it to work with fflush(stdin) and so I think it's best to leave well enough alone. Also, I dont wanna get too much into into c commands and functions we havent covered or he(my teacher)...
I got it to work! here's the code:
#include <stdio.h>
int main()
{
char pay;
float salary_1;
I appreciate the help but being a first year student I haven't yet been taught things like fflush so IU'm not sure how to work with it. I went with a do...while and I'm still getting
Please enter...
Ok I fixed the code up a bit but its still not asking for another code, its just waiting for one. How do I get it to ask again?
Thanks for all the help.
#include <stdio.h>
int main()
{
I still don't understand why 'Please enter a paycode(Enter -1 to end): ' would come up twice one immediately following the other when its done the first case, like this:
Please enter a paycode(Enter...
Ok here's the working code I have a couple of questions about:
#include <stdio.h>
int main()
{
ok cool, thanks - but I still have a logic error. Here's the code.
the problem is in case 2:
#include <stdio.h>
int main()
{
here's the code(roughly of course), wondered if it can be done:
Case ‘2’:
/*Find hourly workers salary */
Printf “Please enter hours worked”
Scanf(%d, &hours)
Printf (“Please enter...
Gnu indent?
lol, ya lost me... :confused:
I got it to work but any feedback is appreciated -can I make it better?(constructive criticism welcome).
Regards,
Extro
int num1, num2;
int integers; /* How many numbers the user...
A quick question:
Normally I've seen that the programmer sets the loops control variable for a for statement. How does one get the user to set it?
Thanks,
Extro
Cool, got the code to work:
#include <stdio.h>
int main()
{
float balance, charges, credit, limit;
Ya I did and it almost works, if I use a -1 right away it runs throough one more time, whwn it should just end it. Here's the changed code:
#include <stdio.h>
int main()
{
float...