Search:

Type: Posts; User: Magic staple

Search: Search took 0.00 seconds.

  1. Replies
    13
    Views
    5,151

    sorry, there are still error that I do not know...

    sorry, there are still error that I do not know how to fix.

    (58): error c2446" '!=' : no conversion from 'int' to 'char *'
    (58): error c2040: '!=' : 'char *' differs in levels of indirection from...
  2. Replies
    13
    Views
    5,151

    Im sorry but I have trouble understanding your...

    Im sorry but I have trouble understanding your code.



    #include <ctype.h>
    #define MAX 10


    void main (void);
    void function1 (void);
  3. Replies
    13
    Views
    5,151

    void function2 (void) { FILE *in; char...

    void function2 (void)
    {
    FILE *in;
    char var;
    int lab [MAX];
    int counter;

    if (( in = fopen ("grades.txt", "r")) == NULL)
    {
    printf ("Error Opening File");
  4. Replies
    13
    Views
    5,151

    I set #define MAX 8 I want to record the...

    I set

    #define MAX 8


    I want to record the score of Lab 1 - 8.
  5. Replies
    13
    Views
    5,151

    Hello, thanks for responding. I did as you...

    Hello, thanks for responding.

    I did as you suggested but the result is still not what I wanted.

    it printed "-858993460" but I wanted it to print "10".
  6. Replies
    13
    Views
    5,151

    Reading from File and Storing into Array

    void function2 (void)
    {
    FILE *in;
    char var;
    int lab [MAX];
    float test1, test2;
    int i = 0;

    if (( in = fopen ("grades.txt", "r")) == NULL)
    {
  7. Listing Scores in descending order, by using the selection sort

    Hello. This is what in my .txt document.



    Lab 1: 10
    Lab 2: 18
    Lab 3: 22
    Lab 4: 19
    Lab 5: 14
    Lab 6: 16
  8. Replies
    2
    Views
    1,359

    Help with calculating student GPA

    This is what I have right now, I need it to calculate and print the gpa but I have no clue on how to do it.

    The text document I am using has the following in it:
    Intro to Programming in...
  9. Replies
    1
    Views
    706

    Questions relating to FILE I/O

    Trying to open file and get it calculate and print gpa and class.

    1) Should I make getinfo process both print to file and print to screen?

    2) How do I open the file, read the file and put data...
  10. Okay the program runs without crashing however...

    Okay the program runs without crashing however the output is not what I want it to be.

    I want it to be similar to:
    ""Rock paper scissors or quit?
    p
    You have chosen Paper
    The...
  11. int getUserChoice () { int x; do ...

    int getUserChoice ()
    {
    int x;

    do
    {

    printf (" Choices [ r, p, s or q]");
    scanf (" %c", &x);
  12. but then how do I call those variables to the...

    but then how do I call those variables to the "playonegame" function?
  13. to be honest, I don't know. What I think is...

    to be honest, I don't know.

    What I think is that I gave the variable "x" and "y" space to store data in but I never stored any data in it. So it is filled with garbage data? But like I said, I...
  14. #include #include #include...

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

    #define QUIT 0

    void printRule(void);
    int playGame(void);
    char getUserChoice (char x);
  15. I am now getting new sets of error: (110):...

    I am now getting new sets of error:

    (110): warning C4244: 'function' : conversion from 'time_t' to 'unsigned int', possible loss of data

    (59): warning C4700: uninitialized local variable 'x'...
  16. Sorry. Here are the errors again with the line...

    Sorry. Here are the errors again with the line numbers
    (32): warning C4013: 'playOneGame' undefined; assuming extern returning int
    (35): warning C4996: 'scanf': This function or variable may be...
  17. I changed determinewinner from void to char, it...

    I changed determinewinner from void to char, it got rid of underlined but..

    warning C4067: unexpected tokens following preprocessor directive - expected a newline
    warning C4067: unexpected tokens...
  18. I have tons of warning but 1 actual failed. ...

    I have tons of warning but 1 actual failed.


    return determineWinner(userChoice, computerChoice)

    error: return value type does not match return function type.
  19. Please help me create a Rock, Paper, Scissor rock game. Thanks!

    This is what I have so far, I am completely lost right now.



    // Lab 6: rock paper scissors game


    // defined constants can make the program easier to read
    // Are there other defined...
  20. Replies
    2
    Views
    878

    Ah, thank you very helping a newbie out :} It...

    Ah, thank you very helping a newbie out :}

    It is set up so that any answer other than "y" or "Y" will be taken as a "n"
  21. Replies
    2
    Views
    878

    Please Help Me With This C Program!

    I want my program to give a similar output like this if total > 0:

    Welcome to the CIS 15AG Pizza Shack
    Pizza slice - $2.50 [y/n]? y
    Salad - $1.50 [y/n]? N
    Drink - $1.00 [y/n]? y
    Your total...
  22. Sorry, I thought I could figure out what I was...

    Sorry, I thought I could figure out what I was trying to do if I solved that part but I am still stuck.

    My goal is to create a program that will compute interest rates using functions.



    ...
  23. Help Please, just started learning C programming

    I do not know how to call a function. Please help me.


    #include <stdio.h>
    int main (void)
    {
    float info;

    info = getInfo ();
Results 1 to 23 of 23