Question: CSCI 161 - Assignment #4: Policy for Responsible Use Objectives The objective of this assignment is for you to review the university's policy on responsible
CSCI 161 - Assignment #4: Policy for Responsible Use
Objectives
The objective of this assignment is for you to review the university's policy on responsible use of its computing facilities and information technology resources and then write a program that asks a user to answer 5 multiple choice questions about the policy, grades their answers and returns their score.
First: Review the "Policy for Responsible Use" here.
Second: Write a Java program called ReponsibleUse that asks the user five (5) questions about the policy and scores their answers.
Your program should use the following constants, which hold the questions, their responses and their correct answers:
public static final String QUESTION_1 = "Which is NOT a purpose Millersville University makes electronic resources available to faculty, staff, and students?"; public static final String RESPONSE_1A = "For conducting official University business."; public static final String RESPONSE_1B = "For academic scholarship."; public static final String RESPONSE_1C = "For research."; public static final String RESPONSE_1D = "For student access to social media sites."; public static final String ANSWER_1 = "*"; // Replace with correct answer (a, b, c, or d) public static final String QUESTION_2 = "Which usage is NOT described in the \"Policy for Responsible Use\"?"; public static final String RESPONSE_2A = "Electronic Mail"; public static final String RESPONSE_2B = "Network Use"; public static final String RESPONSE_2C = "Crypto-currency"; public static final String RESPONSE_2D = "User Accounts"; public static final String ANSWER_2 = "*"; // Replace with correct answer (a, b, c, or d) public static final String QUESTION_3 = "Under which topic is improper printing of documents covered?"; public static final String RESPONSE_3A = "Electronic Mail"; public static final String RESPONSE_3B = "Network Use"; public static final String RESPONSE_3C = "Webpages"; public static final String RESPONSE_3D = "Software"; public static final String ANSWER_3 = "*"; // Replace with correct answer (a, b, c, or d) public static final String QUESTION_4 = "The \"Privacy and Confidentiality of Electronic Media\" portion of the policy states that?"; public static final String RESPONSE_4A = "The University may be required to provide information stored in its system if so compelled by a court order."; public static final String RESPONSE_4B = "Your privacy should be presumed at all times."; public static final String RESPONSE_4C = "The University will routinely monitor and review the contents of your user accounts."; public static final String RESPONSE_4D = "The University does not abide by recent court decisions regarding privacy and \"Right to Know.\""; public static final String ANSWER_4 = "*"; // Replace with correct answer (a, b, c, or d) public static final String QUESTION_5 = "Consequences of violating the policy includes?"; public static final String RESPONSE_5A = "Loss of access to University computing systems pending disciplinary process."; public static final String RESPONSE_5B = "Possible prosecution under State laws or local laws."; public static final String RESPONSE_5C = "Loss of access to University computing resources after the disciplinary process."; public static final String RESPONSE_5D = "All of the above."; public static final String ANSWER_5 = "*"; // Replace with correct answer (a, b, c, or d)
To further aid you in developing your program, the following example main method has been provided from the instructor's solution. You may design and code your program accordingly, if you wish:
public static void main(String[] args) { int totalScore = 0; Scanner console = new Scanner(System.in); totalScore += askQuestion(console, 1, QUESTION_1, RESPONSE_1A, RESPONSE_1B, RESPONSE_1C, RESPONSE_1D, ANSWER_1); totalScore += askQuestion(console, 2, QUESTION_2, RESPONSE_2A, RESPONSE_2B, RESPONSE_2C, RESPONSE_2D, ANSWER_2); totalScore += askQuestion(console, 3, QUESTION_3, RESPONSE_3A, RESPONSE_3B, RESPONSE_3C, RESPONSE_3D, ANSWER_3); totalScore += askQuestion(console, 4, QUESTION_4, RESPONSE_4A, RESPONSE_4B, RESPONSE_4C, RESPONSE_4D, ANSWER_4); totalScore += askQuestion(console, 5, QUESTION_5, RESPONSE_5A, RESPONSE_5B, RESPONSE_5C, RESPONSE_5D, ANSWER_5); printScore(totalScore); } NOTES:
Your program should calculate and display the correct score given the right answers.
Each correct answer is worth 20 points towards a total possible score of 100.
It is up to you to determine what is the correct answer to each question and replace the asterisks in the constants ANSWER_1, ANSWER_2, etc, in your program accordingly.
The example main method shown above is recommended but does not need to be used.
If developing your own version of the askQuestion method, please recognize each of the parameters as they all have a purpose within the method and that the return type of the method is int, with 0 returned if the user answers the question incorrectly and 20 points returned for a correct answer.
To further aid you should you wish to use it, the prototype (declaration sans implementation code within) of the instructor's askQuestion method is as follows
/** * Prompts the user with a supplied question along with supplied multiple choice responses, * gets their response and if the response is correct given the supplied answer returns the * appropriate points for that correct answer else 0 points are returned. * * @param console - For reading user input * @param questionNum - integer value of the question number (e.g. 1, 2, 3). * @param question - The question. * @param respA - Response a. * @param respB - Response b. * @param respC - Response c. * @param respD - Response d. * @param answer - Correct answer to the question. * @return */ public static int askQuestion(Scanner console, int questionNum, String question, String respA, String respB, String respC, String respD, String answer) { // Your code goes here } See the output specification below for how your program's output should look.
Submit your working program as ResponsibleUse.
OUTPUT SPECIFICATION
Question #1: Which is NOT a purpose Millersville University makes electronic resources available to faculty, staff, and students? a. For conducting official University business. b. For academic scholarship. c. For research. d. For student access to social media sites. Please enter a, b, c, or d: * Question #2: Which usage is NOT described in the "Policy for Responsible Use"? a. Electronic Mail b. Network Use c. Crypto-currency d. User Accounts Please enter a, b, c, or d: * Question #3: Under which topic is improper printing of documents covered? a. Electronic Mail b. Network Use c. Webpages d. Software Please enter a, b, c, or d: * Question #4: The "Privacy and Confidentiality of Electronic Media" portion of the policy states that? a. The University may be required to provide information stored in its system if so compelled by a court order. b. Your privacy should be presumed at all times. c. The University will routinely monitor and review the contents of your user accounts. d. The University does not abide by recent court decisions regarding privacy and "Right to Know." Please enter a, b, c, or d: * Question #5: Consequences of violating the policy includes? a. Loss of access to University computing systems pending disciplinary process. b. Possible prosecution under State laws or local laws. c. Loss of access to University computing resources after the disciplinary process. d. All of the above. Please enter a, b, c, or d: * Your score: 100%
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
