There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
access audio avg avg 8 bios blue screen boot bsod computer connection cpu crash css dell desktop dma driver drivers dvd email error excel explorer firefox firefox 3 freeze gimp graphics hard drive hardware hijackthis hjt install internet internet explorer itunes keyboard laptop macro malware monitor motherboard network networking outlook outlook 2003 outlook 2007 outlook express pio problem problems router seo server slow sound sp3 spyware trojan usb video virtumonde virus vista vundo windows windows vista windows xp winxp wireless
Software Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Software Development >
trying to make a testing program


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

 
Thread Tools
joebuddah's Avatar
Junior Member with 1 posts.
 
Join Date: May 2005
Experience: Intermediate
05-May-2005, 08:24 AM #1
Exclamation trying to make a testing program
in an attempt to help me study for my state real estate exam i decided to try and write a program that would generate random questions from a list and keep track of how many i got right.

this is what i have so far full of mistakes i know but im a novice programer so any help would be apriciated

in c that is

#include <iostream>
#include <cstring>

using namespace std;

int main()
{
int answer;
char second[5];
score = 0;
x= a number 10 - 200


cout << "The real estate trainer\nYou will be presented with x questions to answer.\nFor true/false questions, type 1 for true and 2 for false.\nFor multiple choice questions, type the number of your answer\n\n\n----------------------\n";
cout << " enter number of questions you want\"n;
get_var;


cout << "True/False-'the sale or rental of a single family home without the use of a broker is still governed by the Federal Housing Act-\n";

cin.getline(second, 5);
if (second[0] == 'F')
{
cout<<"Correct\n-------\n";
} score + 1 = score
else
{
cout<<"Incorrect! The sale or rental of a single family home without the use of a broker is exempt.\n-------\n";
}
cin.get();
MacFromOK's Avatar
Senior Member with 1,947 posts.
 
Join Date: Mar 2001
Location: Oklahoma
Experience: idiota de la aldea
06-May-2005, 07:13 PM #2
Not sure how much ya know about programming, but here's the steps I'd prolly take. Maybe you can let us know what parts you specifically need help with.

The questions should be in an array so ya can randomly choose one (unless ya want to use a bunch of goto/labels - possible but not popular). I'd prolly load 'em from a text file so ya could use the app for other types of tests by using a different text file.

Ya need to devise a pattern for each question, such as putting the answer (TF, ABCD, etc.) as the first or last char of the question, then store the questions in an array. Or ya could use a second corresponding array for answers if you prefer. Obviously don't display the answer with the question, just use it internally to check for the correct response.

Create a loop that randomly picks and displays a question, checks the answer and does the math to monitor your progress.

Might also want to keep a record and omit questions asked, so none would be skipped or asked twice (this could be added after the program is somewhat functioning).

Btw, asking specific questions ("how do I -----?") will prolly get a better response.

Cheers, Mac
__________________
MacFromOK : PC User
Do I have all the answers?
I don't even have all the questions!

____________________________________________________________
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are Off
Refbacks are Off

You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 05:50 PM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.