Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

Design a class named Wheel to represent a wheel. The class contains: --- Three constants named ONE, TWO, THREE and FOUR with values 1, 2,3

Design a class named Wheel to represent a wheel. The class contains: --- Three constants named ONE, TWO, THREE and FOUR with values 1, 2,3 and 4 to denote the wheel speed. --- An int data field named speed that specifies the speed of the wheel (default TWO). --- A boolean data field named on that specifies whether the wheel is rotating or not (default false). --- A double data field named radius that specifies the radius of the wheel (default 5). ---- A string data field named company that specifies the company that made the wheel (default ABC). --- A no-arg constructor that creates a default wheel. --- The accessors and mutators methods for all four data fields. --- A method named toString() that returns a string description for the wheel. If the wheel is rotating, the method returns the wheel speed, color, and radius in one combined string. If the wheel is not rotating, the method returns wheel company and radius along with the string "wheel is off" in one combined string. Write a test program that creates two wheel objects. --- Assign ONE speed, radius 10, company ABC, and turn it on to the first object. --- Assign FOUR speed, radius 5, company XYZ, and turn it off to the second object. Display the objects by invoking their toString method.

Can you please help me out with this and all of this is for C++

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions