Question: Q1) Create a class TravelPackage having fields Destination, TourGuideName, PackageCode, and Price. Declare a mutator method namely updatePrice() to increase the Price by 300 SAR.
Q1) Create a class TravelPackage having fields Destination, TourGuideName, PackageCode, and Price. Declare a mutator method namely updatePrice() to increase the Price by 300 SAR. Suppose the Price before update was 3800 SAR.
Q2) Create a class World with fields continents and countries and implement the concept of constructor overloading. Declare 3 constructors (Empty constructor, Partial argument constructor, Full argument constructor).
Q3) Create a class Shape that defines a variable named window of type Rectangle, and then create a rectangle object and assign it to the variable window. The rectangle constructor has two int parameters.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
