n JAVA: A subclasss of you bicycle class for a mountain bicycle, as described in the section: Classes Your  brand comes with a water bottle (both the generic and mountain type). Add a new field that will keep the percentage of water remaining in the bottle (1 full, 0 emptty, 0.5 half empty), as described in the section: Declaring member variables. The water bottle is emptty by default. Declare a method to completely fill the water bottle. Declare a method to completely drink the water. No parameters needed. See: Defining methods. Declare a method that will specify how much to fill the water bottle, as a percentage. If the bottle has already that quantity, do nothing. The method must have the same name as above. A parameter is needed. Declare a method that will specify how much to drink from the water as a percentage. The method must have the same name as above. A parameter is needed.  Create a new constructor that will specify the initial cadence, gear and water level. See: Providing Constructors for Your Classes Create another class, with a main method, in which you will take a trip aroound your house in your mountain bicycle, changing your bicycle attributes, starting and ending from a complete stop, and ringing the bell twice at start and once at the end. You must start with 3/4 filled water bottle, and dring some water once. Your trip must have at least 5 different parts in which you change your bicycle state and print its state (starting and ending from a rest state).

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

In JAVA:

  • A subclasss of you bicycle class for a mountain bicycle, as described in the section: Classes
  • Your  brand comes with a water bottle (both the generic and mountain type). Add a new field that will keep the percentage of water remaining in the bottle (1 full, 0 emptty, 0.5 half empty), as described in the section: Declaring member variables. The water bottle is emptty by default.
  • Declare a method to completely fill the water bottle. Declare a method to completely drink the water. No parameters needed. See: Defining methods.
  • Declare a method that will specify how much to fill the water bottle, as a percentage. If the bottle has already that quantity, do nothing. The method must have the same name as above. A parameter is needed.
  • Declare a method that will specify how much to drink from the water as a percentage. The method must have the same name as above. A parameter is needed. 
  • Create a new constructor that will specify the initial cadence, gear and water level. See: Providing Constructors for Your Classes
  • Create another class, with a main method, in which you will take a trip aroound your house in your mountain bicycle, changing your bicycle attributes, starting and ending from a complete stop, and ringing the bell twice at start and once at the end. You must start with 3/4 filled water bottle, and dring some water once.
  • Your trip must have at least 5 different parts in which you change your bicycle state and print its state (starting and ending from a rest state).
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY