Jump to content

C# Programming Help?

- - - - -

  • Please log in to reply
3 replies to this topic

#1
prakashjangir

prakashjangir

    Newbie

  • Members
  • Pip
  • 4 posts
I m creating a windows form application in visual C#.Which ask questions to user ,if user fails to answer questions , application should notify the user that your socre is xxxxxx and application close. Now when user open this application again the question should be randomize. Please tell me how can i do this?

#2
cdg10620

cdg10620

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 389 posts
Can you post the code that you have already written?

This seems fairly simple. If you want the questions randomized, you will need to store the questions in the program and select them randomly which you could use an array and a random number generator. As for the other part of the question... When the user submits the form you should run a validation function that checks their answer. I personally would not have the application close if the answer is blank or wrong unless that is a requirement. I would just re-ask the question or move on to the next question.

Let me know if you need any other help.
-CDG10620
Software Developer

#3
prakashjangir

prakashjangir

    Newbie

  • Members
  • Pip
  • 4 posts
Thanks Sir, I liked your post

But As I m telling you sir , that i m newbie in programming .....how to save questions in program . They are about 300 question. Should i use database or any other.......

#4
cdg10620

cdg10620

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 389 posts
You can save them in a database, a txt file, a XML file. It's really your choice. Are the questions going to change or stay static over time? If they are going to change then you may also want a form that allows someone to edit them without touching the back end file manually. Or you can simply have the file get updated/replaced. You have a lot of options here.
-CDG10620
Software Developer




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users