Ask Java Expert


Home >> Java

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.

Java, Programming

  • Category:- Java
  • Reference No.:- M91525933
  • Price:- $30

Priced at Now at $30, Verified Solution

Have any Question?


Related Questions in Java

Chatbotscreate a small networked chat application that is

Chatbots Create a small, networked chat application that is populated by bots. Introduction On an old server park, filled with applications from the early days of the internet, a few servers still run one of the earliest ...

Assignment taskwrite a java console application that allows

Assignment task Write a java console application that allows the user to read, validate, store, display, sort and search data such as flight departure city (String), flight number (integer), flight distance (integer), fl ...

Assignment game prototypeoverviewfor this assessment task

Assignment: Game Prototype Overview For this assessment task you are expected to construct a prototype level/area as a "proof of concept" for the game that you have designed in Assignment 1. The prototype should function ...

Assignment taskwrite a java console application that allows

Assignment task Write a java console application that allows the user to read, validate, store, display, sort and search data such as flight departure city (String), flight number (integer), flight distance (integer), fl ...

In relation to javaa what is constructor the purpose of

(In relation to Java) A. What is constructor? the purpose of default constructor? B. How do you get a copy of the object but not the reference of the object? C. What are static variables and instance variables? D. Compar ...

Project descriptionwrite a java program to traverse a

Project Description: Write a java program to traverse a directory structure (DirWalker.java) of csv files that contain csv files with customer info. A simple sample in provided in with the sample code but you MUST will r ...

Fundamentals of operating systems and java

Fundamentals of Operating Systems and Java Programming Purpose of the assessment (with ULO Mapping) This assignment assesses the following Unit Learning Outcomes; students should be able to demonstrate their achievements ...

Assessment -java program using array of Assessment -JAVA Program using array of objects

Assessment -JAVA Program using array of objects Objectives This assessment item relates to the course learning outcomes as stated in the Unit Profile. Details For this assignment, you are required to develop a Windowed G ...

Applied software engineering assignment 1 -learning

Applied Software Engineering Assignment 1 - Learning outcomes - 1. Understand the notion of software engineering and why it is important. 2. Analyse the risk factors associated with phases of the software development lif ...

Retail price calculatorwrite a java program that asks the

Retail Price Calculator Write a JAVA program that asks the user to enter an item's wholesale cost and its markup percentage. It should then display the item's retail price. For example: (If an item's wholesale cost is 5. ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As