^^You're absolutely right, man. But if you read the bottom of my post, you would see that I was trying to explain the way I was approaching the problem..and maybe someone more experienced could show...
Type: Posts; User: 3MGFX
^^You're absolutely right, man. But if you read the bottom of my post, you would see that I was trying to explain the way I was approaching the problem..and maybe someone more experienced could show...
I can't figure out why I'm getting a bus error here..
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void RecursivePermute(char jumble[], int k, char * words[], int...
I just understood what you meant, and I set both variables equal to 0.
But I'm not sure if it is printing the correct information still..
double array[6], temp, temp2, numrevs, gas; ..?
..unless there is something else I need to do.
/* Definition libraries. */
#include <stdio.h>
#include <stdlib.h>
/* Defines constants. */
#define PI 3.14159
#define INCHES_IN_FEET 12
#define FEET_IN_MILE 5280
/* Initializes functions....
This code doesn't seem to be looping properly because it doesn't store the correct array values (in fact, the values are all set to 0 in the end). And I can't figure out why for the life of me..
...
case 11:
for(i = 0; i < stock_num; i++)
total_price += (input_item_stock[i]) * (input_unit_price[i]);
printf("Total price of all the items: $%.2f\n\n", total_price);
...
case 8:
printf("Items to be reordered\n\n");
for (i = 0; i < stock_num; i++)
if(input_item_stock[i] < MIN_STOCK_LEVEL)
printf(" %d\n",...
I have a few more questions...
case 8:
printf("Items to be reordered\n\n");
/* for(i = 0; i < stock_num; i++)
fscanf(ifp, "%d%",...
Thanks alot Adak!
I tried something like this earlier since I figured the function printCurrentStatus() was facilitating most of my problems, but I didn't think of creating a new variable to...
#include <stdio.h>
#include <stdlib.h>
#define MAX_TBL_SIZE 30
void printCurrentStatus(int input_item_id[MAX_TBL_SIZE], int input_item_stock[MAX_TBL_SIZE], float...
#include <stdio.h>
#include <stdlib.h>
#define MAX_STRING_SIZE 20
#define MAX_TBL_SIZE 30
void printCurrentStatus(int input_item_id[MAX_TBL_SIZE], int input_item_stock[MAX_TBL_SIZE], float...
#include <stdio.h>
#include <stdlib.h>
#define MAX_STRING_SIZE 20
#define MAX_TBL_SIZE 30
void printCurrentStatus(int input_item_id[MAX_TBL_SIZE], int input_item_stock[MAX_TBL_SIZE], float...
Ok, I'm definitely making progress, and I pretty much understand how my entire program works as of now..
Here is what I have coded:
#include <stdio.h>
#include <stdlib.h>
Hi Board,
I am aware of the thread that already exists on this subject, but it hasn't been able to help me with the problems that I am experiencing. Thus, I decided to create a thread of my own....
I finally figured out the solution, yes!
Thanks for all the help!
- Hugh
I'm not really understanding what you're talking about, but I'm trying..
Ok, the break statement allows 'N' and 'n' to call the reportSummary() function properly. So that's good..
However,...
Still isn't working..
Here is my most recent code:
#include <stdio.h>
#include <stdlib.h>
void welcome();
void processOneStudent();
Fair enough.
Now how do I incorporate that into my program so that it works properly? I posted my attempt above, and it's pretty close to what I want, but then it exits unexpectedly again..
any...
printf("more students (Y or N)? ");
scanf("%c", &moreStudents);
while ((moreStudents == 'Y')||(moreStudents == 'y')) {
numStudents = numStudents + 1;
processOneStudent();
...
Can you explain how to use this code? And what is an infinite loop?
I also realized that I don't need to declare " moreStudents = 'Y' " since it returns the same result, which is why I chose not to include it in my revised code.
Note: Actually, this declaration...
Ok.
This is what I have now:
printf("more students (Y or N)? ");
scanf("%c", &moreStudents);
while ((moreStudents == 'Y')||(moreStudents == 'y')) {
numStudents = numStudents + 1;
This is what I get with my original code:
more students (Y or N)? y
Enter student id, class, cum. hours, cum. GPA: 1001 2005 10 3.30
Hours and grade (0 0 to end)? 4 4
Hours and grade (0 0 to...
I'm still not understanding how to write the while loop that everyone is suggesting. My objective is to repeat the "more students (Y or N)?" script and continue processing more students until the...