yes :)
Type: Posts; User: quintenmater
yes :)
The numbers aren't changing now when I recompile. I'm getting the same results each time. Any reason?
#include <stdio.h>
#include <stdlib.h>
int main(void){
int numHeadsThisTime,...
Thanks I made those changes but what does printf("%2d: "); do
It works- just wondering why its only printing 999 trials. New code:
#include <stdio.h>
#include <stdlib.h>
int main(void){
int numHeadsThisTime, trialNumber, flipNumber, flips[11];
...
Sorry, not meaning to leave a bunch of comments just slowly figuring things out. Why doesn't the following program work:
#include <stdio.h>
#include <stdlib.h>
int main(void){
int...
Ahhh- flips[numHeadsThisTime]++ increments the occurrences into the arrays doesnt it? now I just need to figure out how to print out what is within each array but only one star for each ten...
This is what I am having a hard time wrapping my head around: each trial has ten flips of the coin and the number of heads that come up store into "numHeadsThisTime." How do I then take that number...
Is "i" "flipNumber" here or are these two new loops?
Is flips[i] supposed to be flips[flipNumber]?
I've got the following so far but am sort of confused what I am doing with the "flips[numHeadsThisTime]++" and really confused how I am supposed to print this out.
#include <stdio.h>...
I have a project for school in which I have to write a program based on probability where a "coin" is flipped 10,000 times. The 10,000 flips are divided into 1,000 trials of 10 flips each. I'm stuck...
Also, could I condense the first two switch statements? like switch(value1&&value2)??
I'm now trying to do the extra credit : Make the program loop, asking for input and processing the operators and operands entered. (Hint:
You may need to become familiar with the flush ( ) function,...
I had that for Case O before, but now that I have changed it back AND made the value1 and 2 switch- it is now working! THANKS!
I'm still getting "true" for everything with the following code. Also, how is F being treated as an integer? I have all my variables initialized as chars...
#include <stdio.h>
#include...
In the following program, why when I type in "FOF" does it result to "true"? When should I use "=="?
#include <stdlib.h>
int main (void){
char value1, value2, loperator;
char result;
lol nvm guess I was supposed to read those in as an integer when I print in the switch function
Why is this program printing smiley faces instead of a 1 or 0???
#include <stdio.h>
#include <stdlib.h>
int main (void){
char value1;
char value2;
So then there is no right or wrong answer to some of them? Like 1||0 can be 1 or 0?? And what about 1 AND 0???
I have a project to make a logic calculator like the one described below, but it literally doesn't make "logic" sense to me. I'm sure I won't have a problem programming it once I know what the hell...
For "b. What code got generated to return the result of the function to main?"
Am I getting warmer or colder by stating "The value is stored by a function in the eax register which is taken to be...
Nevermind, I figured this out on my own. I'm proud of myself :)
meh- I don't know its the only instruction after "return z;" Am I looking in the wrong place? Since the result would be in the z=x+y then should I be looking at the instructions under it: movsx eax,...
More like this? 3/4 is better than I anticipated but would be nice to get them all right, lol.
a. What machine instruction is used to actually invoke (run, transfer control to) your function?...
K got this to work with "int theImageArray[MAX_HEIGHT][MAX_WIDTH];" as global. Now that I have that working, I have to find some code to manipulate the brightness outcome of the image. I am looking...
This is my third project in this class involving having to identify what machine instruction is doing what, and I just want to see if I'm doing it right or wrong because that would suck to get three...