Find Jobs
Hire Freelancers

Cat Program

$30-60 USD

In Progress
Posted about 20 years ago

$30-60 USD

Paid on delivery
The following will need to be completed in C++ I will need it completed no later than 2/15/04. + Write a program that places a cat into a pen, which can hold up to seven cats, each time a key (e.g. Enter key) is pressed. + Each cat is an object instantiated from class Cat??"defined in file cats.h + Each cat object, when dynamically instantiated, randomly choose a fur color (black, gray, or brown), and eye color (green, blue, or brown) and a hair length (short or long). + Provide “get?? and “set?? methods for these attributes, + Carefully consider which “get?? and “set?? methods should be public and which should be private??"all member functions are defined in [login to view URL] Certain combinations of cats result in fights breaking out: + if the number of gray cats exceeds the number of brown cats, the gray cats fight with the brown cats. + A fight also breaks out if at least one black cat with green eyes and at least one black cat with blue eyes are in the pen with exactly one black cat with brown eyes. Write a nonmember function named "check" that determines if a fight has broken out. Hints: + Read the problem description carefully. + Recall that if the number of gray cats exceeds the number of brow cats, the gray cats fight with brown cats. + The cats do not fight if the number of brown cats exceeds the number of gray cats. + Also notes that black cats fight if exactly one black cat with brown eyes is put in the pen with at least one black cat with green eyes and at least one black cat with blue eyes. + If the pen contains more than one black cat with brown eyes, the black cats will not fight. Use: //Cats.h #ifndef CATS_H #define CATS_H class Cat { public: Cat(); const char *getFurColor() const; const char *getHairLength() const; const char *getEyeColor() const; private: void setFurColor(); void setHairLength(); void setEyeColor(); char *furColor; char *hairLength; char*eyeColor; }; #endif //Cats Module [login to view URL] #include “cats.h?? #include #include #include Cat::Cat() { srand( time ( ) )); setFurColor(); setEyeColor(); setHairLength(); } const char *Cat::getFurColor() const { } const char *Cat::getHairLength() const { } const char *Cat::getEyeColor() const { } void Cat::setFurColor() { } void Cat::setEyeColor() { } void Cat::setHairLength() { } ## Deliverables 1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. 2) Installation package that will install the software (in ready-to-run condition) on the platform(s) specified in this bid request. 3) Exclusive and complete copyrights to all work purchased. (No GPL, GNU, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site per the coder's Seller Legal Agreement). ## Platform Windows XP, in all 4.0+ versions of internet explorer and Netscape, C++
Project ID: 3098491

About the project

3 proposals
Remote project
Active 20 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
See private message.
$25.50 USD in 3 days
4.9 (208 reviews)
5.8
5.8
3 freelancers are bidding on average $31 USD for this job
User Avatar
See private message.
$42.50 USD in 3 days
5.0 (2 reviews)
3.6
3.6
User Avatar
See private message.
$25.50 USD in 3 days
5.0 (6 reviews)
2.9
2.9

About the client

Flag of UNITED STATES
United States
5.0
2
Member since Feb 12, 2004

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.