Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

IN C++ Write a function called printTuneRankings that accepts three input tunes and one target tune, and prints the input tunes in order from most

IN C++

Write a function called printTuneRankings that accepts three input tunes and one target tune, and prints the input tunes in order from most to least similar to the target. It is not necessary for the three input tunes to be the same length.

Function Specifications:

Name: printTuneRankings()

Parameters (Your function should accept these parameters IN THIS ORDER):

tune1 (string) - The first input tune to be checked against the target

tune2 (string) - The second input tune to be checked against the target

tune3 (string) - The third input tune to be checked against the target

targetTune (string) - The target tune

Return Value: No Return Value.

Output:

Your function should print the list of tunes based on their similarity score against the target tune.

The output format should match the example below exactly, with each tune preceded by its ranking and a closing parenthesis.

If any of the tunes are tied in similarity, your function should rank them in the order in which they were passed to the function.

Remember that the three input tunes need not be of the same length.

This function should make use of the bestSimilarity function created in question 5.

You may assume that any parameters passed to your function will always be in valid SPN.

We have provided a tuneSimilarity and bestSimilarity function for you to call. Do not paste your tuneSimilarity or bestSimilarity functions below.

Paste only your printTuneRankings function in the answer box! Do not paste main or #includes, just the function.

For example:

Test Input Result
//all different best similarity scores
F7D8G1D3 A6B7D9G1E0 D6B1D9G4 D6B4D9
1) Tune 3 2) Tune 2 3) Tune 1 
//tune 1 and 2 tied
C4D6G1A8 C4D6G1 G9B7A0 C4D8A1
1) Tune 1 2) Tune 2 3) Tune 3 
//tune 1 and 3 tied
C0B9D1G5E8D3 C0B0G1G3F8D3 C0B9D0B5E2G7 C0B9 
1) Tune 1 2) Tune 3 3) Tune 2 

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

PostgreSQL Up And Running A Practical Guide To The Advanced Open Source Database

Authors: Regina Obe, Leo Hsu

3rd Edition

1491963417, 978-1491963418

More Books

Students also viewed these Databases questions

Question

=+ how might this lead to faster growth in productivity?

Answered: 1 week ago