Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2 5 . Gym MembershipCreate a class called GymMembership that takes in the number of Gym Memberships and the type. Using a constructor, define two

25. Gym MembershipCreate a class called GymMembership that takes in the number of Gym Memberships and the type. Using a constructor, define two instance parameters num and gym_type. Assign the values of your parameters to two attributes number and type.Within this class add three methods with the following purpose:Determinerate ==> finds the cost of the membership based on the type of membership the user wants. It will store this value in the attribute rate The "bronze" membership is 25 dollars a month, the "silver" membership is 35 dollars a month, the "gold" membership is 50 dollars a month and the "platinum" is 75 dollars a month.DetermineTotal ==> uses the cost of one membership and multiplies it by the number of memberships. It will store this value in an attribute called total. At this gym, customers agree to a one year contract. Therefore the total is going to be for the year and not the month.ReturnTotal ==> returns the total cost for the membership.Once you have created your class, create an object based on this class. Use s for the number of memberships and silver for the type of membership. Make sure you call your method to determine the rate BEFORE you call the method to determine the total. Utilize the Return Total method to print the total to

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

How do the balance sheet and income statement interrelate?

Answered: 1 week ago

Question

Define induction and what are its objectives ?

Answered: 1 week ago

Question

Discuss the techniques of job analysis.

Answered: 1 week ago

Question

How do we do subnetting in IPv6?Explain with a suitable example.

Answered: 1 week ago

Question

Explain the guideline for job description.

Answered: 1 week ago

Question

What is job description ? State the uses of job description.

Answered: 1 week ago

Question

2. Define identity.

Answered: 1 week ago

Question

1. Identify three communication approaches to identity.

Answered: 1 week ago

Question

4. Describe phases of majority identity development.

Answered: 1 week ago