C :: How To Add Timer To Mini Quiz Game

Jun 1, 2014

I want to add a timer to my mini quiz game and show how much time it took for the user to finish it .I want to learn how to do that in C language

NOTE: My program only has a splash screen Allegro

The files are attached :

A bitmap [URL] .....

(I couldn't attach because of the size is above 200 kb. Please save as a BMP file )
A text file
A CPP file

View 9 Replies


ADVERTISEMENT

C++ :: Saving Progress Of A User In Quiz Game

May 5, 2014

I'm making a quiz game in c++. I've already completed it. But now I've thought of creating a profile and saving the progress for the user so when he enters his name the game continues frm where he had saved it.

View 3 Replies View Related

C++ :: Quiz Game - Playing Video In One Round?

Apr 9, 2014

I am making a game of quiz and i want to play a small clip in one of the rounds, but i dont know how to do it in c++ ....

View 3 Replies View Related

C/C++ :: Quiz Show Game - Reset File To Original

Apr 7, 2015

I've been taking a C++ class, and for a project we need to do, we have to create a simple quiz show game while putting the high scores and names inside a .txt file. We have lessons we can look at to complete it while learning. But at the end there's always a challenge that we should complete to show that we've actually learned the information. For the challenge, we needed to take the information in the .txt file and reset it to its original information. So say there's 5 people preset that have high scores, then a person plays the game and the program asks if they'd like to reset the list. If the user inputted 'y' or any key that needed to be pressed, the program would reset the .txt to its original information.

This is the code that creates the program.

// Include Libraries
#include <iostream>
#include <string>
#include <fstream>
// Include standard namespace
using namespace std;
// Declare Global Variables
int Guess;
int Winnings;

[Code] ....

It works how I need it to and there aren't any problems, necessarily, but I want to know if there's any, more efficient, ways of completing this task. Like if there's any already made function of resetting a file.

This is the code that resets the file. As you can see, it just uses the information earlier in the code inside the if statement. Is there any pre-made function or method of resetting a file?

cout << "Would you like to reset the high scores list? (y or n): ";
cin >> ask;

if (ask == 'y')
{
High_Score[0] = 25000;
High_Score[1] = 12000;
High_Score[2] = 7500;
High_Score[3] = 4000;
High_Score[4] = 2000;

[Code] .....

View 1 Replies View Related

C :: Create A Hangman Game With Timer

Mar 21, 2013

I want to create a Hangman game with timer.. If the user cannot guess the word with in 1:30 min the game will stop and the word will be printed.

View 5 Replies View Related

Visual C++ :: Creating A Virtual Mini Server?

Jul 28, 2014

Is it possible to create a virtual mini server (like IIS) that takes http request? I have a toolbar that queries an DLL using http request, and then that DLL stores some arguments in some XML file, which is read by an anti-malware.

Now every customer can't have an IIS server installed. Most of the end users uses Windows XP home edition. So is there a way i can create a virtual mini server that can be used in these PCs for placing http request?

View 14 Replies View Related

C++ :: Mini Bank Account System - Using Header Files?

Feb 13, 2013

i am currently doing a mini bank account system using visual studio...i need using the header files...the question requires to use 3 header files for each class.these are the classes:

a)Accounts
b)CurrentAccounts
c)SavingAccounts

i have done the first part... how to do a new class in a different header file..

View 3 Replies View Related

C# :: Drag And Drop Quiz

May 13, 2014

What I'm looking for is actually a few things. I want to creat a drag and drop like quiz. For example:

-You get 4 pictureboxes with 4 different pictures of pc components (the solutions). Below that there are 4 other empty pictureboxes to drag the picture to with text aside from them (the questions).Now How would I go about linking the different pictures to the correct text ? I already have drag and drop working, but the linking is killing me.

View 1 Replies View Related

C :: Math Quiz Program - Multiplication Function

Nov 16, 2014

Code:
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
void correctResponse(void);
void incorrectResponse (void);
void multiplication( void ); // function prototype

[Code] ....

// end function multiplication

// It keeps crashing. How do I compile the responses into a grade?

View 5 Replies View Related

C/C++ :: CodeBlocks Random Math Quiz Generator

Nov 26, 2014

The user will be allowed to pick:

