SlideShare une entreprise Scribd logo
1  sur  2
Télécharger pour lire hors ligne
COMP122 Lab 6 Lab Report
and Source Code
Click Link Below To Buy:
http://hwcampus.com/shop/comp-122/comp122-lab-6-lab-report-and-source-code/
Or Visit www.hwcampus.com
Product Description
COMP122
Week 6 iLab
You are to 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
Use an integer constant of 100 to specify the number of elements in the array you will
use to collect the grade information. Do not use any global variables in your program.
Declare any arrays you need in your main function and pass the arrays as needed into
the functions described below. 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.
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. 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). Once the data is collected, the array and
the number of grades collected must be passed to a function called mean. 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). The main function should then
pass the array and the number of grades collected to the median function. 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. The simplest sorting procedure is called bubble sorting. The
following pseudocode describes bubble sorting for X valid array elements.
for ; outer < x;=”” outer++=””>
for ; inner < x-1;=”” inner++=””>
if array[inner] > array[inner+1]
swap(array[inner], array[inner+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. The main routine should output the median value in an appropriate manner.
The main routine should also output the sorted array with 5 grades per line. 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. 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. 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!
Create a program using Visual C++.Net. Make sure to capture a screen shot of your
program running your test cases! The best way to do this is to click on the console
window you want to capture and then press the Alt and PrintScreen keys at the same
time. Then paste your captured screen image into your Word document. Your Word
document should contain your test cases, the screen shots documenting your test
cases, followed by a copy of your source code.

Contenu connexe

Plus de Laynevine

Crj 105 week 6 assignment 3 annotated bibliography
Crj 105 week 6 assignment 3   annotated bibliographyCrj 105 week 6 assignment 3   annotated bibliography
Crj 105 week 6 assignment 3 annotated bibliographyLaynevine
 
Com 295 week 2 knowledge check study guide
Com 295 week 2 knowledge check study guideCom 295 week 2 knowledge check study guide
Com 295 week 2 knowledge check study guideLaynevine
 
Cmgt400 entire class
Cmgt400 entire classCmgt400 entire class
Cmgt400 entire classLaynevine
 
Cmgt 583 entire class
Cmgt 583 entire classCmgt 583 entire class
Cmgt 583 entire classLaynevine
 
Cmgt 583 entire class
Cmgt 583 entire classCmgt 583 entire class
Cmgt 583 entire classLaynevine
 
Cmgt 554 entire course
Cmgt 554 entire courseCmgt 554 entire course
Cmgt 554 entire courseLaynevine
 
Cmgt 441 complete course
Cmgt 441 complete courseCmgt 441 complete course
Cmgt 441 complete courseLaynevine
 
Cmgt 410 ver.13 entire class
Cmgt 410 ver.13 entire classCmgt 410 ver.13 entire class
Cmgt 410 ver.13 entire classLaynevine
 
Cis 329 wk 6 quiz 2
Cis 329 wk 6 quiz 2Cis 329 wk 6 quiz 2
Cis 329 wk 6 quiz 2Laynevine
 
Cis 329 week 11 quiz 4
Cis 329 week 11 quiz 4Cis 329 week 11 quiz 4
Cis 329 week 11 quiz 4Laynevine
 
Cis 329 week 8 quiz 3
Cis 329 week 8 quiz 3Cis 329 week 8 quiz 3
Cis 329 week 8 quiz 3Laynevine
 
Cis 329 week 4 quiz 1
Cis 329 week 4 quiz 1Cis 329 week 4 quiz 1
Cis 329 week 4 quiz 1Laynevine
 
Cis 329 lab 1 to 15
Cis 329 lab 1 to 15Cis 329 lab 1 to 15
Cis 329 lab 1 to 15Laynevine
 
Bus 650 managerial finance entire class
Bus 650 managerial finance entire classBus 650 managerial finance entire class
Bus 650 managerial finance entire classLaynevine
 
Bus 611 entire class all assignments
Bus 611 entire class all assignmentsBus 611 entire class all assignments
Bus 611 entire class all assignmentsLaynevine
 
Bus 611 entire class all assignments
Bus 611 entire class all assignmentsBus 611 entire class all assignments
Bus 611 entire class all assignmentsLaynevine
 
Bus 520 wk 3 assignment 1 finding the leader in you self-assessment johari ...
Bus 520 wk 3 assignment 1   finding the leader in you self-assessment johari ...Bus 520 wk 3 assignment 1   finding the leader in you self-assessment johari ...
Bus 520 wk 3 assignment 1 finding the leader in you self-assessment johari ...Laynevine
 
Bus 519 assignment 3 risk workshop and risk register
Bus 519 assignment 3   risk workshop and risk registerBus 519 assignment 3   risk workshop and risk register
Bus 519 assignment 3 risk workshop and risk registerLaynevine
 
Bus 519 assignment 2 risk management plan
Bus 519 assignment 2   risk management planBus 519 assignment 2   risk management plan
Bus 519 assignment 2 risk management planLaynevine
 
Bus 519 assignment 1 assess organizational readiness
Bus 519 assignment 1   assess organizational readinessBus 519 assignment 1   assess organizational readiness
Bus 519 assignment 1 assess organizational readinessLaynevine
 

Plus de Laynevine (20)

Crj 105 week 6 assignment 3 annotated bibliography
Crj 105 week 6 assignment 3   annotated bibliographyCrj 105 week 6 assignment 3   annotated bibliography
Crj 105 week 6 assignment 3 annotated bibliography
 
Com 295 week 2 knowledge check study guide
Com 295 week 2 knowledge check study guideCom 295 week 2 knowledge check study guide
Com 295 week 2 knowledge check study guide
 
Cmgt400 entire class
Cmgt400 entire classCmgt400 entire class
Cmgt400 entire class
 
Cmgt 583 entire class
Cmgt 583 entire classCmgt 583 entire class
Cmgt 583 entire class
 
Cmgt 583 entire class
Cmgt 583 entire classCmgt 583 entire class
Cmgt 583 entire class
 
Cmgt 554 entire course
Cmgt 554 entire courseCmgt 554 entire course
Cmgt 554 entire course
 
Cmgt 441 complete course
Cmgt 441 complete courseCmgt 441 complete course
Cmgt 441 complete course
 
Cmgt 410 ver.13 entire class
Cmgt 410 ver.13 entire classCmgt 410 ver.13 entire class
Cmgt 410 ver.13 entire class
 
Cis 329 wk 6 quiz 2
Cis 329 wk 6 quiz 2Cis 329 wk 6 quiz 2
Cis 329 wk 6 quiz 2
 
Cis 329 week 11 quiz 4
Cis 329 week 11 quiz 4Cis 329 week 11 quiz 4
Cis 329 week 11 quiz 4
 
Cis 329 week 8 quiz 3
Cis 329 week 8 quiz 3Cis 329 week 8 quiz 3
Cis 329 week 8 quiz 3
 
Cis 329 week 4 quiz 1
Cis 329 week 4 quiz 1Cis 329 week 4 quiz 1
Cis 329 week 4 quiz 1
 
Cis 329 lab 1 to 15
Cis 329 lab 1 to 15Cis 329 lab 1 to 15
Cis 329 lab 1 to 15
 
Bus 650 managerial finance entire class
Bus 650 managerial finance entire classBus 650 managerial finance entire class
Bus 650 managerial finance entire class
 
Bus 611 entire class all assignments
Bus 611 entire class all assignmentsBus 611 entire class all assignments
Bus 611 entire class all assignments
 
Bus 611 entire class all assignments
Bus 611 entire class all assignmentsBus 611 entire class all assignments
Bus 611 entire class all assignments
 
Bus 520 wk 3 assignment 1 finding the leader in you self-assessment johari ...
Bus 520 wk 3 assignment 1   finding the leader in you self-assessment johari ...Bus 520 wk 3 assignment 1   finding the leader in you self-assessment johari ...
Bus 520 wk 3 assignment 1 finding the leader in you self-assessment johari ...
 
Bus 519 assignment 3 risk workshop and risk register
Bus 519 assignment 3   risk workshop and risk registerBus 519 assignment 3   risk workshop and risk register
Bus 519 assignment 3 risk workshop and risk register
 
Bus 519 assignment 2 risk management plan
Bus 519 assignment 2   risk management planBus 519 assignment 2   risk management plan
Bus 519 assignment 2 risk management plan
 
Bus 519 assignment 1 assess organizational readiness
Bus 519 assignment 1   assess organizational readinessBus 519 assignment 1   assess organizational readiness
Bus 519 assignment 1 assess organizational readiness
 

Dernier

Fordham -How effective decision-making is within the IT department - Analysis...
Fordham -How effective decision-making is within the IT department - Analysis...Fordham -How effective decision-making is within the IT department - Analysis...
Fordham -How effective decision-making is within the IT department - Analysis...Peter Ward
 
EUDR Info Meeting Ethiopian coffee exporters
EUDR Info Meeting Ethiopian coffee exportersEUDR Info Meeting Ethiopian coffee exporters
EUDR Info Meeting Ethiopian coffee exportersPeter Horsten
 
Go for Rakhi Bazaar and Pick the Latest Bhaiya Bhabhi Rakhi.pptx
Go for Rakhi Bazaar and Pick the Latest Bhaiya Bhabhi Rakhi.pptxGo for Rakhi Bazaar and Pick the Latest Bhaiya Bhabhi Rakhi.pptx
Go for Rakhi Bazaar and Pick the Latest Bhaiya Bhabhi Rakhi.pptxRakhi Bazaar
 
Welding Electrode Making Machine By Deccan Dynamics
Welding Electrode Making Machine By Deccan DynamicsWelding Electrode Making Machine By Deccan Dynamics
Welding Electrode Making Machine By Deccan DynamicsIndiaMART InterMESH Limited
 
GUIDELINES ON USEFUL FORMS IN FREIGHT FORWARDING (F) Danny Diep Toh MBA.pdf
GUIDELINES ON USEFUL FORMS IN FREIGHT FORWARDING (F) Danny Diep Toh MBA.pdfGUIDELINES ON USEFUL FORMS IN FREIGHT FORWARDING (F) Danny Diep Toh MBA.pdf
GUIDELINES ON USEFUL FORMS IN FREIGHT FORWARDING (F) Danny Diep Toh MBA.pdfDanny Diep To
 
The McKinsey 7S Framework: A Holistic Approach to Harmonizing All Parts of th...
The McKinsey 7S Framework: A Holistic Approach to Harmonizing All Parts of th...The McKinsey 7S Framework: A Holistic Approach to Harmonizing All Parts of th...
The McKinsey 7S Framework: A Holistic Approach to Harmonizing All Parts of th...Operational Excellence Consulting
 
Traction part 2 - EOS Model JAX Bridges.
Traction part 2 - EOS Model JAX Bridges.Traction part 2 - EOS Model JAX Bridges.
Traction part 2 - EOS Model JAX Bridges.Anamaria Contreras
 
Lucia Ferretti, Lead Business Designer; Matteo Meschini, Business Designer @T...
Lucia Ferretti, Lead Business Designer; Matteo Meschini, Business Designer @T...Lucia Ferretti, Lead Business Designer; Matteo Meschini, Business Designer @T...
Lucia Ferretti, Lead Business Designer; Matteo Meschini, Business Designer @T...Associazione Digital Days
 
1911 Gold Corporate Presentation Apr 2024.pdf
1911 Gold Corporate Presentation Apr 2024.pdf1911 Gold Corporate Presentation Apr 2024.pdf
1911 Gold Corporate Presentation Apr 2024.pdfShaun Heinrichs
 
Planetary and Vedic Yagyas Bring Positive Impacts in Life
Planetary and Vedic Yagyas Bring Positive Impacts in LifePlanetary and Vedic Yagyas Bring Positive Impacts in Life
Planetary and Vedic Yagyas Bring Positive Impacts in LifeBhavana Pujan Kendra
 
The-Ethical-issues-ghhhhhhhhjof-Byjus.pptx
The-Ethical-issues-ghhhhhhhhjof-Byjus.pptxThe-Ethical-issues-ghhhhhhhhjof-Byjus.pptx
The-Ethical-issues-ghhhhhhhhjof-Byjus.pptxmbikashkanyari
 
20220816-EthicsGrade_Scorecard-JP_Morgan_Chase-Q2-63_57.pdf
20220816-EthicsGrade_Scorecard-JP_Morgan_Chase-Q2-63_57.pdf20220816-EthicsGrade_Scorecard-JP_Morgan_Chase-Q2-63_57.pdf
20220816-EthicsGrade_Scorecard-JP_Morgan_Chase-Q2-63_57.pdfChris Skinner
 
WSMM Technology February.March Newsletter_vF.pdf
WSMM Technology February.March Newsletter_vF.pdfWSMM Technology February.March Newsletter_vF.pdf
WSMM Technology February.March Newsletter_vF.pdfJamesConcepcion7
 
Darshan Hiranandani [News About Next CEO].pdf
Darshan Hiranandani [News About Next CEO].pdfDarshan Hiranandani [News About Next CEO].pdf
Darshan Hiranandani [News About Next CEO].pdfShashank Mehta
 
Memorándum de Entendimiento (MoU) entre Codelco y SQM
Memorándum de Entendimiento (MoU) entre Codelco y SQMMemorándum de Entendimiento (MoU) entre Codelco y SQM
Memorándum de Entendimiento (MoU) entre Codelco y SQMVoces Mineras
 
Introducing the Analogic framework for business planning applications
Introducing the Analogic framework for business planning applicationsIntroducing the Analogic framework for business planning applications
Introducing the Analogic framework for business planning applicationsKnowledgeSeed
 
BAILMENT & PLEDGE business law notes.pptx
BAILMENT & PLEDGE business law notes.pptxBAILMENT & PLEDGE business law notes.pptx
BAILMENT & PLEDGE business law notes.pptxran17april2001
 
Driving Business Impact for PMs with Jon Harmer
Driving Business Impact for PMs with Jon HarmerDriving Business Impact for PMs with Jon Harmer
Driving Business Impact for PMs with Jon HarmerAggregage
 
business environment micro environment macro environment.pptx
business environment micro environment macro environment.pptxbusiness environment micro environment macro environment.pptx
business environment micro environment macro environment.pptxShruti Mittal
 

Dernier (20)

Fordham -How effective decision-making is within the IT department - Analysis...
Fordham -How effective decision-making is within the IT department - Analysis...Fordham -How effective decision-making is within the IT department - Analysis...
Fordham -How effective decision-making is within the IT department - Analysis...
 
EUDR Info Meeting Ethiopian coffee exporters
EUDR Info Meeting Ethiopian coffee exportersEUDR Info Meeting Ethiopian coffee exporters
EUDR Info Meeting Ethiopian coffee exporters
 
Go for Rakhi Bazaar and Pick the Latest Bhaiya Bhabhi Rakhi.pptx
Go for Rakhi Bazaar and Pick the Latest Bhaiya Bhabhi Rakhi.pptxGo for Rakhi Bazaar and Pick the Latest Bhaiya Bhabhi Rakhi.pptx
Go for Rakhi Bazaar and Pick the Latest Bhaiya Bhabhi Rakhi.pptx
 
Welding Electrode Making Machine By Deccan Dynamics
Welding Electrode Making Machine By Deccan DynamicsWelding Electrode Making Machine By Deccan Dynamics
Welding Electrode Making Machine By Deccan Dynamics
 
GUIDELINES ON USEFUL FORMS IN FREIGHT FORWARDING (F) Danny Diep Toh MBA.pdf
GUIDELINES ON USEFUL FORMS IN FREIGHT FORWARDING (F) Danny Diep Toh MBA.pdfGUIDELINES ON USEFUL FORMS IN FREIGHT FORWARDING (F) Danny Diep Toh MBA.pdf
GUIDELINES ON USEFUL FORMS IN FREIGHT FORWARDING (F) Danny Diep Toh MBA.pdf
 
The McKinsey 7S Framework: A Holistic Approach to Harmonizing All Parts of th...
The McKinsey 7S Framework: A Holistic Approach to Harmonizing All Parts of th...The McKinsey 7S Framework: A Holistic Approach to Harmonizing All Parts of th...
The McKinsey 7S Framework: A Holistic Approach to Harmonizing All Parts of th...
 
Traction part 2 - EOS Model JAX Bridges.
Traction part 2 - EOS Model JAX Bridges.Traction part 2 - EOS Model JAX Bridges.
Traction part 2 - EOS Model JAX Bridges.
 
Lucia Ferretti, Lead Business Designer; Matteo Meschini, Business Designer @T...
Lucia Ferretti, Lead Business Designer; Matteo Meschini, Business Designer @T...Lucia Ferretti, Lead Business Designer; Matteo Meschini, Business Designer @T...
Lucia Ferretti, Lead Business Designer; Matteo Meschini, Business Designer @T...
 
1911 Gold Corporate Presentation Apr 2024.pdf
1911 Gold Corporate Presentation Apr 2024.pdf1911 Gold Corporate Presentation Apr 2024.pdf
1911 Gold Corporate Presentation Apr 2024.pdf
 
Planetary and Vedic Yagyas Bring Positive Impacts in Life
Planetary and Vedic Yagyas Bring Positive Impacts in LifePlanetary and Vedic Yagyas Bring Positive Impacts in Life
Planetary and Vedic Yagyas Bring Positive Impacts in Life
 
The-Ethical-issues-ghhhhhhhhjof-Byjus.pptx
The-Ethical-issues-ghhhhhhhhjof-Byjus.pptxThe-Ethical-issues-ghhhhhhhhjof-Byjus.pptx
The-Ethical-issues-ghhhhhhhhjof-Byjus.pptx
 
20220816-EthicsGrade_Scorecard-JP_Morgan_Chase-Q2-63_57.pdf
20220816-EthicsGrade_Scorecard-JP_Morgan_Chase-Q2-63_57.pdf20220816-EthicsGrade_Scorecard-JP_Morgan_Chase-Q2-63_57.pdf
20220816-EthicsGrade_Scorecard-JP_Morgan_Chase-Q2-63_57.pdf
 
WSMM Technology February.March Newsletter_vF.pdf
WSMM Technology February.March Newsletter_vF.pdfWSMM Technology February.March Newsletter_vF.pdf
WSMM Technology February.March Newsletter_vF.pdf
 
Darshan Hiranandani [News About Next CEO].pdf
Darshan Hiranandani [News About Next CEO].pdfDarshan Hiranandani [News About Next CEO].pdf
Darshan Hiranandani [News About Next CEO].pdf
 
Memorándum de Entendimiento (MoU) entre Codelco y SQM
Memorándum de Entendimiento (MoU) entre Codelco y SQMMemorándum de Entendimiento (MoU) entre Codelco y SQM
Memorándum de Entendimiento (MoU) entre Codelco y SQM
 
The Bizz Quiz-E-Summit-E-Cell-IITPatna.pptx
The Bizz Quiz-E-Summit-E-Cell-IITPatna.pptxThe Bizz Quiz-E-Summit-E-Cell-IITPatna.pptx
The Bizz Quiz-E-Summit-E-Cell-IITPatna.pptx
 
Introducing the Analogic framework for business planning applications
Introducing the Analogic framework for business planning applicationsIntroducing the Analogic framework for business planning applications
Introducing the Analogic framework for business planning applications
 
BAILMENT & PLEDGE business law notes.pptx
BAILMENT & PLEDGE business law notes.pptxBAILMENT & PLEDGE business law notes.pptx
BAILMENT & PLEDGE business law notes.pptx
 
Driving Business Impact for PMs with Jon Harmer
Driving Business Impact for PMs with Jon HarmerDriving Business Impact for PMs with Jon Harmer
Driving Business Impact for PMs with Jon Harmer
 
business environment micro environment macro environment.pptx
business environment micro environment macro environment.pptxbusiness environment micro environment macro environment.pptx
business environment micro environment macro environment.pptx
 

Comp122 lab 6 lab report and source code

  • 1. COMP122 Lab 6 Lab Report and Source Code Click Link Below To Buy: http://hwcampus.com/shop/comp-122/comp122-lab-6-lab-report-and-source-code/ Or Visit www.hwcampus.com Product Description COMP122 Week 6 iLab You are to 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 Use an integer constant of 100 to specify the number of elements in the array you will use to collect the grade information. Do not use any global variables in your program. Declare any arrays you need in your main function and pass the arrays as needed into the functions described below. 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. 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. 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). Once the data is collected, the array and the number of grades collected must be passed to a function called mean. 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). The main function should then pass the array and the number of grades collected to the median function. The median
  • 2. 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. The simplest sorting procedure is called bubble sorting. The following pseudocode describes bubble sorting for X valid array elements. for ; outer < x;=”” outer++=””> for ; inner < x-1;=”” inner++=””> if array[inner] > array[inner+1] swap(array[inner], array[inner+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. The main routine should output the median value in an appropriate manner. The main routine should also output the sorted array with 5 grades per line. 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. 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. 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! Create a program using Visual C++.Net. Make sure to capture a screen shot of your program running your test cases! The best way to do this is to click on the console window you want to capture and then press the Alt and PrintScreen keys at the same time. Then paste your captured screen image into your Word document. Your Word document should contain your test cases, the screen shots documenting your test cases, followed by a copy of your source code.