Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The following three exercise questions constitute your Programming Project 1. The sum of the three questions totals 150 points for Project 1. A software entrepreneur

The following three exercise questions constitute your Programming Project 1. The sum of the three questions totals 150 points for Project 1.

A software entrepreneur is designing an educational word game for children. A child playing the game is given two words and must determine if it is possible to rearrange the letters in the first word to form the second. What the program does next depends on the relation between the two words and on the correctness of the player's answer.

When given two words, the child may claim that transformation of the first word into the second is possible. In this case, the program asks the child to demonstrate the correctness of the answer by typing a sequence of words starting with the first and ending with the second. Such a sequence is an acceptable proof sequence if each word is obtained from its predecessor by swapping a single pair of adjacent letters. For example, the sequence

tops, tosp, tsop, stop, sotp, sopt, spot

proves that the word tops can be transformed into spot. If the proof sequence is accepted, the child earns a point and play proceeds to the next round with a fresh pair of words.

A proof sequence is rejected if a word cannot be obtained from its predecessor by swapping an adjacent pair of letters, or if the first word in the sequence is not the first word of the pair of words being tested, or if the last word is not the second word in the given pair. When a sequence is rejected, play proceeds to the next round, but the child earns no points.

The child may observe that transformation is not possible. If the child's answer is correct, he or she receives a point and play proceeds to the next round. If the child's answer is incorrect and the transformation is indeed possible, the child receives no points. In this case, however, the program displays a correct proof sequence before moving on to the next round of the game.

A program at the heart of this game must perform several tasks.

The program must be able to determine if one of a given pair of words can be transformed into another.

The program must be able to determine if one word results from another by swapping an adjacent pair of letters.

The program must be able to produce a proof sequence when transformation of one word into another is possible.

Design and create a VCL program (GUI Interface) with C++ Builder. ZIP your entire project into a .zip (Windows Compressed folder) file and submit it for this question. You need to test opening your .zip file on another computer before submitting it to make sure your peers will be able to open, extract, compile and test your program.

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_2

Step: 3

blur-text-image_3

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

Distributed Relational Database Architecture Connectivity Guide

Authors: Teresa Hopper

4th Edition

0133983064, 978-0133983067

More Books

Students also viewed these Databases questions

Question

2. Why?

Answered: 1 week ago

Question

1. Where do these biases come from?

Answered: 1 week ago