Question

In: Computer Science

<<<<<<<<. I need the UML diagram for all classes.java below. >>>>> // Vehicle.java public class Vehicle...

<<<<<<<<. I need the UML diagram for all classes.java below. >>>>>

// Vehicle.java

public class Vehicle {
   // data members declared as private
   private String make;
   private double weight;
   private double height;
   private double length;
   private int maxSpeed;
   private int noOfDoors;
   private int numberSeats;

   /**
   * @param make
   * @param weight
   * @param height
   * @param length
   * @param maxSpeed
   * @param noOfDoors
   * @param maxPassengers
   * @param numberSeats
   */
   public Vehicle(String make, double weight, double height, double length,
           int maxSpeed, int noOfDoors, int numberSeats) {

       this.make = make;
       this.weight = weight;
       this.height = height;
       this.length = length;
       this.maxSpeed = maxSpeed;
       this.noOfDoors = noOfDoors;
       this.numberSeats = numberSeats;

   }

   /**
   * @return the make
   */
   public String getMake() {
       return make;
   }

   /**
   * @param make
   * the make to set
   */
   public void setMake(String make) {
       this.make = make;
   }

   /**
   * @return the weight
   */
   public double getWeight() {
       return weight;
   }

   /**
   * @param weight
   * the weight to set
   */
   public void setWeight(double weight) {
       this.weight = weight;
   }

   /**
   * @return the height
   */
   public double getHeight() {
       return height;
   }

   /**
   * @param height
   * the height to set
   */
   public void setHeight(double height) {
       this.height = height;
   }

   /**
   * @return the length
   */
   public double getLength() {
       return length;
   }

   /**
   * @param length
   * the length to set
   */
   public void setLength(double length) {
       this.length = length;
   }

   /**
   * @return the maxSpeed
   */
   public int getMaxSpeed() {
       return maxSpeed;
   }

   /**
   * @param maxSpeed
   * the maxSpeed to set
   */
   public void setMaxSpeed(int maxSpeed) {
       this.maxSpeed = maxSpeed;
   }

   /**
   * @return the noOfDoors
   */
   public int getNoOfDoors() {
       return noOfDoors;
   }

   /**
   * @param noOfDoors
   * the noOfDoors to set
   */
   public void setNoOfDoors(int noOfDoors) {
       this.noOfDoors = noOfDoors;
   }

   /**
   * @return the numberSeats
   */
   public int getNumberSeats() {
       return numberSeats;
   }

   /**
   * @param numberSeats
   * the numberSeats to set
   */
   public void setNumberSeats(int numberSeats) {
       this.numberSeats = numberSeats;
   }

   /*
   * (non-Javadoc)
   *
   * @see java.lang.Object#toString()
   */
   @Override
   public String toString() {
       return "Make=" + make + ", weight=" + weight + ", height=" + height
               + ", length=" + length + ", maxSpeed=" + maxSpeed
               + ", noOfDoors=" + noOfDoors + ", Number of Seats ="
               + numberSeats;
   }

}

==========================================

// Car.java

public class Car extends Vehicle {

   private int maxPassengers;

   private boolean isConvertable;

   public Car(String make, double weight, double height, double length,
           int maxSpeed, int noOfDoors, int maxPassengers, int numberSeats,
           boolean isConvertable) {
       super(make, weight, height, length, maxSpeed, noOfDoors, numberSeats);
       this.maxPassengers = maxPassengers;

   }

   /**
   * @return the maxPassengers
   */
   public int getMaxPassengers() {
       return maxPassengers;
   }

   /**
   * @param maxPassengers
   * the maxPassengers to set
   */
   public void setMaxPassengers(int maxPassengers) {
       this.maxPassengers = maxPassengers;
   }

   /**
   * @return the isConvertable
   */
   public boolean isConvertable() {
       return isConvertable;
   }

   /**
   * @param isConvertable
   * the isConvertable to set
   */
   public void setConvertable(boolean isConvertable) {
       this.isConvertable = isConvertable;
   }

   /*
   * (non-Javadoc)
   *
   * @see java.lang.Object#toString()
   */
   @Override
   public String toString() {
       return "Car ::" + super.toString() + ", MaxPassengers=" + maxPassengers
               + ", isConvertable=" + isConvertable;
   }

}

==========================================

// Bus.java

public class Bus extends Vehicle {
   private int numberAxles;

   public Bus(String make, double weight, double height, double length,
           int maxSpeed, int noOfDoors, int numberSeats, int numberAxles) {
       super(make, weight, height, length, maxSpeed, noOfDoors, numberSeats);
       this.numberAxles = numberAxles;
   }

   /**
   * @return the numberAxles
   */
   public int getNumberAxles() {
       return numberAxles;
   }

   /**
   * @param numberAxles
   * the numberAxles to set
   */
   public void setNumberAxles(int numberAxles) {
       this.numberAxles = numberAxles;
   }

   /*
   * (non-Javadoc)
   *
   * @see java.lang.Object#toString()
   */
   @Override
   public String toString() {
       return "Bus ::" + super.toString() + ", Number Axles=" + numberAxles;
   }

}

Solutions

