Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java - Write a method which will receive an array of integers. Each number in the array represents the count of passengers at a particular

Java -

Write a method which will receive an array of integers. Each number in the array represents the count of passengers at a particular train station.

The method will check each count and record the traffic flow as follow:

- if the count is less than 0, the traffic flow is "Invalid";

- if the count is between 0 and 100, the traffic flow is "Low";

- if the count is more than 100, the traffic flow is "High".

The traffic flow will be stored in a new array and returned to the caller upon method completion.

You may assume the array is not empty. You can make use of the following code snippet to write your answer

-----------------------------------------------------------------

public static String [ ] getTrafficSummary (int [ ] data)

{

//write your answer here

}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions