Search:

Type: Posts; User: Cameron Taylor

Page 1 of 3 1 2 3

Search: Search took 0.01 seconds.

  1. Ok, this works now: for (i = 0; i

    Ok, this works now:


    for (i = 0; i < MAXARRAY; i++){
    payment[i].emp_pay = payment[i].pay_rate * payment[i].hrs_worked;
    payment[i].gross_pay += payment[i].emp_pay;
    ...
  2. Ok, This works, but I am supposed to use 6...

    Ok, This works, but I am supposed to use 6 structures in the array so I can't do it lol. Just need to figure out how to make payment.gross_pay work.


    //Cameron Taylor

    #include <stdio.h>...
  3. Ok, I made a new double variable named "total"....

    Ok, I made a new double variable named "total". The net pay of all employees is supposed to be "gross_pay" and emp_pay is the individual employee pay. Their are no taxes being added to the equation,...
  4. Sorry for the long reply, had other stuff to work...

    Sorry for the long reply, had other stuff to work on (and got hungry). So I think I did everything you said, but I am still getting an issue with the "gross_sum" part of the array to show the gross...
  5. Gonna work from a more simple code for now. Worry...

    Gonna work from a more simple code for now. Worry about a sentinel and extras after I get the basics working. Right now, the program will continue, but it is printing out 0's for employee payment.
    ...
  6. Homework: 6 Structure Array For Emoployee Pay

    Ok, so this assignment is to create a structure that allows input for up to 6 employees that then makes a 6 structure array showing Employee ID, Employee Last Name, Employee Pay Rate, Employee Hours...
  7. Replies
    8
    Views
    1,029

    Heh, yea. Good analogy. Just sloppy work on my...

    Heh, yea. Good analogy. Just sloppy work on my part. Should of done a better job at "proof reading" my code before submitting it just because it worked.
  8. Replies
    8
    Views
    1,029

    Oh ok, so since extend() acts like a void...

    Oh ok, so since extend() acts like a void function it would of been proper to call it a void function. I believe what I was thinking is that it needed to be called "double" since the array amount[]...
  9. Replies
    8
    Views
    1,029

    Quick Question about Homework

    Ok, so I had an assignment due a few days ago and I typed it all up myself without any help (pretty proud of myself at the time), but my instructor took off 4 out of 20 points because I didn't make...
  10. I can try to implement that a little later (got...

    I can try to implement that a little later (got other homework to do), but here is my code so far with everything working as is.

    Thanks for all the help!


    //Cameron Taylor

    #include...
  11. Ok, I got leap year down (without do while loop...

    Ok, I got leap year down (without do while loop =P). Now to tackle 12/31/2013 - 01/01/2014


    //Cameron Taylor

    #include <stdio.h>

    struct Date{
    int month;
    int day;
  12. haha, I am not sure. Don't know if I wanna go...

    haha, I am not sure. Don't know if I wanna go that far with it yet.

    Though, I am thinking I need to do a "do-while" loop anyways in order to do one separate "if-else" chain for leap year and...
  13. Sorry, I missed the braces in the code provide...

    Sorry, I missed the braces in the code provide above. Thanks, I have been doing "for" statements so much in the last couple of weeks, I didn't think to not use it lol.

    Here is my code that works...
  14. Ok, this is my updated code hopefully with typos...

    Ok, this is my updated code hopefully with typos fixed and not using %*c to ignore the '/'s'. Though it is still sticking after date input.


    //Cameron Taylor

    #include <stdio.h>

    struct...
  15. Yea, I just realize that right as you posted lol....

    Yea, I just realize that right as you posted lol.

    Meant for it to be mm/dd/yyyy. Didn't catch the "==" though, rookie mistake.

    updating code now.
  16. Homework: Finding Next Day Using Structures

    Ok, for my Sunday homework :frown: I have to find the next day of the year using structures. Now, I can get the structure to read the entered date (tested that with a simple scanf to printf entered...
  17. Thanks for this line! mpg = ((double)...

    Thanks for this line!



    mpg = ((double) total_mil) / total_gal;

    New output all working.

    lol, it is perfectly aligned in my txt document. Guess I can't win with pasting it. Even when using...
  18. Ok, I figured it out. It was because in the input...

    Ok, I figured it out. It was because in the input file I separated the numbers with tab instead of just a space. Been tweaking it a bit more and this is what i got so far.


    #include <stdio.h>
    ...
  19. #include int main() { FILE...

    #include <stdio.h>

    int main()
    {
    FILE *infile,*outfile;
    double car_num, miles, gallons;
    double total_gal = 0, total_mil = 0, i;
    double mph = 0;

    ...
  20. This is my output from GCC I have used -w...

    This is my output from GCC



    I have used -w and -Wall and their are no errors the compiler can find.
  21. Homework: Read and Print to file - Am I oversimplifying?

    Ok, I think I got the main idea of the I/O chapter. Though I think I might be oversimplifying the program because I am getting an interesting error.

    Goal here is to read numbers from a file and...
  22. This way was too hard... so I decided to use...

    This way was too hard... so I decided to use tokens =P


    //Cameron Taylor

    #include <stdio.h>
    #include <string.h>

    int main (){
  23. Should of said "string" in title

    Should of said "string" in title
  24. Homework: Reversing an Array - FirstName Lastname, to LastName FirstName

    Ok, the first assignment was to make a program that just printed an input backwards. Got that, but when it comes to taking what you got from the backwards function to only switching the words back...
  25. Why this: fprintf(stdout, "\t%d\t%d\n",...

    Why this:

    fprintf(stdout, "\t%d\t%d\n", unsorted[i], sortedArray[i]);

    Why use fprintf and stdout instead of just a normal printf("%d %d", unsorted[i], sortedArray[i]);
Results 1 to 25 of 70
Page 1 of 3 1 2 3