Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Linux Shell Prpgramming 1.Write a quiz-script which will provide some statistics about a quiz results (summarize how many good answers and how many wrong answers

  1. Linux Shell Prpgramming
  2. 1.Write a quiz-script which will provide some statistics about a quiz results (summarize how many good answers and how many wrong answers were provided). The script should use up to 3 execution parameters. When executed with two parameters (lets call it interactive mode), it should assume, that the first file contains a list of questions and the second file contains correct answers to these questions. In such execution case your script should display questions one by one and wait for users response. The users response should be then compared with the correct answer so that specific questions read from the file containing answers and as a result the script should produce statistics as to how many good and how many wrong answers were provided.

Questions should be formed so that either, YES or NO answer would apply. Questions file format can by any, whilst the answers format should contain only YES or NO answers, one answer per line. There should be exactly 10 questionsin the quiz.

Assuming that file containing questions is qfileand the file containing answers isafile, to run your script in the interactive mode it should be executed as:

./scriptname qfile afile

How to test:

  1. Create a text file containing a number of questions.
  2. Create a text file containing correct answers to these questions.
  3. Execute your script:
    1. It should ask questions one at a time and then wait for your answer.
    2. Your answer should be then compared with the appropriate answer read from the file with answers,
    3. Depending on the correctness of your answer, the script it should count the answer and display statistics as:

Number_of_correct_answers Number_of_wrong_answers

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Administrator Limited Edition

Authors: Martif Way

1st Edition

B0CGG89N8Z

More Books

Students also viewed these Databases questions