Determine the type of moped

Assignment Help JAVA Programming
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.

Reference no: EM13114865

Questions Cloud

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?

Reviews

Write a Review

JAVA Programming Questions & Answers

  Develop java code to compute monthly rent for housing units

Develop a java code that computes monthly rent for 3 housing units namely Bungalows,Apartments and hostels. All housing units have got size,color and monthly rental rate.

  Write ijvm program to multiply two hexadecimal numbers

Write the IJVM program that multiplies two (hexadecimal) numbers. The user inputs the hex numbers and the result is printed out. The program then accepts another pair of numbers.

  Java program which demonstrates cellular automata

Using the internet, locate a Java program (or Java applet) which demonstrates "Cellular Automata", in particular "the Game of Life".

  Distributed systems

Build robust, secure distributed systems using advanced programming techniques

  Write a java application to ask number of assignments

Write a java application that accomplishes the following tasks with built in exception handling: ask the number of homework assignment students have submitted in a semester

  Dijikstra for undirected graph using simple scheme

Dijikstra for undirected graph using simple scheme with array and fibonacci heap and compare the performance/results, preferably in java.

  Sorted list adt and the binary search tree adt

Explain the differences between our specifications of the Sorted List ADT and the Binary Search Tree ADT.

  Recognize one high severity vulnerability for computer

Recognize one high severity vulnerability for each computer (if there is one). Explain vulnerability and describe control(s) to minimize risk from vulnerability.

  Java application to display multiple choice questions

Write down the application which displays series of TEN(10) multiple choice questions: questions must cover all the Java. Each question must have four possible answers and only one answer must be correct.

  Java application to permit user to enter ten numbers

Write down Java application which permits a user to enter 10 numbers (double precision) into the array and then sorts and displays numbers from lowest to highest.

  Produce a design document

You will design and deliver a website foes fictional client part-1 Website Design Document and produce a design document

  Write an application that uses string method region

Write an application that uses String method region - Matches to compare two strings input by the user. The application should input the number of characters to be compared and the starting index of the comparison.

Free Assignment Quote

Assured A++ Grade

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!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd