Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PYTHON Class DateProfile Create a class called DateProfile that has the following instance attributes: .gender - a single character string, the gender of the applicant

PYTHON

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

Class DateProfile Create a class called DateProfile that has the following instance attributes: .gender - a single character string, the gender of the applicant ('M or 'F). .search_gender single character string, the gender of desired partner (M or 'F). This is not the gender of the applicant, but of the applicant's requested partner. .romance an int from 1 to 10, indicating the importance of romance to the applicant. finance an int from 1 to 10, indicating the importance of finance to the applicant. name a string indicating the full name of the applicant. Each object in the DateProfile class represents an applicant's profile. If the object is (M, 'F, 7, 4, "Hugh Hefner") then the applicant's name is "Hugh Hefner", he's looking for a date who is Female, with romance being somewhat important (7) and finance being less important (4) Create instended static constants for . All range limits (like MIN ROMANCE, MIN NAME_LEN, etc.). These are the limits that the mutators test for. All default values (like DEFAULT_GEND, DEFAULT_SEARCH_GEND, DEFAULT_NAME). These are used if the constructor without arguments is called or if arguments are supplied but a bad value (out-of-range) is detected. However, they are not used directly in the constructors, as we will find that there are helper methods that do the dirty work for the constructors -see below You should supply all of the following instance methods of class DateProfile (at a minimum): Accessors and Mutators for each attribute (instance member). For example: char get_gender and bool set_gender(char gdr). In addition to individual mutators, create an instance methodset-all( ), that takes all five parameters and acts like a mutator, except that it does not return a boolean. i.?., in this one, you do not have to report bad parameters back to the user, even though you would still filter them out. Also, create an instance method, set defaults), that sets all five members to their default values

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

Database Systems Design Implementation And Management

Authors: Peter Rob, Carlos Coronel

3rd Edition

0760049041, 978-0760049044

More Books

Students also viewed these Databases questions