Final Project ITEC 2260 Objectives: Students will demonstrate they can write code that will - Read a text file and copy the contents into an array - Declare arrays and insert values into arrays -...

ATTACHED


Final Project ITEC 2260 Objectives: Students will demonstrate they can write code that will - Read a text file and copy the contents into an array - Declare arrays and insert values into arrays - Compare the contents of two arrays - Use counters to keep track of number of values - Use if statements A certain ITEC exam has 20 multiple choice questions. Here are the correct answers: 1. B 11. B 2. D 12. C 3. A 13. D 4. A 14. A 5. C 15. D 6. A 16. C 7. B 17. C 8. B 18. B 9. C 19. D 10. D 20. A Create a program that: 1. Creates an array of string that stores the correct answers (5 points). The array only has the letter, not the question number. Remember the array index starts at 0. 2. Create a text file called Response.txt that is a simulation of a student answering the questions (5 points). Only write the letter answer and only one letter per line. Remember your file must have 20 lines of answers from A, B, C or D. See following example: A C B D C A C D B C D A B A D C A D C B 3. Your program should read the text file and store the answers in an array (10 points). 4. After the student’s answers are read from the file and stored in the array, the program should compare the array with correct answers and the array with the student’s answer and determine how many answers are correct and how many are incorrect (20 points). 5. The program should display a message indicating whether the student passed or failed the exam (5 points). Passing grade is 14 correct answers. 6. The program should then display the total number of correct answers, the total number of incorrect answers, and a list showing the question numbers of the incorrectly answered questions (55 points). Hints: • This program only requires techniques from Chapters 1 to 7. • Create 2 arrays of strings. One array to hold the correct answers and the other array to hold student’s answer. • Let’s say you created 2 arrays. One array you named A and the other B. To compare elements from the two Arrays, one called A and one called B, you must compare one element at a time. The best way to process the arrays is using a for loop. If you can’t remember how to make the loop, you can write the code to check each individual components: Example: int correct = 0; // correct counter int incorrect = 0; // incorrect counter if (A[0] == B[0]) { // Here you write code to increase correct counter } else { // Here you write code to increase incorrect counter and // store question number missed. } if (A[1] == B[1]) { // Here you write code to increase correct counter } else { // Here you write code to increase incorrect counter and // store question number missed. } if (A[2] == B[2]) { // Here you write code to increase correct counter } else { // increase incorrect counter store question number missed. } . and so forth until the last element: if (A[19] == B[19]) { // increase correct counter } else { // increase incorrect counter // store question number missed. } . . • Use counters to keep track of correct and incorrect answers. • To display the question number that was missed, you can build a string and concatenate the missed question number. See video on how build a string at : https://www.youtube.com/watch?v=k6aa3CjcE24&t=20s https://www.youtube.com/watch?v=k6aa3CjcE24&t=20s https://www.youtube.com/watch?v=k6aa3CjcE24&t=20s Disclaimer about the video. The video is an example of how to build a string. The code in the video has to be modified to work for the final project.
Mar 02, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here