Find Jobs
Hire Freelancers

Cat Program

$30-60 USD

进行中
已发布超过 20 年前

$30-60 USD

货到付款
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++
项目 ID: 3098491

关于此项目

3提案
远程项目
活跃20 年前

想赚点钱吗?

在Freelancer上竞价的好处

设定您的预算和时间范围
为您的工作获得报酬
简要概述您的提案
免费注册和竞标工作
颁发给:
用户头像
See private message.
$25.50 USD 在3天之内
4.9 (208条评论)
5.8
5.8
3威客以平均价$31 USD来参与此工作竞价
用户头像
See private message.
$42.50 USD 在3天之内
5.0 (2条评论)
3.6
3.6
用户头像
See private message.
$25.50 USD 在3天之内
5.0 (6条评论)
2.9
2.9

关于客户

UNITED STATES的国旗
United States
5.0
2
会员自2月 12, 2004起

客户认证

谢谢!我们已通过电子邮件向您发送了索取免费积分的链接。
发送电子邮件时出现问题。请再试一次。
已注册用户 发布工作总数
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
加载预览
授予地理位置权限。
您的登录会话已过期而且您已经登出,请再次登录。