Expert Solution

Note : Please comment below if you have concerns. I am here to help you

If you like my answer please rate and help me it is very Imp for me


Related Solutions

Draw a UML diagram for the classes. Code for UML: // Date.java public class Date {...
Draw a UML diagram for the classes. Code for UML: // Date.java public class Date {       public int month;    public int day;    public int year;    public Date(int month, int day, int year) {    this.month = month;    this.day = day;    this.year = year;    }       public Date() {    this.month = 0;    this.day = 0;    this.year = 0;    } } //end of Date.java // Name.java public class Name...
Complete the following class UML design class diagram by filling in all the sections based on...
Complete the following class UML design class diagram by filling in all the sections based on the information given below.         The class name is Boat, and it is a concrete entity class. All three attributes are private strings with initial null values. The attribute boat identifier has the property of “key.” The other attributes are the manufacturer of the boat and the model of the boat. Provide at least two methods for this class. Class Name: Attribute Names: Method...
C++ Code (I just need the dieselLocomotive Class) Vehicle Class The vehicle class is the parent...
C++ Code (I just need the dieselLocomotive Class) Vehicle Class The vehicle class is the parent class of the derived class: dieselLocomotive. Their inheritance will be public inheritance so reflect that appropriately in their .h files. The description of the vehicle class is given in the simple UML diagram below: vehicle -map: char** -name: string -size:int -------------------------- +vehicle() +getSize():int +setName(s:string):void +getName():string +getMap():char** +setMap(s: string):void +getMapAt(x:int, y:int):char +~vehicle() +operator--():void +determineRouteStatistics()=0:void The class variables are as follows: map: A 2D array of...
create the UML Diagram to model a Movie/TV viewing site. Draw a complete UML class diagram...
create the UML Diagram to model a Movie/TV viewing site. Draw a complete UML class diagram which shows: Classes (Only the ones listed in bold below) Attributes in classes (remember to indicate privacy level, and type) No need to write methods Relationships between classes (has is, is a, ...) Use a program like Lucid Cart and then upload your diagram. Each movie has: name, description, length, list of actors, list of prequals and sequals Each TV Show has: name, description,...
Draw a UML diagram that describes a class that will be used to describe a product...
Draw a UML diagram that describes a class that will be used to describe a product for sale on Glamazon.com. The product has a name, a description, a price, ratings by many customers (1 to 5 stars), and a group of customer comments. New products have no ratings or comments by customers, but do have a name, description and price. The price can be changed and more customer ratings and comments can be added. A global average rating of all...
NEed UML diagram for this java code: import java.util.ArrayList; import java.util.Scanner; class ToDoList { private ArrayList<Task>...
NEed UML diagram for this java code: import java.util.ArrayList; import java.util.Scanner; class ToDoList { private ArrayList<Task> list;//make private array public ToDoList() { //this keyword refers to the current object in a method or constructor this.list = new ArrayList<>(); } public Task[] getSortedList() { Task[] sortedList = new Task[this.list.size()];//.size: gives he number of elements contained in the array //fills array with given values by using a for loop for (int i = 0; i < this.list.size(); i++) { sortedList[i] = this.list.get(i);...
Use the UML tool to draw a UML class diagrambased on the descriptions provided below....
Use the UML tool to draw a UML class diagrambased on the descriptions provided below.The diagram should be drawn with a UML toolIt should include all the classes listed below and use appropriate arrows to identify the class relationshipsEach class should include all the described attributes and operations but nothing elseEach constructor and method should include the described parameters and return types - no more and no lessPlease do one of the following in JavaDescriptions of a PriceBecause of the...
What would the pseudocode look like for this UML class diagram? Class - oranges: String -...
What would the pseudocode look like for this UML class diagram? Class - oranges: String - bananas: String - grapes: String - apples: String + Class(String bananas, String grapes, String apples) + oranges( ): void + isValidGrapes( ): boolean + isValidApples( ): boolean + getOranges( ): String + getBananas( ): String + setBananas(String bananas): void + getGrapes( ): String + setGrapes(String grapes): void + getApples( ): String + setApples(String apples): void
1.) According to the UML Class Diagram, these are the mutator and accessor methods that you...
1.) According to the UML Class Diagram, these are the mutator and accessor methods that you need to define: 1a.) +setName(value:String):void 1b.) +setGPA(value:double):void 1c.) +setID(value: String):void 1d.) +getName(): String 1e.) +getLastName():String 2.) Working with constructors 2a.) +Student() : This is the default constuctor. For the Strings properties, initialize them to null. The order is String ID, String name, String lastName, and double GPA. 2b.) +Student(value:String) - This constructor receives just the ID. 2c.) +Student(value:String, var: String) - This constructor receives...
In java program format Submit your completed UML class diagram and Java file. Part I: Create...
In java program format Submit your completed UML class diagram and Java file. Part I: Create a UML diagram for this assignment PartII: Create a program that implements a class called  Dog that contains instance data that represent the dog's name and age.   define the Dog constructor to accept and initialize instance data.   create a method to compute and return the age of the dog in "person-years" (note: dog age in person-years is seven times a dog's age).   Include a toString...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT