Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Must be in C++!! The code must work as above. Please include using pointers, inheritance, and class structures. Here's a similar code of what I

Must be in C++!!

image text in transcribed

image text in transcribed

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

The code must work as above. Please include using pointers, inheritance, and class structures.

Here's a similar code of what I want.

#include  using namespace std; class GymMembership { public: GymMembership(); bool createm(int id, string name1); //create function void printStatus(); bool extend(int id,int add); //extend function bool canceReservations(int id); //cancel function bool deletem(int id); //delete function private: int id; string name1; }; static int newreserve [10][3]; //array that holds the member's id and months of subscription static int i=1; // ... GymMembership::GymMembership() { int subscrbmth; } bool GymMembership::createm(int id, string name1) //function that creates a new member with id and name { newreserve[i][0]=id; newreserve[i][1]=0; std::cout> command; GymMembership createmem; if (command=="create"){ cout>id; cout>name1; createmem.createm(id, name1); } if (command=="extend"){ int add=0 ; cout>id; std::cout>add; createmem.extend(id,add); } if (command=="cancel"){ int cancel=0; createmem.canceReservations(id); } if (command=="delete"){ int cancel=0; cout>id; createmem.deletem(id); } } return 0; } 

Gym Membership Program: This program asks for orders from the user in number. Orders include creating a profile (1), subscribing to a membership (2), removing membership (3), making a payment (4), deleting member account (5) and access to member's profile (6). When asking to create a new profile, the asks for the member's name, age and ID as an input to store the information. program With the ID created, the member can continue using other functions of the program such as subscribing to a membership. Memberships offered by the gym include Access to the gym annual ($600), Access to the gym monthly ($80), Special Programs (Hot yoga and Pilates) which are $250 each for a 4 weeks program. For special programs such as Hot Yoga and Pilates, there are three instructors available for each program with five spots per instructor for each program. Members can choose their own instructor as long as spots are available. Members can cancel their subscription for annual and monthly access to the gym, but special programs are non-refundable thus cancellation is not eligible. In order to delete their profile, there must be a payment made before for all of their subscriptions. The program will ask the user to make a payment first when there are any unpaid fees, to delete their account. The user can have access to the member's profile anytime with the member's ID, which prints the name, age, ID, subscriptions, and payment status of the member. Structure Member: Name, age, id (integer) Classes Membership: Gym Access Annual ($600), Gym Access Monthly ($80), Specific Program (Hot yoga and Pilates) ($250) Subclass Specific Program Instructor Available Hot Yoga Instructors: Brown, Johnson, Williams (There are five available spots for each instructor) Available Pilates Instructors: Wilson, Davis, Smith (same condition as above) *specific program (hot yoga and pilates) runs for 4 weeks *you cannot cancel once subscribed to special programs Functions included -create profile for new members (name, age, gender, id) -add a subscription -delete subscription (exception to specific programs) -pay for subscription -remove member profile (once checked all subscriptions are paid) -view account Welcome! 01: create an account 02: join membership 03: remove membership 04: payment 05: delete account 06: access to account // if entered 01, this must be printed (separated by space) Name, Age, ID: Input Amy 22 123 Output Welcome, Amy! 01: create an account 02: join membership 03: remove membership 04: payment 05: delete account 06: access to account // if entered 02, this must be printed Available subscriptions 01: Access To Gym (Annual: $600) 02: Access To Gym (Monthly: $80) 03: Special Program: Hot Yoga (4 weeks: $250) 04: Special Program: Pilates (4 weeks: $250) Member ID, subscription #: Input 123 03 Output Please choose an instructor: Brown, Johnson, Williams // if input is Brown, print Subscribed to membership 03, Brown. Available spots for Brown: % Welcome! 01: create an account 02: join membership Welcome! 01: create an account 02: join membership 03: remove membership 04: payment 05: delete account 06: access to account // if entered 02 again, this must be printed Available subscriptions 01: Access To Gym (Annual: $600) 02: Access To Gym (Monthly: $80) 03: Special Program: Hot Yoga (4 weeks: $250) 04: Special Program: Pilates (4 weeks: $250) Member ID, subscription #: Input 123 02 Output Subscribed to membership 02 Welcome! 01: create an account 02: join membership 03: remove membership 04: payment 05: delete account 06: access to account // if entered 06, this must be printed Member ID: Input 123 Output Name: Amy Age: 22 ID: 123 Subscription(s): 02, 03 Payment status: 02 ($80) unpaid, 03 ($250) unpaid Welcome! 01: create an account 02: join membership 03: remove membership 04: payment 05: delete account 06: access to account // if entered 05, this must be printed Member ID: Input 123 Output Member ID 123 has unpaid memberships. Please try again after making a payment. Welcome! 01: create an account 02: join membership 03: remove membership 04: payment 05: delete account 06: access to account // if entered 03, this must be printed Member ID, subscription #: Input 123 03 Output Program 03 cannot be cancelled. Input 123 02 Output Subscription to 02 has been removed. Welcome! 01: create an account 02: join membership 03: remove membership 04: payment 05: delete account 06: access to account // if entered 04, this must be printed Member ID, subscription #: Input 123 03 Output Payment has been made. Thank you. Welcome! 01: create an account 02: join membership 03: remove membership 04: payment 05: delete account 06: access to account

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

Oracle Databases On The Web Learn To Create Web Pages That Interface With Database Engines

Authors: Robert Papaj, Donald Burleson

11th Edition

1576100995, 978-1576100998

More Books

Students also viewed these Databases questions

Question

please dont use chat gpt AI 6 0 .

Answered: 1 week ago

Question

Use participantlist as the query name

Answered: 1 week ago