Design the cake class. The cake class has 2 instance variables, a double called radius and a bool called isEaten. Write

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Design the cake class. The cake class has 2 instance variables, a double called radius and a bool called isEaten. Write

Post by answerhappygod »

Design the cake class. The cake class has 2 instance variables,
a double
called radius and a bool called isEaten. Write the following
methods for the
cake class:
a. A default constructor that sets radius to 1.5 and bool to
false.
b. An instance method named EatCake. The cake calling the method
has
its radius set to 0 and isEaten value set to true.
c. A static method named EatBakery. It accepts an array of cake
objects
as a parameter. The method passes all cakes in the array to
the EatCake method.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply