Design and implement a simple program that processes examination scores from a data file. The program...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Design and implement a simple program that processes examination scores from a data file. The program will determine statistics about the examination, including letter grade counts, and then print the data to the console as well as save the data to a new output file. Problem Description The description is somewhat simple. For this project, you will be writing code to process exam grade data. The processing will include calculating the average, the median, and the standard deviation of the population. A sample input file features numbers separated by a single white space, like so: 57 80 100 95 55 78 61 53 84 34 69 74 70 74 71 87 26 83 83 79 37 74 85 67 38 82 72 38 74 16 81 81 80 92 82 86 64 56 69 41 81 80 71 59 71 81 77 68 88 67 58 43 75 96 72 81 42 62 75 85 And the output after all data processing should have the format: Exam Stats Number of scores: 60 Average score: 69.33 Standard deviation: 17.80 ALL CO A count: 4 6.67% B count: 18 30.00% COL 15 25.00% 13.33% F count: 15 25.00% C count: D count: 8 Minimum score: 16 Maximum score: 100 All decimals numbers must be rounded to two decimals places for this project. Project Requirements Functional Requirements You will receive an unknown number of exam scores from the input file. A valid score must be between 0 and 100. If a number is larger than 100 or smaller than 0, that number should be ignored and not included in the exam stats. ● The scores must be used to calculate the exam stats and print them to the output file. ● The program must request the input filename from the user through the console. If the file doesn't exist, the user should be informed and prompted again until they give one that does exist. ● The output must contain: o The total exam count (not including bad data, like negatives or outside range) o The average score O O O O The population standard deviation of the scores The number and percentage of scores for each letter grade group The minimum score The maximum score As mentioned, all decimals must be rounded to two decimal places The following formulas are needed for this project: Average: The average score is the sum of the individual scores divided by the total number of scores. Avoid integer division. If N is the total number of scores and x1, x2, ..., xN are the scores (and avg is abbreviation for average), then O avg = O x1 + x2 + N +xN Population standard deviation: The difference of each score and the average squared, added, divided by N, and take the square root of the result. Given the notation from the average formula (and std is abbreviation for standard deviation), then std = (avg − x1)² + (avg − x2)² + ... + (avg − xN)² - N CS160 Introduction to Computer Science I Technical Requirements Spring 2022 Name your class ExamStats. You must use constant variables to store the lower score limits for letter grade groups. 90, 80, 70, and 60 coincide to the lower bounds for grades A, B, C, D. For these constants, declare them above the main method (but still inside the class brackets) as static final variables - this is a new concept, called a class variable You will need variables to hold data such as minimumScore, maximumScore, totalCount, count of various grades, etc. • Make sure you use a Scanner object and File object for reading the file You also need a Scanner object for getting the file name from the user through the console. ● Make sure to use a while loop to process the text file – determining what goes inside the while loop is up to you. After the while loop, you should calculate the average • Then, you must read the file again to calculate the standard deviation! The reason for this is you need to calculate the (average score) for every score! This second while loop will Make sure to use a while loop to process the text file – determining what goes inside the while loop is up to you. After the while loop, you should calculate the average • Then, you must read the file again to calculate the standard deviation! The reason for this is you need to calculate the (average - score) for every score! This second while loop will be similar to the first one. • After all the calculation is finished, output to the file and the console. Documentation Requirements • Place a comment above the class, using /** style comments */, that includes your name and briefly describes the project • Put a comment in your code before every major block of the problem – it is up to you what you consider major enough to comment on Testing Test using the data in this document first. Once you match that data, create and test a few more test cases on your own. Some test cases to be sure to check include: • • Files with negative numbers Files with numbers above 100! Files that don't exist (or incorrect file name given) Remember that if your code is not tested, it is unreliable! Test as many cases as you feel will be useful. It may also be a good idea to test small files that you can easily calculate the average and std for (either by hand or online) so you can check your work in that fashion. Here is a helpful calculator for such stats, to help you test (remember to look at population standard deviation): https://www.easycalculation.com/statistics/standard-deviation.php Below are a few more samples of data to test Sample 1 Scores 31 87 26 83 83 79 37 74 85 67 82 72 38 74 16 81 81 80 92 82 86 64 56 69 41 81 71 59 71 81 77 68 88 67 58 43 75 96 72 81 42 62 75 85 90 100 94 80 80 80 60 65 40 72 63 52 74 85 74 85 24 48 Sample 1 Output Exam Stats Number of scores: 62 Average score: 69.10 Standard deviation: 18.87 A count: 5 B count: 20 C count: 13 D count: 9 F count: 15 8.06% 32.26% 20.97% Sample 2 Scores 14.52% 24.19% Minimum score: 16 Maximum score: 100 110 90 90 95 95 60 75 71 92 88 100 -90 Sample 2 Output Exam Stats Number of scores: 10 Average score: 85.6 Standard deviation: 12.04 A count: 6 60.00% B count: 1 10.00% C count: 2 20.00% D count: 1 10.00% F count: 0 0.00% 612 Minimum score: 60 Maximum score: 100 Hand-In Submit your zipped project folder to Blackboard. Evaluation Correctness (80 points). These points will be allocated as follows: 5 points for correct constant set up 10 points for correct file solicitation and opening 25 points for correctly performing the first while loop and getting the average, min, max 15 points for correctly performing the second while loop and getting the std 25 points for the correct output report Design (10 points). These points will be allocated based on data fields, methods, classes, and algorithms used to complete the design of the required classes. Documentation and Style (10 points): Your code should have a clean, professional appearance. Remember to put your name and the project name at the top of all code files Design and implement a simple program that processes examination scores from a data file. The program will determine statistics about the examination, including letter grade counts, and then print the data to the console as well as save the data to a new output file. Problem Description The description is somewhat simple. For this project, you will be writing code to process exam grade data. The processing will include calculating the average, the median, and the standard deviation of the population. A sample input file features numbers separated by a single white space, like so: 57 80 100 95 55 78 61 53 84 34 69 74 70 74 71 87 26 83 83 79 37 74 85 67 38 82 72 38 74 16 81 81 80 92 82 86 64 56 69 41 81 80 71 59 71 81 77 68 88 67 58 43 75 96 72 81 42 62 75 85 And the output after all data processing should have the format: Exam Stats Number of scores: 60 Average score: 69.33 Standard deviation: 17.80 ALL CO A count: 4 6.67% B count: 18 30.00% COL 15 25.00% 13.33% F count: 15 25.00% C count: D count: 8 Minimum score: 16 Maximum score: 100 All decimals numbers must be rounded to two decimals places for this project. Project Requirements Functional Requirements You will receive an unknown number of exam scores from the input file. A valid score must be between 0 and 100. If a number is larger than 100 or smaller than 0, that number should be ignored and not included in the exam stats. ● The scores must be used to calculate the exam stats and print them to the output file. ● The program must request the input filename from the user through the console. If the file doesn't exist, the user should be informed and prompted again until they give one that does exist. ● The output must contain: o The total exam count (not including bad data, like negatives or outside range) o The average score O O O O The population standard deviation of the scores The number and percentage of scores for each letter grade group The minimum score The maximum score As mentioned, all decimals must be rounded to two decimal places The following formulas are needed for this project: Average: The average score is the sum of the individual scores divided by the total number of scores. Avoid integer division. If N is the total number of scores and x1, x2, ..., xN are the scores (and avg is abbreviation for average), then O avg = O x1 + x2 + N +xN Population standard deviation: The difference of each score and the average squared, added, divided by N, and take the square root of the result. Given the notation from the average formula (and std is abbreviation for standard deviation), then std = (avg − x1)² + (avg − x2)² + ... + (avg − xN)² - N CS160 Introduction to Computer Science I Technical Requirements Spring 2022 Name your class ExamStats. You must use constant variables to store the lower score limits for letter grade groups. 90, 80, 70, and 60 coincide to the lower bounds for grades A, B, C, D. For these constants, declare them above the main method (but still inside the class brackets) as static final variables - this is a new concept, called a class variable You will need variables to hold data such as minimumScore, maximumScore, totalCount, count of various grades, etc. • Make sure you use a Scanner object and File object for reading the file You also need a Scanner object for getting the file name from the user through the console. ● Make sure to use a while loop to process the text file – determining what goes inside the while loop is up to you. After the while loop, you should calculate the average • Then, you must read the file again to calculate the standard deviation! The reason for this is you need to calculate the (average score) for every score! This second while loop will Make sure to use a while loop to process the text file – determining what goes inside the while loop is up to you. After the while loop, you should calculate the average • Then, you must read the file again to calculate the standard deviation! The reason for this is you need to calculate the (average - score) for every score! This second while loop will be similar to the first one. • After all the calculation is finished, output to the file and the console. Documentation Requirements • Place a comment above the class, using /** style comments */, that includes your name and briefly describes the project • Put a comment in your code before every major block of the problem – it is up to you what you consider major enough to comment on Testing Test using the data in this document first. Once you match that data, create and test a few more test cases on your own. Some test cases to be sure to check include: • • Files with negative numbers Files with numbers above 100! Files that don't exist (or incorrect file name given) Remember that if your code is not tested, it is unreliable! Test as many cases as you feel will be useful. It may also be a good idea to test small files that you can easily calculate the average and std for (either by hand or online) so you can check your work in that fashion. Here is a helpful calculator for such stats, to help you test (remember to look at population standard deviation): https://www.easycalculation.com/statistics/standard-deviation.php Below are a few more samples of data to test Sample 1 Scores 31 87 26 83 83 79 37 74 85 67 82 72 38 74 16 81 81 80 92 82 86 64 56 69 41 81 71 59 71 81 77 68 88 67 58 43 75 96 72 81 42 62 75 85 90 100 94 80 80 80 60 65 40 72 63 52 74 85 74 85 24 48 Sample 1 Output Exam Stats Number of scores: 62 Average score: 69.10 Standard deviation: 18.87 A count: 5 B count: 20 C count: 13 D count: 9 F count: 15 8.06% 32.26% 20.97% Sample 2 Scores 14.52% 24.19% Minimum score: 16 Maximum score: 100 110 90 90 95 95 60 75 71 92 88 100 -90 Sample 2 Output Exam Stats Number of scores: 10 Average score: 85.6 Standard deviation: 12.04 A count: 6 60.00% B count: 1 10.00% C count: 2 20.00% D count: 1 10.00% F count: 0 0.00% 612 Minimum score: 60 Maximum score: 100 Hand-In Submit your zipped project folder to Blackboard. Evaluation Correctness (80 points). These points will be allocated as follows: 5 points for correct constant set up 10 points for correct file solicitation and opening 25 points for correctly performing the first while loop and getting the average, min, max 15 points for correctly performing the second while loop and getting the std 25 points for the correct output report Design (10 points). These points will be allocated based on data fields, methods, classes, and algorithms used to complete the design of the required classes. Documentation and Style (10 points): Your code should have a clean, professional appearance. Remember to put your name and the project name at the top of all code files
Expert Answer:
Answer rating: 100% (QA)
Below is a simple Java program that meets the specified requirements import javautilScanner import javaioFile import javaioFileNotFoundException import javaioPrintWriter public class ExamStats Constan... View the full answer
Related Book For
Process Dynamics And Control
ISBN: 978-0471000778
2nd Edition
Authors: Dale E. Seborg, Thomas F. Edgar, Duncan A. Mellich
Posted Date:
Students also viewed these programming questions
-
Question 3 The table below shows information on the demand and supply for bicycles, where the quantities of bicycles are measured in thousands. Price $120 $140 $160 $180 $200 Qd 60 50 40 30 20 Qs 20...
-
A researcher wanted to find out if there was difference between older movie goers and younger movie goers with respect to their estimates of a successful actors income. The researcher first...
-
4. (10 marks). Suppose f is a differentiable and one-to-one function. (a) Use integration by parts to prove that - dx [ ^'(x) dx = x(x) [ (1(x)) dr (b) With y=f-1(x), show that f-1(x) - f(y) dy [(x)...
-
NIU Company's budgeted sales and direct materials purchases are as follows: NIU's sales are 40% cash and 60% credit. It collects credit sales 10% in the month of sale, 50% in the month following...
-
In Exercises, compute AB by block multiplication, using the indicated partitioning a. b. 00:11 31:00 2100 0 0|3 0 I 1-0 -00 01 42 10 53 0012 0 4
-
What opportunities are available for a taxpayer to defer the recognition of certain types of prepaid income? That is, what advice could you give someone who wishes to defer the reporting of prepaid...
-
A single-step income statement appears at the top of the following page. Present the information in a multistep income statement, and indicate what insights can be obtained from the multistep form as...
-
Comprehensive Fixed-Asset Problem Darby Sporting Goods Inc. has been experiencing growth in the demand for its products over the last several years. The last two Olympic Games greatly increased the...
-
Explain the various methods that are used in financial forecasting
-
Create a detailed diagram of all the stakeholders of Willow Springs. How is each of the stakeholders affected by the water parks actions? What conclusions can you draw from this analysis? Explain.
-
How does the decision-making process vary between high-involvement and low-involvement consumer purchases?
-
Compare and contrast variable, fixed, and joint costs.
-
_____ is the intention and ability to listen to others, use the content and context of the communication, and respond appropriately.
-
_____ is a review of all of the tasks and requirements of the job, both good and bad.
-
Explain the value proposition offered by freight forwarding. Provide an example that illustrates why shippers would be attracted to using the services of a freight forwarder as contrasted to...
-
_____ is the process of choosing the best-qualified applicant recruited for a job.
-
Which of the following manufacturers would most likely NOT use a process costing system? A builder of custom yachts. A producer of computer monitors. A paint manufacturer. A lumber mill. A producer...
-
On April 29, 2015, Auk Corporation acquires 100% of the outstanding stock of Amazon Corporation (E & P of $750,000) for $1.2 million. Amazon has assets with a fair market value of $1.4 million (basis...
-
Starting with a Simulink model of the recycle process, implement a reactor level controller using F as the manipulated variable. Confirm via simulation that control scheme Alternative 1 works...
-
Evaluate any two of the four alternatives we have looked at in this chapter, (i.e., Exercises 23.3, 23.4a, and/or 23.6). (a) Compare the responses of each control structure to step changes in reactor...
-
Expand each of the following s-domain functions into partial tractions: 6(s + 1) (a) Y(s) 5(s + 1) 12(s + 2) s(3? + 9) (b) Y(s) (s + 2)(s + 3) (s + 4)(s + 5)(s + 6) (c) Y(s) (d) Y(s) %3D I(s + 1)? +...
-
What are the main tasks of the board of directors? R1
-
Identify four ways in which the independence of an auditor of a large listed company may be strengthened. E1
-
Why have institutional shareholders become more active in corporate governance issues in recent years? R4
Study smarter with the SolutionInn App