-the number of problems they want to do
-the type of problem (addition, subtraction, multiplication, division)
-the range of numbers for the problems (like 0 to 9, -100 to 100, etc.) [random numbers in the range]

Your program will then display the given number of problems and get the answer from the user. It will tell the user it they are correct or not. If they are incorrect, it will print the correct answer.

After the given number of problems are displayed, the program will give the user the final number correct and percentage correct. The user will be asked if they want to go again. If so, you will reprompt the user for all the information and run again.

I came up with code thinking I was going in the right direction but it doesn't work correctly at all. We have to use functions. My main issue is how do i call variables from another function so all of the functions work together. I repeat I don't understand parameters and calling functions. here's the code:

#include <iostream>
#include <cstdlib>
#include <iomanip>
using namespace std;
int get_user_range(int &x, int &y);
int get_random_number ();

[Code]......

View 1 Replies View Related

C :: Create Multiple Choice Quiz Works But With A Warning

Apr 10, 2013

I am trying to create a multiple choice quiz so I can learn the menu at my new job, while doing a side project but I am having a warning when outputting. Speaking of side projects, is this a kind of side project people are looking for on a resume?

Code:

#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <stdlib.h>
#include <string.h>
}

[code]....

View 8 Replies View Related

C/C++ :: Quiz Program Based On Data File Handling

Dec 22, 2014

I'm trying to make a Quiz program based on C++'s Data File Handling capablities. I've attached the code in .txt file and I wonder why I'm getting the error identifier bScience cannot have a type qualifier?

Attached Files QuizPro.txt (9.6 KB)

View 7 Replies View Related

Visual C++ :: Making A Little Quiz Application In Studio 2008?

Jun 10, 2013

I've been trying to make a little quiz application that takes questions from a file and them presents question by question on a static pannel, a few buttons that have the possible answers on them written as the questions go, and on the bottom a little place where we can see whats our score.when we finish the quiz, the score gets writen in a data.dat file and thats that.

View 14 Replies View Related

C++ :: Quiz Program - Checking Whether Entered Answer Is Correct From A File

Apr 15, 2014

My code is not moving past the line below...actually i am making a quiz and this piece of code id checking whether the entered answer is correct, from a file..

