Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In this program, you will check whether two dominoes match. Three dominoes. The first domino has a 1 on the left and a 5 on
In this program, you will check whether two dominoes match.
Three dominoes. The first domino has a on the left and a on the right. The third domino has a on the left and on the right. The second domino has a touching the on the first domino and a touching the on the third domino.
Because you can flip a tile, two tiles match if the number on the left or right matches the left or right on the other tile. For example, the domino maches the domino without flipping either, and matches after flipping the first domino.
You should print all matches. First check a direct match, then try flipping tiles. But dont flip a tile whose left and right numbers are the same. If there is no match, print No match".
Don't restructure the code. Fill in a condition for each of the if Your code goes here statements.#include
using namespace std;
int main
cout "First domino: endl;
int left; cin left;
int right; cin right;
cout "Second domino: endl;
int left; cin left;
int right; cin right;
bool matched false;
Your code goes here
if Your code goes here
cout "Match without flipping" endl;
matched true;
if Your code goes here
cout "Match after flipping first domino" endl;
matched true;
if Your code goes here
cout "Match after flipping second domino" endl;
matched true;
if Your code goes here
cout "Match after flipping both dominos" endl;
matched true;
if Your code goes here
cout No match" endl;
return ;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started