Already have an account? Get multiple benefits of using own account!
Login in your account..!
Remember me
Don't have an account? Create your account in less than a minutes,
Forgot password? how can I recover my password now!
Enter right registered email to receive password!
a. Write code to define an abstract class 'Passenger" with the following attributes: account_num, fname, lname, points, num_pass (NB this is a class variable which keeps a tally on the number of passenger objects created) There is only one constructor that receives: account_num, fname, lname, points. You must also include the necessary 'getters' and 'setters' (where appropriate) to make the attributes available. Include an abstract method 'calcPoints' that returns nothing but accepts the cost of the ticket. b. Write a method 'toString' for the Passenger object defined above. This method must return a string stating the: account_num, fname, lname, points of the Passenger in a well structured sentence/format. c. Define a separate class 'Regular' which is a subclass of 'Passenger'. In the constructor of this new class ensure that you invoke the constructor of the parent class 'Passenger' to initialize the inherited variables. Implement the 'calcPoints' method as follows: 1. Finds the current points by dividing the ticket cost by 10 e.g. $1500 / 10 = 150 points 2. Adds the current points to the points already accumulated [4 marks] d. Define a separate class 'Premium' which is a subclass of 'Passenger'. In the constructor of this new class ensure that you invoke the constructor of the parent class 'Passenger' to initialize the inherited variables. Implement the 'calcPoints' method as follows: 1. Finds the current points by dividing the ticket cost by 5 e.g $1500 / 5 = 300 points 2. Adds the current points to the points already accumulated e. Write a separate class 'Airline' which contains a main method. In the main method you must create four objects: two Regular Passenger and two Premium Passenger. Next you are required to create an array 'pass_arr' of type 'Passenger'of size 4. Store the four account objects in this array. Finally you are required to perform the following operations on the objects: i. Traverse the array and display the information for each Passenger by invoking the 'toString()' method you wrote in part b. ii. Traverse the array and invoke 'calcPoints' for each Passenger to update the points earned thus far. iii. Output the updated array. NB. To create the 'Regular' and 'Premium' Passenger objects above you are free to 'hard code' the attribute values.
What are the sizes in memory of other data types in C++? I mean, I know that a double is 8 bytes and an int is 4 bytes. What is the size of a Char and a String?
Also, your application should show a table that shows each possible roll of the dice and its frequency of occurrence in the simulation in a listbox. In other words, the table shows the count of a roll of 2, the count of a roll of 3, and so on up t..
Sears is losing market share, has been acquired by K-Mart, and is eliminating jobs; Wal-mart is gaining market share and hiring. Write ethical issues involved, and which firm has a more ethical position?
why does the label control that contains your name print above the page number?
Discuss the issues of encryption and key management in cloud computing, how it different for personal computers and traditional enterprising computing environments.(1300-1400 words)
Which of these is a repository of security-related documentation and also sponsors a number of security research projects? A) F-Secure B) Computer Emergency Response Team C) Microsoft Security Advisor D) SANS Institute.
Dis-assemble each of the following MIPS R2000 object code into source code instructions. Use register names, such as $t2, instead of numbers, such as $20.
Primarily a product survey of a small system that would have the specifications to meet the requirements of an a financial investment or architectural firm
Given two int variables, firstPlaceWinner and secondPlaceWinner , write some code that swaps their values. Declare any additional variables as necessary.
Explain reasons for consulting different kinds of sources on the same subject.
Discuss the role of incident containment in an incident response strategy and how a lack of planning for containment is a potential pitfall for any response strategy.
This function returns the bottom of the Stack instead of the top
Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!
whatsapp: +1-415-670-9521
Phone: +1-415-670-9521
Email: [email protected]
All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd