Solved

Programming language for reaction-time program -- need advice

Posted on 2011-09-19
13
681 Views
Last Modified: 2012-08-13
I need to write a program that will be used for a psychology experiment.  The program will display a series of very simple math problems, such as these two:

9 - 7 =
2 x 4 =

The answer is always a single digit.  The program will keep track of the amount of time it takes the user to hit the correct key.  The number of problems will be specified at the beginning of the run.  At the end of the run, the program will create a text file that contains the problems answered, whether the correct answer was given, and the reaction time.

It's very important that the program give accurate results.

I'm not a programmer, but I took some programming courses in college (mostly in PL/I but also in Pascal and APL).  I'm looking for recommendations for a programming language that is free, reasonably easy to learn, and runs under Windows 7.

I don't much care about things like the ability to create a fancy user interface.  The program will not be sold.

Thanks in advance.
0
Comment
Question by:chernavsky
  • 4
  • 4
  • 2
  • +3
13 Comments
 
LVL 2

Accepted Solution

by:
aviran earned 50 total points
ID: 36563542
definitely java or C#

if you choose java, use eclipse for development/
if you choose c#, you can use visual studio express which is also free
0
 
LVL 19

Assisted Solution

by:Thommy
Thommy earned 50 total points
ID: 36563645
You can use FreePascal, which is available for multiple platforms.
Windows-version supports Win 7...

Download Page
http://www.freepascal.org/download.var
0
 
LVL 85

Assisted Solution

by:Mike Tomlinson
Mike Tomlinson earned 100 total points
ID: 36563831
...or the other free IDE from Microsoft, Visual Basic.Net Express:
http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-basic-express

You can make a Console or Form based app with it.
0
 
LVL 13

Assisted Solution

by:5g6tdcv4
5g6tdcv4 earned 50 total points
ID: 36564043
0
 
LVL 2

Expert Comment

by:utapyngo
ID: 36564870
New to programming? Python is free, and easy to learn:
http://wiki.python.org/moin/BeginnersGuide

And it runs perfectly under Windows 7.
It has a built-in interactive shell which you can use as a calculator:
>>> 9 - 7
2
>>> 2 * 4
8

Open in new window

I also recommend installing IPython. It is a very good extension to the built-in Python shell.
0
 

Author Comment

by:chernavsky
ID: 36566434
Thanks for all the tips.  Does anyone have an idea about how to verify that the reaction-time measurements are accurate?  I wouldn't even know how to approach this.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 13

Expert Comment

by:5g6tdcv4
ID: 36566463
Here is some very simple code that starts a timer before each question and ends the timer after each question. It is measuring in Milliseconds

the test.txt is the compiled exe for the code I attached, just rename to test.exe
MsgBox(0,"Test","Your Test will start when you click Ok")
$begin = TimerInit()
$1value = InputBox("Question", "9 - 7 =  ?", "", " M2")
$1dif = TimerDiff($begin)
$begin = TimerInit()
$2value = InputBox("Question", "9 + 7 =  ?", "", " M2")
$2dif = TimerDiff($begin)








MsgBox(0,"Time in MS to answer question 1",$1dif)
MsgBox(0,"Time in MS to answer question 2",$2dif)

Open in new window

test.txt
0
 
LVL 85

Assisted Solution

by:Mike Tomlinson
Mike Tomlinson earned 100 total points
ID: 36566824
"...and runs under Windows 7"

As a multi-tasking operating system, anything you do will not be accurate at the millisecond level!
0
 

Author Comment

by:chernavsky
ID: 36567005
@Idle Mind: So how do I get around that problem?  I really need the data to be accurate.  The typical reaction time is somewhere on the order of 200 milliseconds.
0
 
LVL 85

Expert Comment

by:Mike Tomlinson
ID: 36567043
...don't use Windows for a system that needs accuracy down to the millisecond level?  =\

Normal operating system ~actions~ can add 50+ milliseconds to the time.

One way to reduce the problem is to give the test multiple times and then average the results.

Also, make sure that you don't have things like virus scanners, backup systems, scheduled updates, etc set to run when the system is supposed to be used.  Turn off desktop background switching, etc...
0
 

Author Comment

by:chernavsky
ID: 36567298
@Idle Mind: What about doing it in Ubuntu, or some other flavor of Linux?  Would that give better results?
0
 
LVL 85

Expert Comment

by:Mike Tomlinson
ID: 36567408
I don't have any experience with them sorry...but I'm guessing you probably have more control over what is loaded at any given time.
0
 

Author Closing Comment

by:chernavsky
ID: 36582188
Thanks for all the helpful information.  Will have to spend some time investigating options.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

A short article about a problem I had getting the GPS LocationListener working.
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now