deterew.blogg.se

Guessing game in java with source code
Guessing game in java with source code








  1. GUESSING GAME IN JAVA WITH SOURCE CODE SOFTWARE
  2. GUESSING GAME IN JAVA WITH SOURCE CODE CODE

Such file-based assignments tend, in our opinion, to be challenging to students for the parts doing file i/o and exception handling compared to the rest of the program. We have also avoided (what we have found to be) classical assignments of reading data from a file, manipulating the data and then saving it back to a file. Note that the binary search used for the guessing part (which is already implemented for the students) contains some technical and mathematical aspects which might be inspiring for those students who would not be discouraged by a more technical assignment. We have consciously avoided more technically or mathematically focused topics (like prime number generators, simple compression or encryption algorithms, sorting algorithms etc) since it is our firm belief that such topics both could be mathematically and/or technically challenging while at the same time giving an unjustified impression of programming as always being a theoretical and technical activity. The decision to make the topic about a game

GUESSING GAME IN JAVA WITH SOURCE CODE CODE

We have made an effort for making also the code and design of the program interesting for the students who want to learn from reading code and trying to understand the whole program. The only realistic scenario for batch programs as the above is when you write test code (which is part of this lab as a suggestion in one of the hints). name ()) Ī typical comments from students regarding the above code is “Yes, but I knew what the names of p1 and p2 were, I created the objects myself on the lines immediately before printing this!” Person p1 = new Person ( "James" ) Person p2 = new Person ( "Lisa" ) System. Then the program asks the objects about their state, and print the state to the screen: A typical batch-like program creates a few objects of some class, typically supplying different state to the objects via the constructor. We have noticed that students find batch-like programs to be strange. We think this creates an interest for what else a computer program can do.

GUESSING GAME IN JAVA WITH SOURCE CODE SOFTWARE

The decision for choosing an interactive game as the program for the assignment, is based on our belief that this gives some meaning to the assignment since the student upon completion can run the software and see it work using different numbers for the computer to “guess”. The idea behind making the first assignment easy enough for every student to successfully complete, is to strengthen the student’s self-confidence while still conveying useful insights and techniques for programming in Java. The instructions are meant to guide the student through this process. The assignment is constructed so that the student gets an almost complete program but is tasked to complete the missing parts. Based on this input, the computer uses binary search to zoom in on the number the player is thinking of. The player answers (truthfully) T (for true) if the question is correct, and, F (for false) otherwise. The computer makes educated guesses by asking if its guess is less than or equal to the number the player is thinking of. The game is a simple guessing game where the player thinks of a number in some interval. The first assignment is aimed at giving the students a task which is simple enough for everyone to successfully finish, while still constituting a piece of software which actually does something and contains realistic parts which structurally resembles an object oriented design of a simple game.

  • 1.3.4 Optional task 4 - understanding the guessing algorithmĪssignment 1 - Guessing game Notes to teachers, supervisors and tutors.
  • 1.3.3 Optional task 3 - Use an object to parse and hold the arguments.
  • 1.3.2.2 Stuff to think about (for optional task 2).
  • 1.3.2 Optional task 2 - handle the parsing of the arguments.
  • 1.3.1.2 Stuff to think about (for optional task 1).
  • 1.3.1 Optional task 1 - Check arguments.
  • 1.3 Optional extra challenges for Assignment 1.
  • 1.2.10 Task 5 - let the player choose the interval.
  • 1.2.9 Task 4 - Write a program using the Guesser class.
  • 1.2.8.2 Stuff to think about (for Task 3).
  • guessing game in java with source code

  • 1.2.8 Task 3 - finish the getReply() method.
  • 1.2.7.2 Stuff to think about (for Task 2).
  • 1.2.7 Task 2 - complete the start() method.
  • guessing game in java with source code

  • 1.2.6.2 Stuff to think about (for Task 1).
  • 1.2.6 Task 1 - write a constructor for the class.
  • guessing game in java with source code

    1.1.3 Things we predict will be hard for the students.

    guessing game in java with source code

  • 1.1.2 The decision to make the topic about a game.
  • 1.1 Notes to teachers, supervisors and tutors.









  • Guessing game in java with source code