Machine that i would like to know

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

Let's say I have a machine that I would like to know, on average, how much it runs throughout a given day through a percentage value. Every 30 seconds, I will have a device to record the current temperature of the machine. If the machine increases its temperature by at least 0.5 degrees F in one of the 30 second windows, I will know that the machine is turned off. If the machine decreases its temperature by at least 0.5 degrees F within a 30 second window, I will know that the machine is turned on. If the machine does not change by 0.5 degrees, it will assume its same on or off status.

Now, I would like to also gather percentage data within each hour. This means that there are 120 30-second intervals within an hour, and there are 24 hours in a day. I have a file that I must read from containing 2,881 decimal values of type double for all of the hourly interval values. I first want to read in all 2,881 values, then create an array with 24 indices for each hour of the day. I want to find the percentage of time the machine is ON within each hour, and then store each hour percentage within its respective array index. This means that I will want to calculate the percentage of ON time for every 120 values in the file I am reading from.

I must gather each hourly percentage so that I can then output the values into a self-made bar graph (the bars consisting of astericks). The vertical values (or y values) will show percentage values from 0-100 in 5 percent intervals. The horizontal values (or x values) will show which hour of the day it is, starting at midnight and ending at 11 pm in 1 hour intervals. For each hour's ON percentage, a loop should output an asterick or a space moving row to row and starting from the y value of 100. This will create the appearance of a bar graph. Note that during the midnight hour, the machine is always OFF, and this means that the first column of the chart will contain no astericks, so that each time the code loops through a row, the array index of zero (representing 12 midnight) will always print a space instead of an asterisk.

Overall, I must also calculate the average percentage of time the machine was turned on throughout the entire day.

Reference no: EM13166678

Questions Cloud

How many grams of potassium permanganate are needed : how many grams of potassium permanganate are needed to decolorize 1 gram of 2-pentene in basic solution?
State photon of red light and reemit photon of violet light : Is it possible for an atom to absorb a photon of red light and reemit a photon of violet light
Calculate the work observed for the volume change : A sample of CO2 g in a piston at 7.5 atm and 1090. L is allowed to come to equilibrium against a constant external pressure of 8.3 atm at constant temperature. Calculate the work observed for the volume change in the piston (in kJ).
What volume of bleach would be required : what volume of bleach (6%w/v=6g/100ml) would be required to oxidize 5.0 mL of methanol (density 0.890 g/ml) to methanone?
Machine that i would like to know : Let's say I have a machine that I would like to know, on average, how much it runs throughout a given day through a percentage value. Every 30 seconds, I will have a device to record the current temperature of the machine. If the machine increases..
Compute the allocation of partners total payments for 2013 : There is $83,000 in the firm's bank account after all other assets have been liquidated.  Allocate the bank balance among all of the involved parties:  Creditors, Partner Adkins, Partner Bell, and Partner Fox.
Passing an "in out" parameter to a procedure : In Ada, when passing an "in out" parameter to a procedure, the system is allowed to use either pass-by-reference or pass-by-value-result as it sees fit. Why?
What is the kinetic energy of electrons ejected : the threshold wavelength for potassium metal is 564 nm. what is its work? what is the kinetic energy of electrons ejected if radiation of wavelength 410 nm is used?
Define color band corresponds to the largest energy : which observed color band corresponds to the largest energy difference between levels and which is the smallest?

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Function that returns the height of a binary tree

Write a function called getHeight() that returns the height of a given binary tree - CptS 122 Write a function called countSmallerThan() that returns the number of nodes whose values are smaller than the supplied input paramter

  Develop a program that when you pipe in a file

develop a program that when you pipe in a file it will demonstrate on the left had side the line number  work by having a program piped in and when a \n occurs a new line and number is indicated.

  A constructor and a destructor

A constructor and a destructor, Insert a new element chosen by the user at the correct place in the list

  Write a program to convert between rectangular

Write a program to convert between rectangular and cylindrical coordinates, based upon user input. For example, if the user wants to convert cylindrical to rectangular coordinates, the user would input r, ?, z values and the program would output x, y..

  Design for storing the maze layout

Design and implement a C++ program for maze layout

  Reads in a list of integers

Write a program in C++ that reads in a list of integers into and array with base type int. Provide the facility to either read this array from the keyboard or from a file, at the user's option. If the user chooses file input, the program should reque..

  The rpn calculator program

The RPN calculator program should read the RPN expression as an entire line from stdin.Input will consist of a single line. After completing the evaluation of the expression, the program should print the contents of the entire stack, starting with th..

  Write a program using for loops t

Write a program using for loops to produce the following output. Please read carefully the entire specification!

  Function declare that it can throw an ioexception

Every C++ function that performs file I/O will thus need to either declare that it can throw an IOException, or contain a try-catch-finally block to deal with it. Response?

  Show the deatils of an emplyoee - c programming

Show the deatils of an emplyoee in a neat format.

  C program to calculate power loss in transmission line

Write program in C to calculate the power loss in transmission line with resistance of 0.05 ohms/mile. Calculate power loss if 500 kW of power is transmitted from power generation station

  Create a class named gamer that has a field for name

Create a class named Gamer that has a field for name(string) and a field for points(int).

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