Question

In: Computer Science

A. Think of a rail-road crossing (a crossing between a road and a rail track) controller...

A. Think of a rail-road crossing (a crossing between a road and a rail track) controller software that raises and lowers gates. This system has three components, namely, the gate (controlled by software), the crossing (along with the lights), and the controller that controls the whole system. When a train comes, the gate is lowered. The opposite happens after the train leaves. The lights indicate that a train is arriving. The gate remains lowered as long as the train is in the crossing. Once a train leaves, the lights indicate the absence of a train. Assume that the hardware is controlled by software. Write down the requirements for such an application in terms of user stories. Break this requirement up into userstory 1, userstory 2, … Identify the classes, methods, and attributes, the associations between classes, and the multiplicities of each association. You do not need to draw class diagrams

Solutions

Expert Solution

As Per Above application we have lot's of practical requirements in real world.

UserStory 1 : A person is coming from another city and wants to enter safely into a city which has railway lines crossing. He can only enter into city when Light's are Green, Gates are not Lower( should be open) Otherwise he can be in trouble while entering into city. Can you please guide this person through your controller software to cross railway line safely.

UserStory 2 : A person wants to cross Railway Line Crossing safely in minimum time.There is a Train in each 30 min and it takes 5 min in crossing. Any one can cross lines in 10min by car. He left home by car at 10.00 Am. He took 2hr to reach railway station. When he reached gates were lower and light was Red. how much time he took for entering into city. Help this person to know the status of train when he reached at railway station by your application and also time calculation.

There will be One Class called RailwayLineCrossing

this will include methods

getLightStatus() ->(will return Green or Red)

getGateStatus() -> (will return closed or opened)

getTrainStatus() ->(will return pass or crossing)

this will inclue attributes

String Light,Gate,Train;

Now,

In order to use this class, any user can call these methods and get status in there Own classes.

Also, This class can be Inherit in user class and can overrides the methods and can use it.

So, Association will be with RailwayLineCrossing class to other classes.

multiplicity for RailwayLineCrossing to other classes will be one to many.

RailwayLineCrossing can have more then one user and one user can use one RailwayLineCrossing at a time.

There can be many other application of controller software.


Related Solutions

There are several methods for mounting a rail to form a track for the railway engineer....
There are several methods for mounting a rail to form a track for the railway engineer. For the following methods, state the advantages and disadvantages and describe where they would most likely be used: (i) Timber sleeper (ii) Steel sleeper (iii) Mono-bloc concrete sleeper (iv) Twin-bloc concrete sleeper (v) Slab track
Describe the crossing between evolution and ecology; think environmental factors (biotic and abiotic)).
Describe the crossing between evolution and ecology; think environmental factors (biotic and abiotic)).
A crossing track was constructed over a water channel with a total length of 1700 m...
A crossing track was constructed over a water channel with a total length of 1700 m and width of 40 m. If you know that the maximum flow that can be carried by the water channel is 400 m3/s over a 25-year storm event. Calculate: a. The probability that the crossing track will flood next year. b. The probability that the crossing track will flood at least once in the next 12 years. c. The probability that the crossing track...
Question 3: Let’s think about the road on Laurel Avenue between Howell and Dewey Streets. There...
Question 3: Let’s think about the road on Laurel Avenue between Howell and Dewey Streets. There are no parking restrictions on this particular section of Laurel Avenue. (a) Is the good “street parking” on this particular block an excludable or non-excludable good? Briefly explain. (b) Is the good “street parking” on this particular block a rival or non-rival good? Briefly explain. (c) Using your answers above, what “type of good” is “street parking” on this particular block? (Private good, public...
Union Pacific Rail road reported net income of $770million after interest expenses of $320 million in...
Union Pacific Rail road reported net income of $770million after interest expenses of $320 million in a recent financial year. The corporate tax rate was 36%. It reported depreciation of $960 million in that year, and capital spending of $1.2billion. The firm also had $4billion in debt outstanding on the books, was rated AA (carrying a yield to maturity of 8%), and was trading at par (up from $3.8 billion at the end of the previous year). The beta of...
Question: You're driving down a country road at 25 m/s, when a deer suddenly starts crossing...
Question: You're driving down a country road at 25 m/s, when a deer suddenly starts crossing the road. As soon as you react, you hit the brakes to decelerate the car at a rate of 4.20 m/s2. If the deer is 77 m ahead of you, do you hit the deer with your car? Activity: Develop a method for calculating your average reaction time using only a ruler or meter stick, NO STOPWATCH (you will need a partner to help...
Question: You're driving down a country road at 25 m/s, when a deer suddenly starts crossing...
Question: You're driving down a country road at 25 m/s, when a deer suddenly starts crossing the road. As soon as you react, you hit the brakes to decelerate the car at a rate of 4.20 m/s2. If the deer is 77 m ahead of you, do you hit the deer with your car? Activity: Develop a method for calculating your average reaction time using only a ruler or meter stick, NO STOPWATCH (you will need a partner to help...
in air track experiments, we assume that kinetic friction between the ait track and the car...
in air track experiments, we assume that kinetic friction between the ait track and the car is negligible. If friction is not negligable, how would the friction affect each of the following A) velocity of the car B) kinetic energy of the car C) potential energy of the car D) mechanical energy of the car
An elevator rail is assumed to meet specifications if its diameter is between 0.98 and 1.01...
An elevator rail is assumed to meet specifications if its diameter is between 0.98 and 1.01 inches. Each year a company produces 100, 000 elevator rails. For a cost of $10/σ2 per year the company can rent a machine that produces elevator rails whose diameters have a standard deviation of σ. (The idea is that the company must pay more for a smaller variance.) Each such machine will produce rails having a mean diameter of one inch. Any rail that...
Why do think it important that economists track the students “until they die “ ? What...
Why do think it important that economists track the students “until they die “ ? What type of question Would this information help answer?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT