View the step-by-step solution to:

It allows a user to choose which test to take and then delivers questions from the selected test for the user to answer. The program also marks the...

In this assignment, you are to design a program that administers True-False tests to users.
It allows a user to choose which test to take and then delivers questions from the selected
test for the user to answer. The program also marks the test and displays a score when
the test is completed.
Your program should use two Forms as follows:
• The initial or “Test Form” will permit the user to choose a test.
o The user selects a test from a list of choices . The choices are actually the
names of text files without the extension “.txt”. Your program will
obtain the list of tests by reading a file called “TESTS.txt” and display
them in a ListBox.
o The selected test will be displayed in a ReadOnly TestBox on the Test
Form. The user may change the selection or proceed.
o To start the test the user will click a “Begin” button.
o A ReadOnly TextBox will be used to display the score for the test when it
is completed. The score should be displayed as a String with the format:
“correct / total” where “correct” is the number of correct answers and
“total” the total number of questions.
o The user should be able to select another test to take.
• The second or “Question Form” opens when the user clicks on the “Begin” button
of the Test Form. This Form delivers questions one at a time to the user from the
test file selected by the user on the Test Form.
o Each line of a test file consists of a question and the correct answer, either
T or F. The question and its corresponding correct answer are separated
by a comma.
o Questions are displayed one-at-a-time to a user in a TextBox. The number
of the question is also displayed in a TextBox to the left of the TextBox
containing the question.
o The user types the answer into a TestBox. An “Enter” button is used to
submit the answer and evaluate it. A valid answer must begin with either
“T” or “F” in either upper or lower case. If an invalid answer is provided,
including no answer, a message requesting a valid answer should be
displayed in a TextBox. This “error message” textbox should not be
visible unless an error occurs. It should be made invisible again after the
user enters a valid answer and presses the “Enter” button.
To test your program, use NotePad to create at least three text files. One text file should
be named “TESTS.txt”. The other files are the tests and can be named whatever you
wish. Each line of each test file should provide the text of one true-false question and its
correct answer, separated by a comma. Once they have been created, the names (without
the extension “.txt”) of your test files should be placed in the file “TESTS.txt”, one
name per line.
SIMON FRASER UNIVERSITY CENTRE FOR ONLINE AND DISTANCE EDUCATION CODE/A Page 5 of 5 CMPT 110-3 Assignment #5 In this assignment, you are to design a program that administers True-False tests to users. It allows a user to choose which test to take and then delivers questions from the selected test for the user to answer. The program also marks the test and displays a score when the test is completed. Your program should use two Forms as follows: The initial or “Test Form” will permit the user to choose a test. o The user selects a test from a list of choices . The choices are actually the names of text files without the extension “ .txt ”. Your program will obtain the list of tests by reading a file called “ TESTS.txt ” and display them in a ListBox. o The selected test will be displayed in a ReadOnly TestBox on the Test Form. The user may change the selection or proceed. o To start the test the user will click a “Begin” button. o A ReadOnly TextBox will be used to display the score for the test when it is completed. The score should be displayed as a String with the format: “correct / total” where “correct” is the number of correct answers and “total” the total number of questions. o The user should be able to select another test to take. The second or “Question Form” opens when the user clicks on the “Begin” button of the Test Form. This Form delivers questions one at a time to the user from the test file selected by the user on the Test Form. o Each line of a test file consists of a question and the correct answer, either T or F. The question and its corresponding correct answer are separated by a comma. o Questions are displayed one-at-a-time to a user in a TextBox. The number of the question is also displayed in a TextBox to the left of the TextBox containing the question. o The user types the answer into a TestBox. An “Enter” button is used to submit the answer and evaluate it. A valid answer must begin with either “T” or “F” in either upper or lower case. If an invalid answer is provided, including no answer, a message requesting a valid answer should be displayed in a TextBox. This “error message” textbox should not be visible unless an error occurs. It should be made invisible again after the user enters a valid answer and presses the “Enter” button. To test your program, use NotePad to create at least three text files. One text file should be named “TESTS.txt”. The other files are the tests and can be named whatever you wish. Each line of each test file should provide the text of one true-false question and its correct answer, separated by a comma. Once they have been created, the names (without the extension “ .txt ”) of your test files should be placed in the file “TESTS.txt”, one name per line.
Background image of page 1

Recently Asked Questions

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

-

Educational Resources
  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question