i figured it out, thanks though. preciate all the help!
Type: Posts; User: pmooney12
i figured it out, thanks though. preciate all the help!
thats the compiler we have to submit our work too. ive made the changes and still no luck
ok here is my program
#include <stdio.h>
#include <math.h>
float calculateCharges(float);
const int NUMBER_OF_CARS= 8;
main()
sorry but i think im confused on which int i you are telling me to delete
ok so i made a few tweaks and my table is set up correctly but my calculations are wrong this is what i got
Enter the hours for car 1:4
Enter the hours for car 2:5
Enter the hours for car...
yeah thats how i have mine, but as far as printing the table, is this how my loop is suppose to look?
for(i=0, i<NUMBER_OF_CARS; i++){
printf("CARS\t\tHOURS\t\tCHARGES");...
this is what my code is suppose to print out
Enter the hours for car 1:
Enter the hours for car 2:
Enter the hours for car 3:
Enter the hours for car 4:
Enter the hours for car 5:
Enter...
yeah it asks the user for the hours of each of the 8 cars and then after that it calculates the charges based on the amount of hours entered, and then it prints a table that lists each car, the hours...
i know that in order to total them i need to do:
totalHours= totalHours + hours
charges[i]= calculateCharges(hours)
totalCharges= totalCharges + charges[i]
but how exactly do i get each value...
ok great! thats working now. so now my next problem is that i need the hours totaled and the charges totaled, which i have a function to calculate the charges, but as far as getting them all totaled...
this is what my code is suppose to print out
Enter the hours for car 1:
Enter the hours for car 2:
Enter the hours for car 3:
Enter the hours for car 4:
Enter the hours for car 5:
Enter...
i am an extreme beginner so i know you probably feel like youre trying to teach a brick wall but i promise i really am trying to do this on my own. its just all another language to me
whenever i put the return 0 at the end of my function, it just makes the loop stop after one time through
maybe im just an idiot but i didnt see how to implement that too my loop
sorry if im getting agitated, ive been working on this thing for about a week now.
this is my for loop
#include <stdio.h>
#include <math.h>
float calculateCharges(float);
const int...
ha im not trying to be a programmer, its just a class required for my major. As i said earlier my program compiles but it doesnt actually loop through the for loop, it just goes through one time and...
once again, beginner here just asking for help. im the one who has written this code, its not like i had someone do it for me, so you can either fulfill the purpose of the thread and help or just not...
any idea why?
apparently there is something wrong with my for loop; it compiles but after it asks for the hours for car 1 it asks for the rest of the cars but just assumes 0 and jumps to the end
#include <stdio.h>
#include <math.h>
float calculateCharges(float);
const int NUMBER_OF_CARS= 8;
main()
{
int cars[NUMBER_OF_CARS]= {1,2,3,4,5,6,7,8};
float charges[NUMBER_OF_CARS];
ok so is there anyone on this board that will actually answer my questions with a helpful answer instead of a smart one? i am very new to c programming so smart remarks really just dont help. nobody...
ok so here is my program now
#include <stdio.h>
#include <math.h>
float calculateCharges(float);
const int NUMBER_OF_CARS= 8;
main()
how does this look? or is it totally off?
#include <stdio.h>
#include <math.h>
float calculateCharges(float);
const int NUMBER_OF_CARS= 8;
main()
anybody?
and how do i total all of the 8 inputs for hours?