Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

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

Assignment - java program using array of objectsobjectives

Assignment - 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 Menu ...

Overviewyou are required to use java se 80 and javafx to

Overview You are required to use Java SE 8.0 and JavaFX to develop a Graphical User Interface (GUI) for the FlexiRent rental property management program created in Assignment 1. This assignment is designed to help you: 1 ...

Solving 2nd degree equationsbull write the following java

Solving 2nd degree equations • Write the following Java methods • boolean real-sols(double a, double b, double c): it returns true if the 2nd degree equation ax2 + bx + c has real solutions • double solution1(double a, d ...

Assessment socket programmingtaskwrite a java gui program

Assessment: Socket Programming Task Write a JAVA GUI program that would facilitate text chatting/exchanging between two or multiple computers over the network/internet, using the concept of JAVA socket programming. If yo ...

Part a specification - robot simulationpart a

PART A Specification - Robot Simulation PART A Requirements To complete this assignment you will use the supplied eclipse project Robot P1/. It is already set up to execute a simple arm movement loop which you will build ...

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 ...

Assessment database and multithread programmingtasktask 1

Assessment: Database and Multithread Programming Task Task 1: Grade Processing University grading system maintains a database called "GradeProcessing" that contains number of tables to store, retrieve and manipulate stud ...

Assignment - method in our madnessthe emphasis for this

Assignment - "Method in our Madness" The emphasis for this assignment is methods with parameters. In preparation for this assignment, create a folder called Assign_3 for the DrJava projects for the assignment. A Cityscap ...

Can someone please help me with the following java

can someone please help me with the following java question The input is an N by N matrix of nonnegative integers. Each individual row is a decreasing sequence from left to right. Each individual column is a decreasing s ...

  • 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