java : object oriented

java : object oriented

(a) Write a class named CarRental that contains fields that hold a renterâ??s name, zip code, size of the car rented, daily rentral fee, length of rental in days, and total rental fee.

The class contains a constructor that requires all the rental data except the daily rate and total fee, which are calculated, based on the size of the car: economy at RM29.90 per day, midsize at RM38.90 per day, or full size at RM43.50 per day. The class also includes a display () method that displays all the rental data.

(b) Create a subclass named LuxuryCarsRental. This class sets the rental fee at RM79.90 per day and prompts the user to respond to the option of including a chauffeur at RM200 more per fay. Override the parent class display() method to include chauffeur fee information.

(c) Draw a complete UML Diagram for above two classes and their relationship.

(c) Write an application named UseCarRental that prompts the user for the data needed for a rental and creates an object of the correct type. Display the total rental fee.

View Answers

March 24, 2012 at 9:24 PM

(a) Write a class named CarRental that contains fields that hold a renter�s name, zip code, size of the car rented, daily rentral fee, length of rental in days, and total rental fee.

The class contains a constructor that requires all the rental data except the daily rate and total fee, which are calculated, based on the size of the car: economy at RM29.90 per day, midsize at RM38.90 per day, or full size at RM43.50 per day. The class also includes a display () method that displays all the rental data.

(b) Create a subclass named LuxuryCarsRental. This class sets the rental fee at RM79.90 per day and prompts the user to respond to the option of including a chauffeur at RM200 more per fay. Override the parent class display() method to include chauffeur fee information.

(c) Draw a complete UML Diagram for above two classes and their relationship.

(c) Write an application named UseCarRental that prompts the user for the data needed for a rental and creates an object of the correct type. Display the total rental fee.









