Reference no: EM13114865
Questions:
1. Write a programme that computes the rental charge given the type of moped, when it is rented (weekday or weekend), and the number of hours rented.
The rental charges are as follows:
(a) Type of moped '50cc Mopette': Weekly rental is $15 for the ?rst 3 hours and $2:50 per hour after the ?rst 3 hours. Weekend rental is $30 for the ?rst 3 hours and $7:50 per hour after the ?rst 3 hours.
(b) Type of moped '250cc Mohawk': Weekly rental is $25 for the ?rst 3 hours and $3:50 per hour after the ?rst 3 hours. Weekend rental is $35 for the ?rst 3 hours and $8:50 per hour after the ?rst 3 hours.
Create a class called Moped with appropriate data members (attributes or properties) and methods. Be sure to have a constructor that can accept the size (50cc or 250cc) to determine the type of moped and another one for the different default rental amounts. The class design should include:
(a) Data Members (attributes): size, dayOfWeek, hours, name, three- HourPrice, hourlyPrice, totalCost.
(b) Constructors: Moped() (default values will be for 50cc) andMoped(int size, String day, int hours).
(c) Accessor (Get) Methods: getSize(), getDayOfWeek(), getHours(), getName(), getThreeHourPrice(), getHourlyPrice(), getTotalCost().
(d) Mutator (Set) Methods: setSize(int s), setDayOfWeek(String d), setHours(int h).
(e) Computation Methods: computeTotalCost, mopedName, isWeekend (you can also add some helper methods if you need).
The following UML diagram might be of assistance:
2. Write a driver class called MopedRental. This class should perform the following: asks the user to enter the size of the moped, the day of the week and the number of hours rented, creates the Moped object, based on the size, and displays the input data, type of moped and the total cost of the moped rental. Use the appropriate format for the output values.
3. Scoring in a single game of tennis starts with love-all, then scores of 15, 30, and 40. A player wins when he or she is two points ahead of their opponent and has a score of over 40, where the terms advantage server, deuce (tied score), and advantage receiver are used when the score is 40-all or higher.
Prepare a class called TennisGame that can be used to encapsulate the score in a single game of tennis. Then write a driver program called TennisSet, that plays a set of ?ve games of tennis between two players A and B (randomly choosing the winner of each point), ideally alternating the server for each game, and outputting a commentary of the progress and result of each game.
Identify the coefficient of kinetic friction
: The pulling force has a magnitude of 81.5 N and is directed at an angle of 30.0° above the horizontal. Identify the coefficient of kinetic friction.
|
Explain develop a technology plan
: Explain Develop a technology plan, a proposal of your technology recommendations, for addressing those problems.
|
What mass of this substance must evaporate
: What mass of this substance must evaporate in order to freeze 170 of water initially at 23? (The heat of fusion of water is 334 the specific heat of water is 4.18 .
|
What information could insurance agent gleen from such data
: Should insurance companies be given access to a prospective client's whole genome sequence? Why or why not? What information could the insurance agent gleen from such data?
|
Determine the type of moped
: Write a driver class called MopedRental. This class should perform the following: asks the user to enter the size of the moped, the day of the week and the number of hours rented, creates the Moped object, based on the size, and displays the input..
|
Description of long term debtor
: For the year ending June 30, 2008, the New Corporation has current assets of $275,000 and total assets of $900,000. It also has current liabilities of $100,000, equity of $200,000, and retained earnings of $300,000.
|
Illustrate what was the angular acceleration of the grinding
: Illustrate what was the angular acceleration of the grinding wheel as it slowed down? Through what total angle did the wheel turn between t = 0 and the time it stopped?
|
Real estate profit for desired return
: Kevin wants a return of 50% from his one-year investment in real estate. He believes that he can sell the property at the end of the year for $250,000 and that the property will provide him with income of $50,000.
|
Find better relative to class using standard deviation
: Class where the mean is 85 and the standard deviation is 4.59, who did better relative to their class? Note both did better than the class mean. How do you answer this question?
|