20 integers saved in a file called "data.txt"

Assignment Help C/C++ Programming
Reference no: EM13161730

There are 20 integers saved in a file called "data.txt" (just a random txt file with some numbers) All integers are in the range from 1 to 10

greater than 10 or less than 1). Assume you obtained these numbers from an experiment you (or someone else) ran, and now you want to write a program to do the data analysis.

Your data analysis must include:

1) Find the Arithmetic Mean of the 20 integers (this will be a floating point number).

2) Generate a table that lists each integer from 1 to 10 and the number of times it occurs. (This would be the precursor step to generating a histogram, which is NOT required in this problem)

3) Find the mode of the 20 integers (see below for the definition of a mode).

Example Output:

The mean of the data was 5.600000

The mode of the data was7

Integer Occurences

---------------------------

1 2

2 3

3 0

4 1

5 2

6 3

7 4

8 2

9 2

10 1

You must output the three values on the output screen and if possible, also on an output file called "results.txt"

 

 

Reference no: EM13161730

Questions Cloud

Ask the user how many times you want to run : c the algorithm. 2. Then choose a word at random from the array of Strings as the target (Use the integer random number generator)
Build a table of reynolds numbers at flow velocities : Write a program code to compute and build a table of Reynolds numbers at flow velocities varying from 100 to 1000 ft/sec (at increments of 100)
In psuedocode, design an application : In psuedocode, design an application that has an array of at least 20 integers. It should call a module that uses the sequential search algorithm to locate one of the values
Least number of comparisons needed : What is the least number of comparisons needed to sort an array of 6 numbers, in the worst case, using any sorting algorithm that sorts with binary comparisons? Explain
20 integers saved in a file called "data.txt" : There are 20 integers saved in a file called "data.txt" (just a random txt file with some numbers) All integers are in the range from 1 to 10
All the new strings generated : Explain why, if on some round, all the new strings generated for any syntactic category are longer than s, and s has not already been generated for L(), then s cannot ever be put in L(). Hint: Use Exercise 11.3.5.
Brownian motion is a physical phenomenon : Brownian motion is a physical phenomenon which can be observed, for instance, when a small particle is immersed in a liquid.
Write a program code to compute and build a table of reynold : Write a program code to compute and build a table of Reynolds numbers at flow velocities varying from 100 to 1000 ft/sec (at increments of 100)
Method called printpowersof2 that accepts a maximum number : Write a method called printPowersOf2 that accepts a maximum number as an argument and prints each power of 2 from 20 (1) up to that maximum power, inclusive. For example, consider the following calls: printPowersOf2(3); printPowersOf2(10)

Reviews

Write a Review

C/C++ Programming Questions & Answers

  C assignment of curl library

C Assignment Curl library must be used To be done on linux, it should be compiled using the following command: gcc -Wall -ansi -pedantic NameOfFile.c -lncurses Please make sure it is commented with clarification Variable names in camel case

  Write program to declare the array of type float

Write down the c++ program which declares the array of 50 components of type float. Initialize array so that first 25 components are equal to square of the index variable.

  Design a nested program

How many levels of nesting are there in this design?

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Prepare an accounting for a dorm''s kitchen

The "purpose" of the program is to prepare an accounting (database) for e.g. a dorm's kitchen, to keep track of the consumption of beer for each room.

  Allows the user to enter the coefficients for a system

Create a graphical (not text-based) Visual C++ program that allows the user to enter the coefficients for a system of four equations with four unknowns. Include a button that when clicked, will solve the system of equations and display the results in..

  C program that compare the time required

Write a C program that compare the time required to compute the product of two 10,000 x 10,000 matrices with and without optimization for locality.

  File system with login authentication

Implement a simple file system with login authentication and access control - Construct a hash/salt/shadow based user/password creation system.

  Implement database having array of pointers

One way to implement this database is to have an array of pointers pointing to Employee objects. You will obviously require a function named Calculate_salary() which will be different for each employee class. Write code in c++

  Program to compute the total volume

Write a program to compute the total volume for a number of cylinders. A cylinder may have different values for height and radius.

  Design a class named employeerecord

Design a class named EmployeeRecord that holds an employee's ID number, name, and payrate. Include mutator methods to set the values for each data field and output the values for each data field. Create the class diagram and write the code that

  Asks the user for the name of an input file and translates

Write a C++ program that asks the user for the name of an input file and translates the contents of that input file using ROT13. Your  main  function should be responsible for reading the input file and coordinating calls to a value-returning functio..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd