辅导CISC 124编程业、Java语言编程 写作、 辅导data留学生编程

” 辅导CISC 124编程业、Java语言编程 写作、 辅导data留学生编程Coding Assignment 2 – CISC 124 – Introduction to Computing Science II (ASO) S20DESCRIPTIONOverview – Order of SubmissionThe following assignment has a peer review component. Here is the order of submission:1. Read the activity description and prepare the relevant le.2. Submit your lein Aropa and start the peer review process (instructions to follow).3. Review and revise your work (optional).4. Submit your nalwork in OnQ.DescriptionDepartment of Transportation RegistryIn this assignment, you will have the opportunity to practice writing several Java classes involvinginheritance. You have been hired by the Department of Transportation to create a program that theycan use to keep track of vehicle registrations. Your program will maintain registration details for cars,trucks and motorcycles. The hierarchy of the program will be structured as follows:You will write a Vehicle class that will be used to represent all types of vehicles. You will then writethree sub-classes: Car, Truck, and Motorcycle. These sub-classes will contain the variables andmethods that are specicto particular types of Vehicles.You will write a CarOwner class which will represent the owner of a vehicle.You will write a Registry class. This class is a simple collection class that represents a collection ofvehicle objects.The Vehicle class will have the following instance variables:- registrationNumber (vehicles registration number) 辅导CISC 124作业、Java语言作业 写作2020/7/18 Coding Assignment 2 – CISC 124 – Introduction to Computing Science II (ASO) S20 httpss://onq.queensu.ca/d2l/le/content/388353/viewContent/2198457/View 2/5- owner (a CarOwner object representing the owner of the vehicle)- odometerReading (representing the odometer reading of the vehicle)- make (make of the vehicle — i.e. Chevrolet)- model (model of the vehicle — i.e. Silverado)- year (model year of the vehicle. The model year of the vehicle must be 1980 or later)- numWheels (number of wheels on the vehicle. Every vehicle has a minimum of 2 wheels)- plateNumber (the license plate number. This will be a combination of letters (L) and numbers (#). InOntario, a license plate is of the form 4Ls and 3#s. As an example, a license plate may be: HGKW815. Every vehicles plate number must be of the correct letter-number combination).In addition to the instance variables inherited from the Vehicle parent class,the Car class will havethe following instance variables:- numSeats (number of seats in the Car)- isSUV (indicating whether the Car is a sport utility vehicle — SUV).In addition to the instance variables inherited from the Vehicle class,the Truck class will have thefollowing instance variables:- isSemi (True if the truck is a transport truck, False if the truck is another type — i.e. cubetruck/pickup).- loadCapacity (the weight that the truck can hold, measured in pounds).The Motorcycle class will inherit all of its instance variables from the Vehicle class. Think about:why might we choose to create a Motorcycle class if it inherits all of the instance variables andmethods from the vehicle class but doesnt specify any of its own instance variables or override anyof the methods from the Vehicle class?The CarOwner class will include the following instance variables:- name (the name of a driver)- age (the age of a driver)- gender (the gender of a driver)- licenseNumber (the license number of a driver)- yearsDriving (the number of years that a driver has been driving).The Registry class will include two elds:- vehicleCollection (an arraylist to hold a collection of vehicle objects currently registered in theprovince.)- numVehicles (the number of vehicles currently registered in the province).REQUIRED METHODS2020/7/18 Coding Assignment 2 – CISC 124 – Introduction to Computing Science II (ASO) S20 httpss://onq.queensu.ca/d2l/le/content/388353/viewContent/2198457/View 3/5Each of your classes should provide accessor (getter) and mutator (setter) methods for each ofthe instance variables of the class. For example, your Vehicle class should include a mutatormethod for setting the mileage and setting the plate number for an instance of a Vehicle object.Each of your classes should also include a toString method that prints out a string representationof an instance of the object. Your Vehicle parent class should have its own toString method whichthe children classes willoverrideto print out information specicto the child class. For example,the toString method for a Truck will print out information about the number of axles…this wouldnot apply when printing the string representation of a Motorcycle object.In your Truck class, include a function called getNumberAxles(). The number of axles returns howmany axles the truck has – we assume that the number of axles is the number of wheels divided by2.The Registry class should include the following functions:addVehicle – adds a vehicle object to the registry.printRegistry – print the vehicles that are currently inventoried in the registry.averageMileage – calculates the average mileage of all vehicles in the registry (using theodometerReading attribute of the vehicles).ERROR CHECKING INFORMATION HIDINGError CheckingYou are required to check for the following errors in user input.If there is an attempt made to create an instance of a Vehicle for which the vehicles year is earlierthan 1980, throw an exception and print out the message (Illegal year – you need to buy a newervehicle!).If the setMileage method in the Vehicle class is called, your program should verify thatthe new value for the mileage is not less than the old value for the mileage. If it is, throw anexception and print out the message (Illegal mileage – nice try!).If there is an attempt to set the number of wheels of any vehicle to less than two, throw anexception and print out the message (Illegal number of wheels – buy a unicycle!).If there is an attempt to set the vehicles plate number to an illegal value (i.e. doesnt satisfy theletter-number combination of 4 letters and 3 numbers), throw an exception and print out themessage (Illegal license plate!).If there is an attempt to set the age or yearsDriving instance variable of a Person object to a valueless than 0, throw an exception and print out the message (Illegal value!).Information HidingMarks will be allocated according to how well you have implemented the principles of informationhiding in the development of your class. Reminders:All instance and class variables should be private. This ensures that other classes are not able tomodify the values of these attributes. Any changes to the values of the attributes should be madeby invoking the getter and setter methods of the class.2020/7/18 Coding Assignment 2 – CISC 124 – Introduction to Computing Science II (ASO) S20 httpss://onq.queensu.ca/d2l/le/content/388353/viewContent/2198457/View 4/5Any instance variables that are included in a parent class must NOT be redenedin a child class.For example, since the instance variable makeis included in the Vehicle class, it should not beredenedin the Car, Motorcycle or Truck classes. Instead, use the super keyword to access theconstructor of the parent class.Please ensure that Your class includes accessor (getter) and mutator (setter) methods for eachof the instance variables.Constants should be private unless they need to be used by other classes.Any helper methods should be private. A helper method is a method that you write to helpimplement the required methods.You will need to write an exception class called IllegalVehicle. This exception class only needsthe one constructorThat accepts a String type message.Throw an IllegalVehicle exception objectif an attemptis made to set or alter any oftheattributes to illegal values.Please ensure that Your classes include accessor (getter) and mutator (setter) methods foreach ofthe instance variables.PEER REVIEWThis assignment includes a Peer review feature. Before you submit this assignment to the teachingteam we would like you to submit it to be reviewed by your peers. The purpose of the peer reviewActivity is to provide you with the opportunity to collaborate and learn from your peers and for yourpeers to learn from you. Once You receive feedback From your peer, you have the option to correctyour work before submitting it for grade.InstructionsYou will submit your work through a web-based application called AropaEach student will review (anonymously) another students work according to the rubric below.When reviewing your peers work, keep a positive mindset and positive intentions, you are helpingyou peer improve.This review is worth 2% of your overall grade in the course.Read the following instructions on how to write your review in AropaEvaluating RubricOn a scale of 3-0, please rate your peers code.3- Very good, 2 – some improvements are required, 1 – signicantimprovementsrequired, 0- Nosubmission3 2 1 0 Comments2020/7/18 Coding Assignment 2 – CISC 124 – Introduction to Computing Science II (ASO) S20 httpss://onq.queensu.ca/d2l/le/content/388353/viewContent/2198457/View 5/5EfciencyClean code,indicates that thecode wasAdequatelydevelopedNoSubmissionMaintainabilityReadable otherpeople, acombination ofshort, simple,consistent anduseful naming withclear logic.Well structuredThe various objectsin the code workingoptimally together.Follows standardsThe code follows aSet of guidelines,rules, andregulations.FINAL SUBMISSIONSubmit your nalwork in OnQ to the following assignment submission folder如有需要,请加QQ:99515681 或邮箱:99515681@qq.com

添加老师微信回复‘’官网 辅导‘’获取专业老师帮助,或点击联系老师1对1在线指导