dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: How would I implement this into my program?

  1. #1
    Join Date
    Mar 2005
    Posts
    32

    How would I implement this into my program?

    Most of my programming over the years has been console apps. The kind you see in books. But now I want to start writing some Windows based programs. I wish to write a Psychology Test intended for fun for myself and a few others that are interested in the topic. The test will consist of 8 multiple choice questions. There will be 4 possible answers to choose from. I think I know how I would do the logic for the basics of keeping track of how many correct answers the user has so far, and I think I know how to change the question and the possible answers when the user presses the Next button.

    But I would like to add some more functionality to it.

    It would be cool if at the end of the test the user could press a Review button and the program would take him back or show him which specific questions he got wrong. And I would need to show what the correct answer to that question is.

    I've worked with variables, arrays, loops, if statements etc.

    But this is totally new ground for me and I don't have a clue how I would implement this functionality.

    I was thinking of either using Visual C# or C++ Builder to build this.

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,108

    Re: How would I implement this into my program?

    One approach is to store the questions and related answers in a database, then the program can randomly present the questions and answers and record the user's choices. Of course, the program would allow a user to register so the user registration info would be stored as well.

    Besides this functionalty, you have a bunch of learning ahead. You'll need to decide the type of app to present the data - web based? Standalone UI app? You'll need to learn how read and write to a database (or to do the same for json or xml storage formats). You'll need to leanlrn how to create a form display and navigate through the forms.

    In all, you'd probably achieve your program goals quicker if you started with some tutorials of some of the programming tasks (like reading a database or displaying a string in a field or clicking on a button) rather than start on your actual program.

    I'd probably choose C# over C++ as well because it's easier to code in and provides more in the way of UI and database interaction.

  3. #3
    Join Date
    Mar 2005
    Posts
    32

    Re: How would I implement this into my program?

    Quote Originally Posted by Arjay View Post
    One approach is to store the questions and related answers in a database, then the program can randomly present the questions and answers and record the user's choices. Of course, the program would allow a user to register so the user registration info would be stored as well.

    Besides this functionalty, you have a bunch of learning ahead. You'll need to decide the type of app to present the data - web based? Standalone UI app? You'll need to learn how read and write to a database (or to do the same for json or xml storage formats). You'll need to leanlrn how to create a form display and navigate through the forms.

    In all, you'd probably achieve your program goals quicker if you started with some tutorials of some of the programming tasks (like reading a database or displaying a string in a field or clicking on a button) rather than start on your actual program.

    I'd probably choose C# over C++ as well because it's easier to code in and provides more in the way of UI and database interaction.
    Nothing will be random. I will decide ahead of time which is question one, question two, question three and so on. It will not be web based. No. This is for fun. It will be a standalone application. You double-click the executable and you see the Welcome screen and then click Next and you are looking at question one. Simple. Creating a form is simple. C++ Builder and Visual C# do that for you.

    Creating a database is something that sounds like I will have to look into. If you can post some example code please do.

  4. #4
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,108

    Re: How would I implement this into my program?

    Quote Originally Posted by 357mag View Post
    Nothing will be random. I will decide ahead of time which is question one, question two, question three and so on. It will not be web based. No. This is for fun. It will be a standalone application. You double-click the executable and you see the Welcome screen and then click Next and you are looking at question one. Simple. Creating a form is simple. C++ Builder and Visual C# do that for you.

    Creating a database is something that sounds like I will have to look into. If you can post some example code please do.
    I can't post example db code, but you can certainly google for it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)