Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

DO it in C++. Do as question asked. 4, Dancing Partner Matching(Queue)[Solution introduction: the second video in 3.6] [Problem description] In a ball, when gentlemen

DO it in C++. Do as question asked.

image text in transcribed

image text in transcribed

4, Dancing Partner Matching(Queue)[Solution introduction: the second video in 3.6] [Problem description] In a ball, when gentlemen and ladies come, they form a queue of gentlemen and a queue of ladies, respectively. When the ball starts, the gentlemen and ladies who come first should get partners first. A gentleman should be matched with a lady. Similarly, a lady can only match with a gentleman. Write programs to simulate the process of dancing partner matching. The maximal number of coming gentlemen or ladies is 30. [Basic requirements] 1) Use queues to solve this problem. [Example) Problem: Match coming gentlemen and ladies. What you need to show in the terminal(the back part is outputted by you and the blue part is inputted by the user, i.e., teacher): Please input coming dancers: Mark, male, 19 Alice, female, 21 Jenny, female, 23 Bob, male, 20 Andrew , male, 19 Julian, female, 18 Ivan, male, 22 Jeff, male, 21 Dancer partners are: Mark, Alice Bob, Jenny Andrew, Julian The following dancers do not have partners: Ivan, male, 22 Jeff, male, 21

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

MySQL/PHP Database Applications

Authors: Brad Bulger, Jay Greenspan, David Wall

2nd Edition

ISBN: 0764549634, 9780764549632

More Books

Students also viewed these Databases questions