Question: Core JAVA Program: Please answer to this problem statement. TheKarriers is a start-up in the logistics marketplace in the City. They are evolving to integrate

Core JAVA Program: Please answer to this problem statement.

TheKarriers is a start-up in the logistics marketplace in the City. They are evolving to integrate the logistics network to provide transparent prices, extensive pincode coverage and powerful technology to track and manage shipments. The Company wished to expand its service boundary and decided to deploy Containers for their freight transport which would help them shorten shipping time and reduces losses from damage and theft. Containers were purchased immediately and ready for use while the Company wanted its Shipping Management System to be improved a bit more to manage, track and maintain the Container related information as well. H elp the Company write a block of code to implement Single Inheritance and get the Container related information and display it in the specified format. Container must have the properties of the Cargo class. Therefore, Container inherits the Cargo Class and its a single Inheritance. Create a class named Cargo with the following protected member variables.

Float length

Float width

Float height

Double weight

Include appropriate getters, setters and constructors. Use default constructor. Use getter to get the values and setter to set the values. Create a class named Container that extends Cargo with the following private member variables.

String containerNumber

In container class create the following public methods.
S.No Method Name Method Descripton
1 public void displayContainerDetails() This method is used to display the container details.
Create another class Main and write a main method to test the above classes. Print this format in display method System.out.format("%-20s %-15s %-15s %-15s %s ", "Container Number", "Length", "Width", "Height", "Weight") Problem requirements : Create container object and set all the values using getters and setters. Input and Output Format: The first input is an integer 'n' that corresponds to the number of containers. The next 'n' inputs are strings. Each string consists of five comma separated values in the order container number,length, width, height and weight. Refer sample input and output for formatting specifications. [Note : Strictly adhere to the object oriented specifications given as a part of the problem statement. Use the same class names and member variable names. Follow the naming conventions mentioned for getters / setters. Create separate classes in separate files.] Sample Input and Output: [All text in bold corresponds to input and the rest corresponds to output. ] Enter the number of containers : 2 Enter the container 1 details : FRT/LKJ/025,30,70,40,10000 Enter the container 2 details : JHG/JTR/354,40,80,30,8000 Container details are Container Number Length Width Height Weight FRT/LKJ/025 30.0 70.0 40.0 10000.0 JHG/JTR/354 40.0 80.0 30.0 8000.0

Help

0 mins

Level 1

3 mins

Level 2

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!