getline(anss,saveans);
while(a<1) {
getline(anss,saveans);
if (saveans == ToString(randNum)) {
getline(anss,saveans);
if (saveans == ans)

[Code] ....

View 9 Replies View Related

C :: Program That Grades A True / False Quiz - Data Available In Text File

Oct 14, 2014

You are to write a C program that grades a true-false quiz. The quiz data will be available in a text file; here is an example:

Quiz #8 (09/22/14) (corrected version)
TTFTTFTFTF
0080 TTFTTFTFTF
0340 TTFTFFTFTF

The first line in the data file is a comment that you may assume can be up to 80 charac- ters long; it cannot be blank. The second line contains the answer key for the 10-question true-false quiz. The following lines in the data file contain a student's id number in column 1 followed by their answers for the quiz in column 2. A 0 (zero) on a line by itself indicates that there are no more students to process.

Write a program that first reads in (from standard input; more on this in a moment) the comment line and answer key as strings followed by each student's data. Store the student's id numbers in an array. You are to "grade" each student's quiz using the key provided fol- lowed by recording their scores (in a second array) in order to be able to print them out later. You do not need to use an array of strings or characters in your program. Write your program allowing for up to 100 students, and you may assume that at least 1 student will have taken the quiz.

You should create test data text files and provide the data to your program using redirection from the command line (see the sample run below). Your program should output the number of students who took the quiz, the average score, the best score, and a table showing each student's id, score, and grade. The formatting, spacing, and labels in your output should 1 match the sample run below exactly.

Your program should determine each student's grade as follows: if the score is equal to the best score b or b−1, give an A. If it is b−2, award a B. Give C's for any score that is equal to b−3 or b−4, a D for b−5 and an F for all others.

Alright So I'm just stuck at comparing the key answer with student answer here is my code comparing one student's answer with the answer key . is that right ?? One more thing for some reason when i try to print answer[0] the result is nothing why is that

Code:
#include<stdio.h>
int main(void) {
char comment[80];
char answer [10];
char studentans [10];
int n=0,i=0,x=0;
int ID[10];

[Code] .....

View 1 Replies View Related

C++ :: Multiple Quiz Program - Adding High Score For Each User Stored In Binary File

Jul 11, 2014

I am making a multiple quiz program. So everything is working fine, except for the part where i'm trying to add a highscore for each user which is being stored in a binary file. I have added a sample of the program containing the error. This isn't the actual program, which is very long.

class user { //The collection of all info pertaining to the users
char user_id[50];
public:
int hscore1;
user() {
strcpy(user_id,"NULL");
hscore=0;

[Code] ....

View 1 Replies View Related

C++ :: Game Design Practice For Accessing Container Of Game Objects

Dec 21, 2014

I'm working on my first video game. So far I have a few classes in the game starting with the Game class which includes a list of GameObjects (another class). There are several classes that inherit from GameObjects used to implement things like bullets, explosions, various enemy types, etc.

The game essentially iterates through the list of GameObjects to update/render them. I would like to provide access to the Game's list of GameObjects inside another class (like the Bullet class) so I can put new objects on the list. For example, when a bullet hits, I want to add an explosion to the Game's GameObject list it can be updated/rendered.

How this should be setup? I was considering adding a pointer to the Game or GameObject list to the GameObject class (and methods to access it), but I was wondering if there is a better way to set this up?

View 4 Replies View Related

C++ :: Program For Calculating Total Price Of Game Station And Game

Sep 13, 2014

I would like to make a program for calculating the total price of a game station, and a game. I made a program like this for just the price of a game in class, but I want to make one that does the game system as well.

View 7 Replies View Related

C++ :: How To Create A Timer

Jan 24, 2014

#include<iostream.h>
#include<time.h>
#include<conio.h>

[Code].....

View 3 Replies View Related

C/C++ :: How To Reset A Timer

Apr 12, 2012

Im trying to make a reaction game. I have a grafic that comes up, and the timer starts and when i hit the grafic the timer stops. But my problem is that the Timer doesn't reset.

View 2 Replies View Related

C :: Using Timer Module In PIC Microcontroller

Feb 28, 2013

how to produce a period signal that lasts 0.100 ms that is 35% red and 65% green using a bi-colour LED and the timer module?

while(ReadTimer0() < (unsigned int)165)

Its using this: OpenTimer0(TIMER_INT_OFF & T0_SOURCE_INT & T0_16BIT & T0_PS_1_32);

So does that mean that the period signal is 165 * 32 * 4/32 = 660 = 66%? I really just need to know how to calculate the period signal to produce 35% red and 65% green..

View 1 Replies View Related

C++ :: Making A Countdown Timer?

May 17, 2013

I'm creating a game in which i.need player to.answer.my question within 10 seconds...

So I need a code for this timer... I don't want code to be paused by sleep or delay functions.. But I need that it waits.for 10 seconds.. and if user types answer in between.. it.reads it

And if player.doesn't answers it within 10 sec.. it displays a message

View 2 Replies View Related

C++ :: How To Set A Timer And Processing Continues

Apr 28, 2013

I need to set a timer but still have the program processing info. I have looked into using sleep but when using this all processing stops to my knowledge. I tried to use the settimer method but was having some issues since I am not using a dialog based interface.

View 1 Replies View Related

C# :: Timer Or Watcher For Variable?

Apr 4, 2015

I have some value in process memory (not my process). I have address of this value and want to execute function or smth else on changing this value. I think to use timers but I think they are too slow - low resolution(I read smth from 10 to 50 ms) and uses CPU too much. Can you offer me some other solution with not very much cpu usage but with checking variable value nearly 1 to 5 ms.

View 3 Replies View Related

C/C++ :: How To Create A Timer That Allows Input

May 14, 2013

I am trying to create a five second timer that allows a value to be entered in that span of time. However, if a value is not entered within the five seconds, the timer ends and a value will no longer be able to be entered. I am trying to create a math test that has a five second time limit for equations to be answered.

View 4 Replies View Related

C++ :: Timer With Non-return Calculations

Dec 25, 2013

My game runs in a while loop, as you can see in the code below. I need a timer, which won't stop this loop or freeze it, but it will wait, until timer is over and executes code without interfering with the while or for loop.

Code:

Code:
#include <iostream>
#include <iomanip>
#include <windows.h>
#include <ctime>
using namespace std;
char *map[25][25];

[Code] ....

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved