Question
A survey was taken by the student representatives, Each response is a number from 1 to 9.
The program computes the mean and mode of the data.

100 responses:
6, 7, 8, 9, 8, 7, 8, 9, 7, 8, 9, 8, 9, 8, 9, 5, 9, 8, 7, 8, 7, 8, 6, 7, 8,
9, 3, 9, 8, 7, 8, 9, 9, 8, 9, 8, 9, 8, 9, 7, 8, 9, 6, 7, 8, 7, 8, 7, 9, 7,
6, 5, 3, 5, 6, 7, 2, 5, 3, 9, 4, 6, 4, 7, 8, 9, 6, 8, 7, 8, 9, 7, 8, 7, 4,
4, 3, 6, 4, 6, 7, 5, 6, 4, 5, 6, 1, 6, 5, 7, 8, 5, 3, 6, 3, 5, 7, 5, 8, 9

- Initialize a single dimensional array with the data
- Create Frequency Table
- Summarize the information in a table
- Generate a histogram representing the frequency of each response 1 to 9
- Calculate the mean of the data
- Identify the mode and median of the data
Solution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references.
Students may use these solutions for personal skill-building and practice.
Unethical use is strictly forbidden.

#include "stdafx.h"
#include <stdio.h>
#include <stdlib.h>

void sort(int responses[], int size);
void createFrequencyTable(int responses[], size_t size,
size_t ft[], size_t ftSize);
void summarize(size_t ft[], size_t ftSize);
void histogram(size_t ft[], size_t ftSize);
double mean(int responses[], size_t size);
int mode(size_t ft[], size_t ftSize);
double median(int responses[], size_t size);

int main()
{
// Initialize a single dimensional array with the data

int responses[100] =
{
6, 7, 8, 9, 8, 7, 8, 9, 7, 8, 9, 8, 9, 8, 9, 5, 9, 8, 7, 8, 7, 8, 6, 7, 8,
9, 3, 9, 8, 7, 8, 9, 9, 8, 9, 8, 9, 8, 9, 7, 8, 9, 6, 7, 8, 7, 8, 7, 9, 7,
6, 5, 3, 5, 6, 7, 2, 5, 3, 9, 4, 6, 4, 7, 8, 9, 6, 8, 7, 8, 9, 7, 8, 7, 4,
4, 3, 6, 4, 6, 7, 5, 6, 4, 5, 6, 1, 6, 5, 7, 8, 5, 3, 6, 3, 5, 7, 5, 8, 9
};

// init all sizes
int size = 100;
size_t ftSize = 10;

// sort the array, it's for median finding
sort(responses, size);
// Create Frequency Table
size_t ft[10];
createFrequencyTable(responses, size, ft, ftSize);
This is only a preview of the solution.
Please use the purchase button to see the entire solution.
By purchasing this solution you'll be able to access the following files:
Solution.c
Purchase Solution
$25.00
Google Pay
Amazon
Paypal
Mastercard
Visacard
Discover
Amex
View Available Computer Science Tutors 645 tutors matched
Ionut
(ionut)
Master of Computer Science
Hi! MSc Applied Informatics & Computer Science Engineer. Practical experience in many CS & IT branches.Research work & homework
5/5 (6,808+ sessions)
1 hour avg response
$15-$50 hourly rate
Pranay
(math1983)
Doctor of Philosophy (PhD)
Ph.D. in mathematics and working as an Assistant Professor in University. I can provide help in mathematics, statistics and allied areas.
4.6/5 (6,704+ sessions)
1 hour avg response
$40-$50 hourly rate
Leo
(Leo)
Doctor of Philosophy (PhD)
Hi! I have been a professor in New York and taught in a math department and in an applied math department.
4.9/5 (6,470+ sessions)
2 hours avg response

Similar Homework Solutions