Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Design a program that will allow some number of grades (up to a max of 100) to be input by the user. After the data has been collected, your program should calculate and output the mean and median of the collected data, as well as the sorted grade information.

Design Constraints

  1. Use an integer constant of 100 to specify the number of elements in the array you will use to collect the grade information.
  2. Do not use any global variables in your program.
  3. Declare any arrays you need in your main function and pass the arrays as needed into the functions described below.
  4. The main function is the only function permitted to do any output to the console!!! Do not do cout operations inside of any other function.
  5. Your data collection loop in your main function must allow the user to enter less than 100 grades. It must also make sure that the user does not try to enter more than 100 grades.
  6. Each data value entered should be checked to make sure it is between 0 and 100. Any other value entered should be considered invalid and ignored (ie. not counted as a valid input and not stored in an array).
  7. Once the data is collected, the array and the number of grades collected must be passed to a function called mean.
  8. The mean function must loop through the values in the array, summing them together. The result of the function is the sum divided by the number of grades collected. The result must be returned from the mean function to the main function, where is it output in an appropriate manner (two digits after the decimal point).
  9. The main function should then pass the array and the number of grades collected to the median function.
  10. The median of a set of numbers is the number in the set where half the numbers are above it and half the numbers are below it. In order to find the median, this function will need to sort the original data.
  11. The simplest sorting procedure is called bubble sorting. The following pseudocode describes bubble sorting for Xvalid array elements.

for outer = 0; outer < X; outer++

for inner = 0; inner < X-1; inner++

if array[inner] > array[inner+1]

          swap(array[inner], array[inner+1]);

  1. After the data has been sorted, the median value can be found. If the array has an odd number of elements the median is the value of the middle element (Hint: arraySize/2 is the middle element). If the array has an even number of elements then the median is the average of the middle two elements (Hint: arraySize/2 and ( arraySize/2) - 1 are the two middle elements). The median value should be returned by the median function.
  2. The main routine should output the median value in an appropriate manner.
  3. The main routine should also output the sorted array with 5 grades per line.
  4. Carefully develop test cases for your program. Most of your test cases do not need to contain lots of values. Make sure to include incorrect inputs such as negative grade values. Calculate what your mean and median values should be for your test cases. Document your test cases in a Word document.
  5. Run your test cases with your program to see if your program generates the expected output. If not, troubleshoot your program and fix the problem. When your program executes a test case correctly, take a screen shot of the program output and paste it into your Word document to prove that your test case executed correctly with your program.
  6. Make sure that your code is properly formatted! You also need to make sure you include a comment block for each function which documents the purpose, inputs, and outputs of each function!

 

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M9886194

Have any Question?


Related Questions in Computer Engineering

Biodiversity refers to the variety of living organisms

Biodiversity refers to the variety of living organisms found within an ecosystem. In your description, evaluate the role of humans in the current biodiversity loss situation and increased species extinction rate. In addi ...

Mary kate is a project manager in the it department for a

Mary Kate is a project manager in the IT department for a university. She has been asked to manage a project to create faculty intranet. The university has multiple campuses in various locations, and professors and other ...

What is unified threat management utm and the services it

What is Unified Threat Management (UTM) and the services it combines into one device. Does UTM holds true to the principle of defense-in-depth

Assignmentthe results of the spec cpu2006 bzip2 benchmark

Assignment The results of the SPEC CPU2006 bzip2 benchmark running on an AMD Barcelona has an instruction count of 2.389E12, an execution time of 750 s, and a reference time of 9650 s. 1) Find the CPI if the clock cycle ...

Question suppose you have three non-empty stacks r s and t

Question : Suppose you have three non-empty stacks R, S, and T. Describe a sequence of Stack operations that results in S storing all elements originally in T below all of S's original element with both sets of those ele ...

Question share your favorite open web resource and what

Question : Share your favorite open web resource and what cool tools does it have? What can you learn from it? How will it help as a career resource? What is your favorite learning express or JCA course, tool, or Page. W ...

Decision support systems dss what sorts of dss tools do you

Decision support systems (DSS). What sorts of DSS tools do you use at your work - e.g., what-if analysis, sensitivity analysis, scenario analysis, goal-seeking analysis, optimization analysis, etc.? Even if you don't use ...

You get hired as a machine learning expert at moviescom

You get hired as a Machine learning expert at movies.com. Your task on day one is to improve the performance of a classifier. You divide the data into 2 parts training, and testing. You learn a model from the training da ...

Compare remote authentication dial-in user service radius

Compare Remote Authentication Dial-In User Service (RADIUS) and Terminal Access Controller Access-Control System Plus (TACACS+).

Can someone help me with traceroute of massachusettsnbspuse

Can someone help me with traceroute of massachusetts  Use traceroute to trace the route from your home or work computer to your university's website. Show the traceroute output. What networks were encountered along the w ...

  • 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