Search:

Type: Posts; User: JSM

Search: Search took 0.01 seconds.

  1. Replies
    25
    Views
    3,336

    Here's my code with functions, however I don't...

    Here's my code with functions, however I don't understand what to do with the if...else stuff so I left that the same...What else can I do besides determine every possible path?


    //prototypes...
  2. Replies
    25
    Views
    3,336

    (A&&D)&&(C&&E) and (B&&D)&&(C&&E) were two other...

    (A&&D)&&(C&&E) and (B&&D)&&(C&&E) were two other paths I thought it could take. || is for parallel, and && is for series. I changed the && in the middle to || because AD is i parallel with CE and...
  3. Replies
    25
    Views
    3,336

    Ok, so I am supposed to be getting something...

    Ok, so I am supposed to be getting something closer to 94? I was getting around 80%...I'm not sure how close it's supposed to be to 94.



    I added other paths, the reliability is better, but do I...
  4. Replies
    25
    Views
    3,336

    Does this code make sense now as far as the logic...

    Does this code make sense now as far as the logic goes?



    #include <stdio.h>
    #include <stdlib.h>
    #include <time.h>

    //prototypes (function announcement)
  5. Replies
    25
    Views
    3,336

    The higher one was calculated with taking into...

    The higher one was calculated with taking into account which components were in parallel and which were in series. In the program I'm writing now, they're all just together...I don't understand how...
  6. Replies
    25
    Views
    3,336

    So as long as the random number is less than all...

    So as long as the random number is less than all of the values given, it's a success regardless of whether or not it's in series or parallel? I'm getting around 30% reliability. When I calculated...
  7. Replies
    25
    Views
    3,336

    Thank you. Here is my updated code: ...

    Thank you. Here is my updated code:



    //preprocessor
    #include <stdio.h>
    #include <stdlib.h>
    #include <time.h>

    //prototypes (function announcement)
  8. Replies
    25
    Views
    3,336

    Reliability With Random numbers.

    Write a program to test the circuit reliability with random numbers as many times as the user requests.:confused:
    The circuit: I can't figure out how to get the attachment to work so here's my best...
  9. Replies
    3
    Views
    1,479

    Please Help ASAP!!! Calculation error!

    Can someone PLEASE help me with fixing this. Something is wrong with how the strikes are being added, it seems to just add 10. The numbers in the file are: 8 1 9 1 7 2 10 8 2 6 2 7 3 10 10 ...
  10. Replies
    2
    Views
    3,702

    I made your suggested changes, and I'm getting...

    I made your suggested changes, and I'm getting exactly the same output :/ I think something is wrong with the index, but not sure what because it seems to add the next number to the previous number...
  11. Replies
    2
    Views
    3,702

    Bowling Scores Using Arrays

    Hello, I need to read integers from a text file and store them in an array. Each integer represents the score for a single ball in a game of bowling. I have been able to read and store the integers...
  12. Replies
    6
    Views
    8,535

    Good point. I was just trying to imitate another...

    Good point. I was just trying to imitate another program out of my textbook and they always test if actually closed.
  13. Replies
    6
    Views
    8,535

    closing

    So I have figured out the reading and writing! However, do I need to close both files? When I run my code as shown below, the message "Error closing file comes up", but if I take out the close1...
  14. Replies
    6
    Views
    8,535

    I see why it's breaking out of the loop now. I'm...

    I see why it's breaking out of the loop now. I'm not too sure what you're talking about using a char buffer though. Is there a function I can use that will just read the numbers and whitespaces?...
  15. Replies
    6
    Views
    8,535

    Reading & Writing Integers from a txt file

    I'm trying to read the integers out of a text file called lane9.txt separated by a space which looks like this (I'm printing them first to see if the numbers are correct):

    8 split 1 9 1 spare 7 2...
  16. Thread: Truncation

    by JSM
    Replies
    5
    Views
    2,816

    Thanks guys. It was a question on a quiz that I...

    Thanks guys. It was a question on a quiz that I missed.
  17. Thread: Truncation

    by JSM
    Replies
    5
    Views
    2,816

    Truncation

    How is truncation different from loss of precision? They seem like pretty much the same thing to me.
  18. Thread: loops

    by JSM
    Replies
    3
    Views
    882

    Ok, I see that I didn't have the %f in there, I...

    Ok, I see that I didn't have the %f in there, I changed the statement to this and it still doesn't work



    printf("Sum: %f", *sum);


    I also tried it without the *, that didn't work either.
  19. Thread: loops

    by JSM
    Replies
    3
    Views
    882

    loops

    I'm trying to calculate the average of numbers. In order to do so, I need to get the sum of all the numbers entered. I can't figure out why I'm getting a run-time error. It's counting the number...
Results 1 to 19 of 19