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...
Type: Posts; User: JSM
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...
(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...
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...
Does this code make sense now as far as the logic goes?
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
//prototypes (function announcement)
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...
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...
Thank you. Here is my updated code:
//preprocessor
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
//prototypes (function announcement)
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...
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 ...
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...
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...
Good point. I was just trying to imitate another program out of my textbook and they always test if actually closed.
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...
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?...
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...
Thanks guys. It was a question on a quiz that I missed.
How is truncation different from loss of precision? They seem like pretty much the same thing to me.
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.
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...