Related Tutorials/Questions & Answers:
Object Oriented
Object Oriented  C++ is Purely object oriented or not .Then why java called purely object oriented
Byte ? Oriented Stream and Character- Oriented Stream
Byte ? Oriented Stream and Character- Oriented Stream  difference between Byte ? Oriented Stream and Character- Oriented Stream
Advertisements
Byte ? Oriented Stream and Character- Oriented Stream
Byte ? Oriented Stream and Character- Oriented Stream  Difference between Byte ? Oriented Stream and Character- Oriented Stream
What is attribute oriented programming?
What is attribute oriented programming?  Hi, What is attribute oriented programming? Thanks
object oriented programming protocol
object oriented programming protocol  What is object oriented programming protocol? Is it different from objective c protocol programming?? Thanks
Is Java object oriented?
Is Java object oriented?  Hi, Is Java object oriented? Thanks   Hi, Java is object oriented programming language. It is supports OPPS concepts: Object Class Inheritance Polymorphism Abstraction Encapsulation All
Object Oriented Programming in PHP
Object Oriented Programming in PHP  Hi, Which version of PHP supports OOPS. How can I learn Object Oriented Programming in PHP? Thanks (adsbygoogle = window.adsbygoogle || []).push
java is pure object oriented
java is pure object oriented  java is pure object oriented or not.? reason.?   Java is not pure object oriented language because... are not object 2)It does not support operator overloading multiple inheritance. 3
Object Oriented Programming II
Object Oriented Programming II  Instructions: ->each class to be created must have encapsulated fields, setters and getters methods, and constructors Create a class named "Paper" with the following attributes
ModuleNotFoundError: No module named 'goal_oriented'
ModuleNotFoundError: No module named 'goal_oriented'  Hi, My... 'goal_oriented' How to remove the ModuleNotFoundError: No module named 'goal_oriented' error? Thanks   Hi, In your python
java : object oriented
java : object oriented   (a) Write a class named CarRental... the user for the data needed for a rental and creates an object of the correct... an object of the correct type. Display the total rental fee
Is Java a pure object oriented language?
Is Java a pure object oriented language?   Hi, Is Java a pure object oriented language? thanks   Hi No, Java is an object oriented programming language but not purely a object oriented language. In OOPs programming
object oriented programming - Java Beginners
object oriented programming  sir, i read in the book tat object oriented program exhibits recurring structures. i want to know "what is meant by recurring structures?"  Hi Friend, Any structure to be occurred over
What are the features and advantages of OBJECT ORIENTED PROGRAMMING?
What are the features and advantages of OBJECT ORIENTED PROGRAMMING?  What are the features and advantages of OBJECT ORIENTED PROGRAMMING
object oriented programming data science
object oriented programming data science  Hi, I am beginner in Data...: object oriented programming data science Try to provide me good examples or tutorials links so that I can learn the topic "object oriented programming
Object Oriented concepts
OOP stands for Object Oriented Programming. This is a technique used... on the following links Object Oriented concepts..., every real life object has properties and behavior. which is achieved through
Object-Oriented programming - Java Beginners
Object-Oriented programming  Write a program to display the names and salaries of 5 employees.Make use of a class and an array.The salary of each employee should increase by 5% and displayed back.  Hi friend, Code
Object oriented program - Java Beginners
Object oriented program  Write a class called RaceCar.java that contains instance variables horsepower, weight, zeroTo60, and milesPerGal. The value of zeroTo60 (in second) is determined by the formula zeroTo60 = weight
object oriented program.. - Java Beginners
object oriented program..  Write a class called RaceCar.java that contains instance variables horsepower, weight, zeroTo60, and milesPerGal. The value of zeroTo60 (in second) is determined by the formula zeroTo60 = weight
What is Service-Oriented Architecture?
Service Oriented Architecture or SOA for short is a new architecture for the development of loosely coupled distributed applications. In fact service-oriented... service coordination. Earlier SOA was based on the DCOM or Object Request Brokers
fully object oriented language - Java Beginners
fully object oriented language  Is java is a fully object oriented language?if no,why?  Hi Friend, Java is not a fully object oriented... int,float which are not object 2)It does not support operator overloading
Service Oriented Architecture
Service Oriented Architecture          Service Oriented Architecture or SOA for short is a new.... In fact service-oriented architecture is collection of many services
Java using Netbeans Object Oriented Programming
Java using Netbeans Object Oriented Programming   I am trying to make a program that uses a main class and a separate class with one public method and one private method. The main method in the main class asks the user for 2
Object Oriented Programming in Java
OOPS acronym for Object Oriented Programming is a model or concept that works... is an instance of a class. For a language to be an Object Oriented Programming... world. Every object has a certain behavior, properties, type, and identity
Object oriented design - Java. - Design concepts & design patterns
Object oriented design - Java.  Hi, Everyone.Pls help me to develope my project of Object oriented design, as I have to submit it on thursday,3rd Dec. 2009.Nowadayz I am suffering from fever and not able to concentrate
core java code in object oriented manner - Java Interview Questions
core java code in object oriented manner   hi this is komali .i want small code for this question .its very urgent .please send me as soon as possible . i am waiting for code Sports Associations in India
Struts Validator Framework - lab oriented lesson
the use of Validator framework, with a lab-oriented lesson. ADS_TO_REPLACE_2
An Overview of Java      Java is a programming language      Java is Object Oriented Programming
; Java as a programming language Java is an Object oriented...; Java as an Object Oriented Language In this section, we will discuss the OOPs... are in an object-oriented form of C which are being provided by javah , but they are still
EAI - Service Oriented Architecture,EAI Architecture,Enterprise Application Integration,Enterprise Application Integration EAI
of integration methodologies like Object Oriented Programming, COM, CORBA etc. EAI... Bus), MOM (Message Oriented Middleware), DMA (Distributed Messaging Architecture), EDA (Event Driven Architecture), SOA (Service Oriented Architecture), eAI
Exp.4 Write any C++ programs to demonstrate multiple inheritance concept of an object oriented programming.
Exp.4 Write any C++ programs to demonstrate multiple inheritance concept of an object oriented programming.  (Aim:- The main aim of this experiment is reusability of code and getting idea about classifying objects , identifying
JavaScript Object Oriented Feature
 JavaScript Object Oriented Feature  .... This is rather unfortunate because it severely limits the power of an object-oriented...-side components. JavaScript  object oriented will be presented in a series
Open Source Aspect-Oriented Frameworks written in Java
Open Source Aspect-Oriented Frameworks written in Java
Java as an Object Oriented Language
Java as an Object Oriented Language   ... applications and programs. OOP stands for Object Oriented Programming.... There are four main pillars of an Object Oriented Programming Language
Object-Oriented Language: Java / APIs, Java OOPs
Java OOPs In this section we will learn Object Oriented (OOPs) Concepts .... Java is one of the useful Object Oriented programming language. Other Object..., Lasso, Perl 5,PHP5, VBScript, VBA etc. Java is popular object oriented programming
Introduction
Java as an Object Oriented Language   ... the java applications and programs. OOP means Object Oriented Programming.... To be an Object Oriented language, any language must follow at least the four
OOP
; Object Oriented Programming which was totally based on the real life entities... for Object oriented  Programming. Previously we used to follow... of the real world object and forces to concentrate on the various
Java Object
Java Object         Object is the basic entity of object oriented programming language. Object.../java/master-java/java-object-oriented-language.shtml  
Mootools
; MooTools is an acronym for My Object-Oriented Tools. This is a lightweight, object-oriented, powerful, flexible, and cross-browser web application JavaScript..., obeys the object oriented concepts, containing component with advanced effects
Java7 : OOPs Concepts
JAVA7 : OOPs Concept In this section we will discuss concept of Object oriented programming. Object Oriented Programming : Object Oriented Programming, better termed as OOPs is a paradigm where everything is represented as an object
Inheritance in java with example
Inheritance in java with example          Inheritance is one of the concept of the Object- Oriented programming. The advantage of using the inheritance
Java Training and Tutorials, Core Java Training
Java Training and Tutorials, Core Java Training       Core Java Training Java is a powerful object-oriented programming language with simple code
Method
; In this section, we will explore the concept of method in the reference of object oriented... of method in java object-oriented technique first one is the Instance method... perform the most important work in a class, object can't do anything without
Wicket
Wicket       Wicket is a mixed mode Java framework with built in support for Ajax, Just Java' object oriented programming Read full DescriptionADS_TO_REPLACE_1
Java Transaction API
Java Transaction API        JTA is a service-oriented API specification that allows applications to perform distributed transactions. Transactions access and update data on two
OOPs and Its Concepts in Java
;    Brief Introduction to OOP Object Oriented.... Java is a object oriented programming  and to understand... certain things common. In object oriented programming classes can inherit some
Method Overriding
Method Overriding       Overriding is another useful feature of object-oriented programming technique. It provide the facility to redefine the inherit method of the super class
Design Pattern
are language-independent strategies used to solve common object-oriented design... and result oriented.    Learning the design patterns is a multiple step
Learn Java - Learn Java Quickly
Learn Java - Learn Java Quickly       Java is an object oriented programming language... useful than other object oriented languages. It is now most demanded
Hibernate Criteria Query Example
Hibernate Criteria Query Example       The Criteria interface allows to create and execute object-oriented queries. It is powerful alternative to the HQL but has own

Ads