1 Replies - 693 Views - Last Post: 19 April 2010 - 05:06 PM Rate Topic: -----

#1 Modde  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 19-April 10

Tricky "distance quiz"

Posted 19 April 2010 - 03:06 PM

Hello, I see you guys have some serious knowledge of C# and I was hoping you guys could help a beginner in need. At school we have got handed an "impossible" task that I struggle with. It is not very big, but rather (for me) complex. If you could take a look at it and maybe tell me how such a task should be handled. Especially the pole and the 10% margin.
--This is supposed to be an impossible task since we are just starting out with variables, so you would just settle my curiosity, not doing my homework :P--

The problem:

Make a little program where the user can guess the distance(in Nautical miles) between Langesund and other known Norwegain harbors.

- Krager° (14 nautical miles from Langesund)
- Lyng°r (32 nautical miles from Langesund)
- Kristiansand (85 nautical miles from Langesund)
- Sandefjord (23 nautical miles from Langesund)
- Str÷mstad (46 nautical miles from Langesund)
- G÷teborg (109 nautical miles from Langesund)
From a list the user can choose the harbor he/she wants to guess the distance of. After the user have guessed the distance he shall get the answer if he guessed too many miles or too few.
The user shall be able to guess the right answer with a margin of error of 10%. A graphic in the form of a standing or laying pole shall show how many attempts the user have used. Last there should be a comment of how many tries the user used.

The program is supposed to be posted on the web. How would you solve such a task?

Regards, Endre.

Is This A Good Question/Topic? 0
  • +

Replies To: Tricky "distance quiz"

#2 Tanner.R  Icon User is offline

  • New D.I.C Head

Reputation: 4
  • View blog
  • Posts: 33
  • Joined: 17-April 10

Re: Tricky "distance quiz"

Posted 19 April 2010 - 05:06 PM

Well it sounds like your making a kind of number guessing game with pre set numbers is that correct? To me it sounds like the user picks and island then try's to guess how far away it is if he is to low or to high tell him or something but also tell him how many trys it took him to guess, Correct? If any of that was close to what your doing than check these out:
C# Tutorial: Basic GUI Guessing Game
Lesson 2: Operators, Types, and Variables
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1