Find Jobs
Hire Freelancers

C++ Homework help

$2-8 USD / hour

Cancelled
Posted about 7 years ago

$2-8 USD / hour

Design an object-oriented fishing game using the following two classes as specified in Unified Modeling Language (UML).  + indicates public, - indicates private, and the data type of a return value or a parameter is indicated by a : following its name. Fish - name : string /> - value : int + Fish(): + Fish(name:string, value:int): + setName(name:string):void + setValue(value:int):void + getName() : string + getValue() : int Player - inventory : Fish* - numFish : int + Player(): + ~Player(): + goFish() : void + addFish(fish : Fish) : void + getTotalScore() : void + printInventory() : void + sortInventory() : void Each Fish object will have a name and a point value associated with it.   It will have a getName() and getValue() function to access its private variables. It will have a setName() and setValue() function to mutate its private variables. It will have a default constructor for when the array is first created. It will have a constructor that takes a name and value for when a new Fish is created and added to the array. The Player object will hold: inventory, a pointer to a dynamically allocated array of Fish objects.    numFish will hold the number of fish in the array, initially 0.  The default constructor will create each of these initial values. The destructor will delete the Fish array using delete [] goFish() : void Create a 1 in 4 chance that a fish will be caught If a fish is caught, create 1 of 5 randomly selected fish objects: Make a common fish, 60/100 times will be caught Another fish is 20 / 100 Next, 14 / 100 Next 5 / 100 Finally, 1 / 100, an ultra rare fish Give each of the 5 fish types their own name, and a value that corresponds to its rarity Once the fish is caught and its type decided, call addFish() with the newly constructed fish object as its argument If the user caught a fish, notify them of its name and value, otherwise say they didn't catch anything. addFish(fish : Fish) : void increment numFish by 1 allocate a new temporary array with size equal to numFish Copy all of the fish from inventory to the temp array Assign the new fish to the end of the temp array delete[] the inventory pointer to free up the old array Assign the inventory pointer to equal the address of the temp array getTotalScore() : void Output total sum of the value of the fishies printInventory() : void Output the names and point values of each fish.  Use iomanip to make it into a nice two column table. sortInventory() : void Sort the fish inventory by name.  Hint : look at the name for comparison, but swap the entire object when swapping. Create an outer game loop that repeatedly asks the user if they would like to go fishing (y or n), then call goFish(), then sortInventory(), then printInventory(), then getTotalScore(). You can write the class definitions and main all in one file if you choose to.  If you place your class declarations in header files and class definitions in separate cpp files, make sure you submit the entire project folder as a zip.
Project ID: 13907521

About the project

9 proposals
Remote project
Active 7 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
9 freelancers are bidding on average $5 USD/hour for this job
User Avatar
Hi, I hope you will be doing well. I believe on perfect work with 100% satisfaction of my client then payment. I deliver only exceptionally robust and well-designed work as a rule to my client. I understand your project and I am confident that I can do your project with great accuracy and 100% efficiency. I have seven years programming/teaching experience in Java/ C++/ C/Matlab/Software Architecture/ C#/Algorithm Design and Analysis. I am software developer and providing software solutions to my client from last seven years. I will provide you quality work with 100% accuracy. I want to do best to best work for my client, gain 100% satisfaction and quality work. You can trust me and consider me for your project. I am also faculty member (Instructor) at Computer Science and Engineering Department in FAST-NUCES National University Pakistan since February 2013. Thanks! Best Regards, Engr. Shahi
$6 USD in 10 days
4.7 (42 reviews)
4.9
4.9
User Avatar
Hi David here, I hope you will consider me for your project. I will assure you a quality end product at a competitive price. I know you will be swamped with bids so thank you for the time. Hoping to hear from you soon and if you have any queries please do not hesitate to message me and i can talk. thanks
$5 USD in 40 days
0.0 (0 reviews)
0.0
0.0
User Avatar
A proposal has not yet been provided
$4 USD in 5 days
0.0 (0 reviews)
0.0
0.0

About the client

Flag of UNITED STATES
United States
0.0
0
Member since May 2, 2017

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.