Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

This assignment moves us past simple single-file programs into more interesting

ID: 3878671 • Letter: T

Question

This assignment moves us past simple single-file programs into more interesting multi-file program:s We also write a game that, if not a viable League of LegendsTM competitor, is at least reasonably enjoyable at the Extreme Bonus level. Along the way, we'll utilize a Makefile, either the ddd or gdb debugger, and Umbrello to design our class and use case diagrams Full Credit Requirements Boom is a classic word or phrase guessing game with limited tries and something catastrophic if the word is missed - a firecracker goes (you guessed it) "Boom!". A game in progress looks something like the screen shot to the right. Below is a simple UML class diagram of the Full Credit version of the game. Note that Main isn't actually a class it's simply the usual main function. This time around, implement a h and cpp for each class ain + main): int izzl use - solution : string - quesses 2551: bool + Puzzle(solution : string) + guess(c: char): boo + solve(proposed solution: string): string + to_string): string + get solution(): strin - time: int + Fuse(time: int + burn(): bool + to string): strin The Puzzle class represents the game. The solution field is the string that is the word or phrase the player is trying to guess. The guesses array (like a vector, but without methods) holds a Boolean for each ASCII character. For example, guesses[a is true if 'a' has been guessed, false if not. The Puzzle constructor accepts the solution, which should be stored in _solution. The guess method accepts a single character (the player's guess), and returns true if the character is valid (between 'a' and

Explanation / Answer


#include <string>
#include <iostream>

using namespace std;

class Puzzle{
  
private:
    string solution;
  
    bool guesses[255];
  
public:
    Puzzle(string solution){}
  
    bool guess(char c){
        return 0;
    }
  
    string solve(string proposed_solution){
        string l = "e";
      
        return l;
    }
  
    string to_string(){
        string fire_cracker = "";
      
        return fire_cracker;
    }
  
    string get_solution(){
        string l = "e";
      
        return l;
    }
};

class Fuse{
private:
    int time;
  
public:
    Fuse(int time){}
  
    bool burn(){
        return 0;
    }
  
    string to_string(){
        string l = "e";
      
        return l;
    }
};

int main() {
  
    cout << "   =================" << endl;
    cout << "       B O O M !" << endl;
    cout << "   =================" << endl << endl;
    cout << "Enter lowercase letters to guess," << endl;
    cout << "! to propose solution," << endl;
    cout << "0 to exit." << endl;
  
    return 0;
}