
User Input In C
Started by
Naga
, May 10 2012 02:12 PM
5 replies to this topic
#1
Posted 10 May 2012 - 02:12 PM
Hi,
Am trying to develop a mathematical program to calculate time when speed and distance are given.
How can I get user input ie, the distance and speed.
And then to calculate and display the results.
Please help.
Am trying to develop a mathematical program to calculate time when speed and distance are given.
How can I get user input ie, the distance and speed.
And then to calculate and display the results.
Please help.
#2
Posted 10 May 2012 - 02:40 PM
First of all, you will need revolutionFX. Secondly, you will need to put this at the top of your C program:
fxlib.h and revolution.h should be in the same folder as your C program.
About the string input:
I got some information from this page
Prototype:
Now, what you need to do is find out if the Casio SDK has atoi or an alternative. You are going to need to convert the string to ascii.
Your code will probably look like this:
I did not test that code, but it should give you an idea.
#include "fxlib.h" #include "revolution.h"
fxlib.h and revolution.h should be in the same folder as your C program.
About the string input:
I got some information from this page
Prototype:
int string_input(int x, int y, char string[]);
Now, what you need to do is find out if the Casio SDK has atoi or an alternative. You are going to need to convert the string to ascii.
Your code will probably look like this:
//include the revolutionFX libs #include "fxlib.h" #include "revolution.h" //Prototype the string_input function int string_input(int x, int y, char string[]); //Declare variables char string_[]; int A; int B; int ans; //main program int main () { Bdisp_AllClr_VRAM(); PrintXY (1, 1, "A:"); //That's PrizmSDK code... I don't know what Casio FX SDK has. Bdisp_PutDisp_DD(); string_input (4, 1, &string_); atoi (A, string); Bdisp_AllClr_VRAM(); PrintXY (1, 1, "B:"); Bdisp_PutDisp_DD(); string_input (4, 1, &string_); atoi (B, string); Bdisp_AllClr_VRAM(); ans = a + b; PrintXY (1,1,ans); Bdisp_PutDisp_DD(); //end program return 0 }
I did not test that code, but it should give you an idea.

#3
Posted 10 May 2012 - 08:33 PM
Hi,
Am trying to develop a mathematical program to calculate time when speed and distance are given.
How can I get user input ie, the distance and speed.
And then to calculate and display the results.
Please help.
What model are you developing for? The instructions may vary, depending on the model, and your host OS.
#4
Posted 10 May 2012 - 11:20 PM
What model are you developing for? The instructions may vary, depending on the model, and your host OS.
He's using the fx-9860GII.

#5
Posted 20 November 2012 - 11:30 PM
Hi there,
Is there any ready made C routine for casio SDK can be used to evaluate a formula in the string format, such as: (S^2+3)/((S^+1)*(S^2+10))?
Or is there any way to call the calculator's fn function?
Please help
Is there any ready made C routine for casio SDK can be used to evaluate a formula in the string format, such as: (S^2+3)/((S^+1)*(S^2+10))?
Or is there any way to call the calculator's fn function?
Please help
#6
Posted 20 November 2012 - 11:34 PM
I think revolutionfx can handle that, but i'm not entirely sure.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users