Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Examination Statistics Assignment

Learning Outcomes

  • Recognize and apply the software development phases
  • Utilize Java syntax in fundamental programming algorithms
  • Recognize and apply the various input and output devices in programming
  • Recognize and apply the various control structures
  • Design and implement user defined methods

Objectives - In completing this project you will gain experience with the following Java features:

  • the Scanner class
  • formatting
  • selection structures
  • iteration structures
  • file input-output

Problem Statement - Processing large amount of data to obtain statistical information is a frequent computer application in many areas. The most frequently calculated parameters are the average, the median and the population standard deviation.

In this project you implement a program that

  • reads examination scores from a file
  • determines the total number of scores in the file
  • calculates the average score
  • determines the maximum score and the minimum score
  • calculates the population standard deviation
  • determines the number of examination in each of the letter grade groups A, B, C, D, F
  • makes the output message displayed on the console, and writes the output to a file, as well.

Analysis and Requirements -

Input

  • named constants to store the lower score limits for the letter grade groups, these are 85, 75, 65, 55 in the order of grades A, B, C, D
  • an undetermined number of exam scores stored on an external input file; each number is an integer between 0 and 100
  • the name of the input file to be solicited from the user on the console

Output - The output will contain the following data:

  • The total number of examinations
  • The average score
  • The population standard deviation of the scores
  • The minimum score
  • The maximum score
  • The number as well as the percentage of scores in each letter grade group

A template to be followed in displaying the output is shown below (Figure 1). Your actual output may have other numerical values. Decimals must be rounded to two digits after the point. Use printf or String.format to get the output properly formatted.

Design - For this project you shall define a classes named ExamStatistics.

Add four static named constant fields to store the lower limits of the grade groups, see in Input above.

These variable are declared in the class but outside of the main method.

Within the main method, create commented places for codes responsible for various tasks.

Declare variables

You will need

  • six integer variables for counting; one counter variable is used to count the total number of scores on the file, and one additional variable is needed to count the scores for each of the grades A, B, C, D and F
  • three integer variables minScore, maxScore, nextScore; minScore and maxScore are used to store the lowest and highest score values, nextScore stores score currently read from the file
  • three double variables to store sum, average and psd
  • two String variables to store the output message and the file name

Declare and instantiate a Scanner object keyboard for console reading

Declare and instantiate a File object to the file name solicited and received from the console

Check if the file exists and repeat file name solicitation until the name accepted (a loop will be used)

Declare and instantiate another Scanner object reader to read data from the file

Run a while loop to read, count and sum the scores ("running total"); the loop must also have logic to determine maxScore, minScore, and must count the occurrences of scores in the grade groups; input values are checked, wrong input are not counted and they are ignored in the processing that is, the loop continues at the next iteration. Wrong input does not update any of the counter variables, neither the sum, maxScore and minScore variables. Note that every correct input must be fully processed at the reading; only the data currently read from the file can be stored internally by the code.

Compute the average

Re-instantiate the file reader Scanner object, you need a new Scanner since you have to read the file again

Run a for loop that makes the summation for psd, see the formula for psd

Compute psd

Compose the output message, use the String.format( ) method

Display the message on the console

Instantiate a PrintWriter object and write the output to a file named ExamStatFile

Implementation Requirements and Hints

  • Having the name of the input file read from the console, the name shall be saved in a variable, say inputFileName
  • To validate the file name

(i) declare a File object

(ii) run a while loop in which solicit, read and save a candidate for the file name

(iii) instantiate the File object to the file name

(iv) check if the file exists, if it does not, continue the loop, otherwise stop the loop

First file reading:

  • In the while loop that reads the scores from the file

(i) Save the currently read input in nextScore

(ii) You may assume that the data read is numeric value, but the input must validated to the required bounds; wrong input is ignored, the loop turns to the next iteration

(iii) Update the total counter

(iv) Check if nextScore is greater than maxScore, if so update maxScore with nextScore

(v) Repeat the checking for minScore

(vi) Apply a nested if else if structure to determine the grade group relevant for nextScore and update the group counter; as an alternate option you are allowed to use a properly crafted switch statement rather than if-else statements

(vii) Add nextScore to sum

  • After the loop, compute average by applying the average formula; care for the integer division, average must be exact

Second file reading:

  • Note that the score data are not stored internally by the program, and to compute the standard deviation (psd) the average must have been determined. Therefore average and psd cannot be simultaneously calculated in one file reading process. In order to compute the value of psd, the file containing the data (inputFileName) must be read once more by a new Scanner
  • As for the second reading of the file, a for loop is applicable since the total number of admissible items in the file is known. Input evaluation is still necessary to discard the wrong inputs. You may decide if you want to use a while loop for the second reading, or you want to apply a for loop.
  • Having the second loop completed and psd determined, the output message containing the obtained results must be built; decimal numbers in the output must be formatted and rounded to two digits after the point
  • Declare and instantiate a PrintWriter object to write the output to a file named ScoreStatistics.txt
  • Print the output to console and write output to file as required
  • Start your work on this project without delay.

 

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92808842
  • Price:- $40

Priced at Now at $40, Verified Solution

Have any Question?


Related Questions in Computer Engineering

Why should one listen to peter drucker in other words what

Why should one listen to Peter Drucker? In other words, what are his credentials/expertises? Provide at least three reasons. Copy question to the beginning of answer.

Select two application areas for data mining not discussed

Select two application areas for data mining NOT discussed in the text book and briefly discuss how data mining is being used to solve a problem (or to explore an opportunity)?

Question write a minimum of 100 words for each question

Question: Write a minimum of 100 words for each question. Provide Citation and reference for each question. Provide two responses for each question. 1. Let us suppose we are designing a computer for use for a graphic art ...

Suppose there are n people in a team the coach wants to

Suppose there are n people in a team. The coach wants to know how many different pairs of people he can choose in a team. Write a program in C that shows the coach, the total number of different pairs he can choose in th ...

Scheme questionthe following program can be used to

Scheme Question The following program can be used to determine if a given interpreter is using applicative-order evaluations or normal-order evaluation: (define (p)(p)) (define (test x y) (if (= x 0) 0 y)) (test 0 (p)) ( ...

Question suppose we decide to add a new operation to our

Question : Suppose we decide to add a new operation to our Stack ADT called sizeIs, which returns avalue of primitive type int equal to the number of items on stack. The method signature for sizeIs is public int sizeIs() ...

Explain the differences between working in the web based

Explain the differences between working in the web based version of Outlook in Office 365 to the desktop application version of Outlook.

By chance does any know what percentage of the world gdp

By chance does any know What percentage of the world GDP has the Global 500 contributed most recently?

Taskyour task is to implement the hangman game in python

Task Your task is to implement the Hangman game in Python. Before implementing the game, please play the game on the website mentioned above. It will help you understand the project. Project Specifications: 1) Output a b ...

Explain why a successful information security program is

Explain why a successful information security program is the shared responsibility of an organizations three communities of interest.

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As