Results 1 to 12 of 12
Thread: I need this game!!!
 04102010, 10:53 AM #1Member
 Join Date
 Apr 2010
 Posts
 7
 Rep Power
 0
I need this game!!!
I have to complete this projec in 2 days please help me!===
Problem Description:
Write a game to help users to improve their arithmetic calculation skills. The aim of the game is to solve maximum number of questions correctly in a limited time. The game must generate random arithmetic expressions of two and three operations with random integer operands and asks the user the answer. If the user correctly writes the answer, the program generates the next random question until the time finishes. Use the following rules to implement your program.
1. Give initial time of 1 minute (increase the total time by 5 seconds if 5 questions in a row were correct).
2. Implement two levels:
a) First level uses one operation with two operands only, e.g. 5+3 ?
b) Second level uses two operations with three operands , e.g. 20 / 4 + 5 ?
3. At the end of the program calculate and show the score by grading total number of correctly answered questions. The program also must display the total time that is elapsed and number of correct answer/questions. You can provide motivational messages such as in the sample run that is provided.
4. According to the score of the user, put a threshold to decide whether the user can advance to the next level or repeat the current level.
5. At the end of game ask the user if he wants to repeat the level, advance to the next level (if he has enough points), or quit the program.
Here is a sample run of the program:
 04102010, 10:54 AM #2Member
 Join Date
 Apr 2010
 Posts
 7
 Rep Power
 0
IT MUST LOOK LIKE ;
Welcome to Arithmetic’s Exercise Program
Answer as many questions in total 60 seconds.
You get 5 seconds bonus if you answer 5 questions in a row.
Use java arithmetic precedence rules!
Input ‘q’ to quit or any key to start:
1. 5+6*9 = 59 … Correct
2. 26*0 = 2 … Correct
3. 3/8+5 = 5 … Correct
4. 8/24 = 0 … Correct
5. 9*12+0 = 96 … Correct (5 seconds added)
6. 5212+13 = 51 … Wrong
7. 5+1*9 = 59 … wrong
8. 22*0 = 2 … wrong
9. 3/1+5 = 5 … wrong
Time finished!
You are as fast as a turtle!
You answered 5 questions correctly out of 9 in 65 seconds.
You can not advance to the next level
Input ‘q’ to quit or any key to restart:

You have essentially posted your assignment and shown no work, shown no effort as if you want someone here to do this for you. Well, it ain't going to happen. By posting this way, you are risking cheating yourself out of the education you gain by doing this yourself and learning as you are doing, and none of us wish to deprive you of this benefit. We will be happy to answer specific questions you may have regarding problems with your code, but first you need to show some initiative and effort.
Best of luck.Last edited by Fubarable; 04102010 at 02:55 PM.
 04102010, 04:18 PM #4Member
 Join Date
 Apr 2010
 Posts
 7
 Rep Power
 0
Of course I do not want someone to do this assigment for me! I just need some trick if anyone knows! thats all I want! this is a kind of hard job, so nobody wants to do it!
 04102010, 04:20 PM #5Member
 Join Date
 Apr 2010
 Posts
 7
 Rep Power
 0
import java.util.Scanner;
public class TheGame {
public static void main (String [] args){
int count= 0;
while (count<100){
int number1 = (int)(Math.random()* 10);
int number2 = (int)(Math.random()* 10);
Scanner input = new Scanner(System.in);
System.out.print("What is " + number1 + " + " + number2 + "?");
int answer = input.nextInt();
System.out.println(number1+ " + " + number2 + " = " + answer + " is " + (number1+number2 == answer));
count++;
long endTime = System.currentTimeMillis();
long testTime= endTime  startTime;
System.out.println ("Correct count is " + correctCount + "\nTest time is " + testTime /1000 + "seconds\n" + output);
}
}
}
and I did some codes like that but it does not work. I could not manage the time code:S


Have you worked with creating methods other than the main, because you're going to have to do this to solve this assignment. Your best bet is to break the problem down into steps and try to solve each step in isolation.
for e.g.,
Pseudocode
Java Code:begin start countdown timer while time remaining > 0 show level1 question get answer, check answer, update score if correct: increase fiveInRowCorrect int by 1, else fiveInRowCorrect = 0 if fiveInRowCorrect >= 5, then time remaining += 5 seconds and fiveInRowCorrect = 0 end while end
 04102010, 08:31 PM #8Member
 Join Date
 Apr 2010
 Posts
 7
 Rep Power
 0
thanks for ur help, I have last question now; how can I divide the game two different levels
 04112010, 02:27 PM #9
i would write a method that returns questions with two operands for the easy part and the same method that returns questions with three operands, depending what level is selected. all the other code for the game is the same.
this game is almost the same game in dr. kawashima's brain training for nindendo ds. are here any awt/swing programmers that are interested in writing some parts of Dr Kawashima's Brain Training: How Old Is Your Brain?
 04122010, 12:07 PM #10Member
 Join Date
 Apr 2010
 Posts
 7
 Rep Power
 0
Thank you for ur help, I will try to do it, then will show u again..
 04132010, 09:33 PM #11Member
 Join Date
 Apr 2010
 Posts
 7
 Rep Power
 0
import java.util.Scanner;
public class TheGame {
public static void main (String [] args){
final int Number_of_Questions=9;
int trueCount=0;
int count=0;
long startTime=System.currentTimeMillis();
while (count<10){
int number1 = (int)(Math.random()* 10);
int number2 = (int)(Math.random()* 10);
Scanner input = new Scanner(System.in);
System.out.print("What is " + number1 + " + " + number2 + "?");
int answer = input.nextInt();
if (answer == (number1+number2))
trueCount++;
System.out.println(number1+ " + " + number2 + " = " + answer + " is " + (number1+number2 == answer));
count++; }
long endTime = System.currentTimeMillis();
long testTime = endTime  startTime;
System.out.println("You asnwered " + trueCount + " questions correctly " + "\n in " + testTime / 1000 + " seconds\n");
}
}
The last view of my project is like that now! but I can not manage the time ; for example I have to give a limited time but how? and also how can I add extra 5 seconds for every 5 correct questionss??? :S:S
thankss
 04182010, 07:16 AM #12Senior Member
 Join Date
 Dec 2008
 Posts
 526
 Rep Power
 0
Similar Threads

Implementing "Game Over" in Minesweeper game based on Gridworld framework.
By JFlash in forum New To JavaReplies: 2Last Post: 08052010, 05:49 AM 
Help! Game.
By MIA6 in forum New To JavaReplies: 4Last Post: 11082009, 01:22 AM 
Help with my game!
By Manikyr in forum New To JavaReplies: 6Last Post: 06062009, 12:09 PM 
Game 21
By aRTx in forum Advanced JavaReplies: 3Last Post: 04042009, 01:33 AM 
2D strategy game or 2D war game
By led1433 in forum Java 2DReplies: 5Last Post: 02102009, 07:00 AM
Bookmarks