Write a program that reports the comparison for all models

Assignment Help JAVA Programming
Reference no: EM13865218

Program (console)

The company is very interested in making a comparison of the reliability of the different models it has installed.

Its models are simply named model A, model B, etc. For each model there are many separate instal- lations, identified by sequence number of 8 digits. Each elevator is uniquely identified by a serial number that starts with the model letter and ends with its sequence number.

Files have been created that aggregate the logs of many elevators:

• Each line starts with the serial number of an elevator.

• The rest of line is as per a log for one elevator:

- A U labels a time as a tup, or a D labels a time as a tdown, followed by the time in seconds since the elevator was first put into service.

- The first line for each elavator will always indicate tup at 0 seconds.

- The last line for each elavator is usually also a tup, though it is possible that the log has been uploaded while the elevator is out of service, and therefore the last line is a tdown.

- A new elevator that has not failed yet may have one line for it.

• The file has been sorted by serial number and then time.

• Not all models might be represented in the file. The serial numbers might not be sequential.

• A new model might not have suffered any fail- ures yet.

The first 25 lines of file: small.txt

A00000001

U

0

A00000001

D

37902420

A00000001

U

37926167

A00000001

D

81482848

A00000001

U

81508838

A00000001

D

129373255

A00000001

U

129393392

A00000001

D

172752889

A00000001

U

172793133

A00000001

D

208904424

A00000001

U

208933554

A00000001

D

243425572

A00000001

U

243454010

A00000002

U

0

A00000003

U

0

A00000003

D

67943195

A00000003

U

67966385

A00000003

D

136952512

A00000003

U

136979618

A00000003

D

213738461

A00000003

U

213766673

A00000004

U

0

A00000004

D

23733729

A00000004

U

23772528

A00000004

D

51036894

Another data file exists with much more data: big.txt.

Write a program that reports the comparison for all models represented in the data file in a table, reporting: the number of each model installed; the total uptime, the total number of failures, and the overall MTBF.

Example output for these two data files:

$ java AnalyseMany < small.txt

model

#

total uptime (years)

total fails

MTBF (years)

A

7

23.7

17

1.39

B

5

10.4

12

0.87

D

4

17.5

14

1.25

E

2

---

0

---

$ java AnalyseMany < big.txt

model

#

total uptime (years)

total fails

MTBF (years)

A

2150

8370.6

12601

0.66

B

3113

48216.5

96360

0.50

C

2842

16980.9

23590

0.72

D

2075

26007.3

40786

0.64

E

3078

12670.8

13341

0.95

F

734

15772.3

36384

0.43

G

2371

3907.1

2524

1.55

H

3720

48103.1

23993

2.00

I

2938

28301.9

42149

0.67

J

1355

7641.2

14022

0.54

$

Note how the results are reported when there have been no failures, and that to make the table neat, the format of the numbers has been controlled.

Reference no: EM13865218

Questions Cloud

Suppose kenji decides to buy 100 shares of nanospeck stock : Suppose Kenji decides to buy 100 shares of NanoSpeck stock. Which of the following statements are correct? Check all that apply.  A) The price of his shares will rise if NanoSpeck issues additional shares of stock.
Describe under what circumstances this might be the case : What is the relationship between the ethical obligation of honesty and truth telling? Is it ever proper to not tell someone something he or she has a right to know? If so describe under what circumstances this might be the case How does this square w..
Explain what mitigation is? : Analyze what you have learned and evaluate it expressing your thoughts and supported opinions on the topic.
Flexible and sticky prices and wages : 1.  How do macroeconomists distinguish between flexible and sticky prices and wages? 2. What is the difference between the short-run and the long-run in macroeconomic analysis? Why do macroeconomists differentiate between the two time horizons?
Write a program that reports the comparison for all models : Write a program that reports the comparison for all models represented in the data file in a table, reporting: the number of each model installed; the total uptime, the total number of failures, and the overall MTBF.
Why china score is relatively low compared to the u.s. : Does this seem counter-intuitive to you? Be sure to include an explanation of why China score is relatively low compared to the U.S.
Discuss the method of cbrn attack : method of CBRN attack
Individuals qualifies for unemployment benefits : Here are four individuals telling you their stories of how they became unemployed. In a multi-paragraph essay, apply the theories of unemployment to explain the type of unemployment that each of these individuals is facing and explain which of these ..
What vulnerabilities or risks currently exist? explain : What vulnerabilities or risks currently exist? Explain

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

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