Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please write in c++.DO NOT WRITE MAIN.CPP,only need to write proj0.cpp Consider combinatorial puzzles,for example, one such puzzle is POT + PAN = BIB. In

please write in c++.DO NOT WRITE MAIN.CPP,only need to write proj0.cpp

Consider combinatorial puzzles,for example, one such puzzle is POT + PAN = BIB. In these puzzles, you must assign each letter a distinct digit, such that if we substitute the digits in place of the letters, the resulting mathematical equation is true. In our continuing example, if we set P=2, O=3, T=1, A=7, N=4, B=5, and I=0, we get 231 + 274 = 505..

in the file proj0.cpp, you will find an incomplete implementation for:

bool verifySolution(std::string s1, std::string s2, std::string s3, const std::map & mapping)

Your assignment is to finish implementing this. To find out what the proposed mapping has for s1[0] (the first character in std::string s1), you can use the member function at of the map class: that is, mapping.at(s[0]). You are not required to check that the digits assigned are distinct, merely that it satisfies the equation.

DO NOT WRITE MAIN.CPP,only need to write proj0.cpp. no need to use recursion

proj0.cpp code:

#include

#include

#include "proj0.hpp"

bool verifySolution(std::string s1, std::string s2, std::string s3, const std::map & mapping)

{

return false; // FYI, this stub is not a correct solution.

}

Main.cpp:

image text in transcribed

#include "projo.hpp" int main() return 0

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2022 Grenoble France September 19 23 2022 Proceedings Part 4 Lnai 13716

Authors: Massih-Reza Amini ,Stephane Canu ,Asja Fischer ,Tias Guns ,Petra Kralj Novak ,Grigorios Tsoumakas

1st Edition

3031264118, 978-3031264115

More Books

Students also viewed these Databases questions

Question

how does economics influence Australia's food choice?

Answered: 1 week ago

Question

b. What groups were most represented? Why do you think this is so?

Answered: 1 week ago

Question

3. Describe phases of minority identity development.

Answered: 1 week ago

Question

5. Identify and describe nine social and cultural identities.

Answered: 1 week ago