Question: C++ please! Enter firet sequence (Qwhen done): 1 1 2 2 3 3Q Enter second sequence (Q when done): 1 2 3 3 2 1

C++ please!

C++ please! Enter firet sequence (Qwhen done): 1 1 2 2 3

Enter firet sequence (Qwhen done): 1 1 2 2 3 3Q Enter second sequence (Q when done): 1 2 3 3 2 1 0 These are: Same Exercise 2: Same Elements (This is essentially Exercise P6.10 of the book) Write a program sameelements.cpp that takes in two sequences of positive integers and checks whether they have the same elements in some order, now taking duplicates into consideration. For example, the two sequences 1 4 9 16 9 7 4 9 11 and 11 1 4 9 16 9 7 49 would be considered identical. But Enter first sequence (Q when done) 1 1 1 1 0 Enter second sequence (Q when done): 111Q These are: Different 1 4 9 16 9 7 4 9 11 Note: Assume the user inputs at least 1 positive integer per sequence before Q. Note on formatting: We'll stress again - please have the formatting like the above examples. Make sure to have colons. No invalid inputs: You do NOT have to worry about the user giving invalid inputs like characters (except for Q), really large numbers, etc. and 11 11 7 9 16 4 1 4 9 would not. You may consider typing up one or more functions to help organize things. Assume the user inputs at least one positive integer for each sequence. Hints: You may not use stdafx.h . You may want to do cin.clear(); string discard cin >> discard; before reading input for the second sequence of numbers. Can you explain why? See Special Topic 4.1 in Section 4.5 (or slide 22 of the Chapter 4 lecture slides). If the two sequences of numbers do NOT have the same length, then they are automatically different Please have the output formatted exactly like the following examples: Enter first sequence (Qwhen done): 1 2 2 3 3 3 Q Enter second sequence (Q when done): 1 2 3 Q These are: Different

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!