Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Java Expert


Home >> Java

Program 3 (console)

The qualities that are most important to the Redding Elevator Company are safety and reliability. Both are achieved by high standards of design, manufacture and service. All elevators are serviced regularly, but even so, there will be unexpected failures. The long term goal is to minimise their frequency to enhance the quality reputation of the products and the company.

Each elevator's computerised controller maintains a log of the times it is put into service tup and the times at which it fails tdown. This log is transmitted to the company to build a statistical pro le of the reliability of each elevator and, collectively, of each elevator model.

The main metric used to describe reliability is the mean time between failures (MTBF), the sum of all of the failure times tdown minus the time it last came into service tup divided by the number or failures.

MTBF = Σ(tdown - tup)/ number of failures

Write a program that can be used to read an extract from a log for one elevator and print the following statistics:

1. the total \uptime", that is the total time the elevator was in service, Σ(tdown - tup) (in years);

2. the number of failures; and

3. the MTBF (in years).

The log extract excludes scheduled times the elevator was taken out of service for maintenance. A typical log looks like this:

- Each line consists of a U to label a time as a tup or a D to label a time as a tdown, followed by the time in seconds since the elevator was rst put into service.

- The rst line will always indicate tup at 0 seconds.

- The last line 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 fairly new elevator that has not failed yet may have a log with only one line in it.

File: S00000001.txt

U

0

D

15664610

U

15670184

D

30700326

U

30724536

D

37622324

U

37648485

D

60455362

U

60480874

D

79166234

U

79181602

D

95881395

U

95892167

Some more example log les: S00000002.txt (only one line); S00000003.txt (f nishes with a tdown); S00000004.txt (longer).

For the purposes of the calculations, assume there are 365:25 days per year. Your program should read a log le from standard input, using input redirection.

Example output for these four data fles:

$ java AnalyseOne < S00000001.txt

Total uptime = 3.035229865389003 (years)

Number of failures = 6

Mean time between failures = 0.5058716442315004 (years)

$ java AnalyseOne < S00000002.txt

No failures.

$ java AnalyseOne < S00000003.txt

Total uptime = 4.63133147007377 (years)

Number of failures = 3

Mean time between failures = 1.5437771566912568 (years)

$ java AnalyseOne < S00000004.txt

Total uptime = 13.717806709001954 (years)

Number of failures = 9

Mean time between failures = 1.5242007454446616 (years)

$

Java, Programming

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

Priced at Now at $30, Verified Solution

Have any Question?


Related Questions in Java

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

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

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

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

Question slideshows or carousels are very popular in

Question : Slideshows (or carousels) are very popular in websites. They allow web developers to display news or images on the website in limited space. In this code challenge, you are required to complete the JavaScript ...

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

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

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

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

Can someone help me please with those question1what is the

Can someone help me please with those question 1:what is the best data type for student id datatime,currency,number,decimal 2:which relationshipis preferable? one to one,one to many,many to many 3:if you add table A's pr ...

  • 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