• Forum
  • Jobs
  • Plz help me to finish. Quick pay.

 
Plz help me to finish. Quick pay.

Assessment 4 The text file link is : http://textuploader.com/5y1n4

Assessment 4:
This program is a similar idea to Assessment 3, but this time it is using a text file of information as the source of the questions.

1. The program starts by prompting for and storing the user’s name

2. It then outputs a simple text information:

Hello, <username>. (the name the user has already entered)

This program tests your knowledge in your chosen category. Use commands (e.g. LOAD, PLAY, LIST, FINISH, HELP) to control progresses of the test.

3. enters a loop asking the user to:

Enter a command: (the user now enters a command)


The following section gives details of required commands information:

LOAD <filename>
e.g. Enter a command: load us_presidents.txt

It is acceptable that you separate command and filename inputs into two lines. But, to get full marks, the command should be followed by the filename as shown in the example above.

The program then opens an assigned file (see attached list at the end of this file), reads in the information and stores questions and answers in arrays of string. To get full marks, you should use a multi-dimensioned array.

It then displays the text from the first line of the file which will describe the category of questions and numbers of entries read in, e.g.

Category of questions: Presidents of the United States of America
Number of entries: 44

If the file cannot be loaded then output an error message; so, if I tried to load a file called myfile.txt and it didn't exist then the program would respond with:

*** ERROR: Unable to open file myfile.txt ***

NOTE: remember to use the clear() function after you have read in a file to EOF (end-of-file).




PLAY
e.g. Enter a command: play

This command will be valid only if load the file successfully. Otherwise, there will be an error message displaying on the screen:

*** ERROR: Unable to play before loading files. ***

Then the program displays the category of questions which is made up from line 2 of the file and will be chosen at random each time from the open file, e.g.

What is the name of the 16th president of the USA (March 4, 1861 - April
15, 1865)?

If the correct answer is given, then output:

"Well done"

followed by the number of correct answers so far - for example:

What is the name of the 16th president of the USA (March 4, 1861 - April
15, 1865)?
answer: Abraham Lincoln
Well done. Correct answers: 1

If an incorrect answer is given then correct them as follows:

What is the name of the 32nd president of the USA (March 4, 1933 - April 12, 1945)?
answer: Dwight D. Eisenhower
Wrong: The name of the 32nd president of the USA (March 4, 1933 - April 12, 1945) is Franklin D. Roosevelt.

After each attempt, it should ask users if they wish to continue (yes/no). If they answer “no”, then output the total of correct and incorrect answers. for example:

Continue (yes/no)? no
Correct answers: 2
Incorrect answers: 1

Enter a command:

LIST
e.g. Enter a command: list

This command will be valid only if load the file was successfully. Otherwise, there will be an error message displaying on the screen:

*** ERROR: Unable to list before loading files. ***

List the questions and answers stored in the arrays (or multi-dimension array) to the console screen preceded by the category, the question, and the number of entries.



FINISH

The program cannot be ended unless the user types this command.

The program should create a file, which should bear the user’s name (e.g. bob_test.txt), to hold the category of the quiz, the total correct and incorrect answers. To get full marks, the file may record all steps taken while the program is running – so which questions were answered correctly and incorrectly can be determined by looking at the file.

HELP
Simple text output for describing all command options.

Please read through these specifications in good time so that you are able to ask questions about what is required of you.

Submissions
1) Hand in 1 printed copy of the source code file(.cpp), and JSP diagram by Friday of the first week back. You should also submit a CD or DVD with the program project folder and the JSP diagram file (that can be loaded into the JSP editor – NOT the graphic image).


Deadline for Submission: 18th April 2016

Any program that you submit as part of your assessment should contain the following comment block after the identification block:


Learning outcomes(module specific skills) assessed:
• Using a specified design notation to represent the structure of procedural code
• Creating a simple procedural program in C++
o Use of data types and expressions
o Use of “selection” in program structure
o Use of “iteration” in program structure
o Use of functions
o Use of arrays and files

Learning outcomes(Personal and key skills) assessed:
• Ability to design simple procedural program
• Ability to produce appropriate academic and technical documentation that demonstrates a “professional approach to work”
• Ability to demonstrate “independent working and learning” and “planning and organisation” strategies in the solution of a programming problem
Last edited on
Is the deal still on? Or is deadline over?
Topic archived. No new replies allowed.