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...
Type: Posts; User: Magic staple
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...
Im sorry but I have trouble understanding your code.
#include <ctype.h>
#define MAX 10
void main (void);
void function1 (void);
void function2 (void)
{
FILE *in;
char var;
int lab [MAX];
int counter;
if (( in = fopen ("grades.txt", "r")) == NULL)
{
printf ("Error Opening File");
I set
#define MAX 8
I want to record the score of Lab 1 - 8.
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".
void function2 (void)
{
FILE *in;
char var;
int lab [MAX];
float test1, test2;
int i = 0;
if (( in = fopen ("grades.txt", "r")) == NULL)
{
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
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...
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...
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...
int getUserChoice ()
{
int x;
do
{
printf (" Choices [ r, p, s or q]");
scanf (" %c", &x);
but then how do I call those variables to the "playonegame" function?
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...
#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);
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'...
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...
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...
I have tons of warning but 1 actual failed.
return determineWinner(userChoice, computerChoice)
error: return value type does not match return function type.
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...
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"
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...
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.
...
I do not know how to call a function. Please help me.
#include <stdio.h>
int main (void)
{
float info;
info = getInfo ();