Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ Please . The latest big startup is Itsy. They connect people who are either looking to hire other people or else to get hired.

C++ Pleaseimage text in transcribed

image text in transcribed

. The latest big startup is Itsy. They connect people who are either looking to hire other people or else to get hired. It's important for Itsy's business model to keep track of all the bits of business they get, so for every client (known as a Bit) they track who the Bit is currently working for, i.e his boss, and which Bits he has hired, his team. Everyone who hires and everyone who is hired is a Bit, so they all form a bit of a community. What do you need to do? - Define a class Bit to represent a member of the community. - This is the only class you are defining. - Bits do have names, by the way, but of course names are not unique. - Track who each Bit is currently employing. A Bit may have many Bits working for them. - Track who each Bit is currently working for. There can be only one (at a time)! - Allow a Bit to hire another Bit with a hire method. - Allow a Bit to quit with a quit method. - Enforce a few rules: When hiring, you cannot hire someone who: - already has a job - you work for - and of course you can't hire yourself. If an attempt to hire fails, don't fail silently! (You know what that means.) Bits who employ other Bits don't particularly care what order the Bits in their team are kept in, so when one quits, it should only be an O(1), i.e. constant time, operation. - Again, do not fail silently if it is not possible for the Bit to quit. How would that happen? If he doesn't have a job? Test Code: Output: Name: Larry; Boss: none; Bits: Moe. Name: Larry; Boss: none; Bits: Moe Curly Curly. Name: Moe; Boss: none; Bits: none. Name: Moe; Boss: none; Bits: Larry. Name: Moe; Boss: Curly; Bits: Larry. Name: Larry; Boss: Moe; Bits: Curly Curly. Name: Curly; Boss: Larry; Bits: Moe

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 Driven Web Sites

Authors: Joline Morrison, Mike Morrison

2nd Edition

? 061906448X, 978-0619064488

More Books

Students also viewed these Databases questions

Question

How do Excel Pivot Tables handle data from non OLAP databases?

Answered: 1 week ago