How to create Hangman program?

I am currently creating a Hangman program using Object oriented programming in C++. I tested my words class and it runs perfectly with a sample main that I was using. The classes that I need help with are Hangman and HangmanConsole. I am not sure what to do to get the characters, guesses, and other variables stored and in sync with the rest of the program. I am looking for help or guidance on how to code those classes so, I can get my program running. Here is my code down below:

   #include <iostream>
   #include <fstream>
   #include <ctime>
   #include <string>

      class Words
      {
      private:
        int minlen{0};
       int maxlen{0};
       std::string file_name;

        std::string* choices = nullptr;
        int count{0};

    public:

        Words (int min, int max, std::string fName)
        {
            minlen = min;
            maxlen = max;
            file_name = fName;

            this->load_words();
            srand( time(NULL) );
        }

        ~Words()
        {
            delete [] choices;
        }

        int getCount()
        {
            return count;
        }

        void display_list()
        {
            for(int i = 0; i < count; i++)
            {
                std::cout << choices[i] << '\n';
            }
        }

        void load_words()
        {
            std::ifstream fwords(file_name);

            if(!fwords)
            {
                std::cout << "Cannot open file\n";
                return;
            }
           // This counts the words (1st file read)
            std::string temp;
            count = 0;
            while(fwords >> temp)
            {
                // Filter words
                if(temp.length() == minlen or temp.length()== maxlen)
                    count++;
            }



            // Setting up the array
            choices = new std::string[count];
            fwords.close();

            // Loading the array (2nd File read)
            fwords.open(file_name);
            int index{0};
            while(fwords >> temp)
            {
                if(temp.length() == minlen or temp.length() == maxlen)
                {
                    choices[index] = temp;
                    index++;
                }
            }
            fwords.close();
        }

        std::string pick_word()
        {
            if (count == 0)
            {
                return "Zero words available to select from";
            }

            return choices[rand() % count];
        }
    };

  class Hangman
  {
   private:
      char word[40];
   //   char progress[40]; // Progress will be the same length as char_word "----"
      int word_length;
   //   void clear_progress(int length); // This will set progress to contain

     protected:
      int matches;      // Characters that match
      char last_guess;  // Final guess
      string chars_guessed; //The characters guessed
      int wrong guesses;     // Number of wrong guesses
      int user_guess;    // Character that the user will use to guess
      int remaining;     // Number of guesses remaining
      const int total_guesses = 6; // Total number of tries
      bool check(char user_guess); // Function designed to accept a single character.
 class Hangman
  {
   private:
      char word[40];
   //   char progress[40]; // Progress will be the same length as char_word "----"
      int word_length;
   //   void clear_progress(int length); // This will set progress to contain

    protected:
      int matches;      // Characters that match
      char last_guess;  // Final guess
      string chars_guessed; //The characters guessed
      int wrong guesses;     // Number of wrong guesses
      int user_guess;    // Character that the user will use to guess
      int remaining;     // Number of guesses remaining
      const int total_guesses = 6; // Total number of tries
      bool check(char user_guess); // Function designed to accept a single character.

  public:
      Hangman(char w, char p, int wlen)
      {
         word = w; // This will be used to store the generated word
         progress = p;
         word_length = wlen;

      }

      Hangman(int m, char lg, string chg, int wg, int ug, int r)
      {
         matches = m;
         last_guess = lg;
         chars_guessed = chg;
         wrong_guesses = wg;
         user_guess = ug;
         remaining = r;
      }

      char * get_word()
      {
         return word;
      }
};
 class HangmanConsole : public Hangman
 {


 };

    int main()
 {
     std::string source_file;
     source_file = "enable1.txt"; // This text file contains the complete word list for Hangman

   //  string unknown(word.length(), '-'); Maybe use this to initialize with '-' character.


     rand(time(NULL)); // needs <ctime> included
     Words words(7,10); // words between 7 and 10 chars long

     HangmanConsole game(words.pick_word());

     cout << "HANGMAN" << endl << "-------" << endl << endl;
     cout << "Your word is: " << game.get_progress() << endl;

     while (!game.is_word_complete() && game.get_remaining() > 0)
     {
        cout << endl;
        cout << "Enter your guess: ";
        cin >> game;    // calls overloaded >> operator

        system("clear"); // NON-PORTABLE, ONLY WORKS ON LINUX
        game.show_info();
 }

The Future of Automated Data Lineage in 2021

Automated Data Lineage in 2021

As 2021 is now upon us (finally!), businesses are gearing up their strategy based on learnings from the past year. While insights help inform future plans, such as where to place budget and effort, there is one essential tool that each company should have at its disposal. If you’ve read the title, this shouldn’t come to you as such a surprise. We’re speaking about automated data lineage. With the ability to fully understand how data flows from one place to another, data lineage allows business processes to become more efficient and focused.

Data Lineage is Like Oil

In the webinar titled, 'The Essential Guide to Data Lineage in 2021,' Malcolm Chisholm, an expert in the fields of data management and data governance, shares his predictions for the coming year. To kick off the talk, he compares data lineage pathways to an oil refinery (one of our favorite analogies). Without our understanding of what is flowing through the pipes, we can’t determine how hot the oil is, it’s pressure levels, or even where it is going. Data lineage is thought to be the same. If companies don’t have a handle on exactly the data that is flowing between systems, they won’t be able to explain numbers that end up in a report. Malcolm Chisholm states that "data lineage is not just an arrow between two boxes, it’s a good deal more complicated than that." The process requires knowledge of the data that the company has acquired an understanding of how it was stored or any obstacles that it encountered along the way. Additionally, ETL tools are more than just data movement, there is actually logic happening inside of them. With this component, you can understand data lineage overall.

10 Microservices Interview Questions You Must Know

Do you want to get a job as a microservices developer? Are you looking for some practical microservices interview questions? If so, this article is for you, wherein you will get to know about the most important microservices interview questions around the day-to-day job responsibilities of a microservices developer. You will also get an insight about how to answer them and an interviewer's perspective to the answers (something unique which you may have never seen before). Isn't that cool?

Ready? Let's get started.

Mobile App Architecture Design and Development

You might have contemplated the ramifications of mobility around us. From an airplane ticket booking to shopping from the solace of your lounge chair, you can use mobile apps. Ordering your favorite food or learning desired courses online, mobile apps are used. With mobile applications, you can pay your bills in a few snaps of your finger. So, every part of your life is moved by the abilities of phone apps.

Many organizations today have enhanced their business effectiveness with mobile architecture design. There are so many mobile architecture applications in the market today. So, there is pressure on companies that work on mobile app development. They are under pressure to create applications that stick out. It prompts furious rivalry between them. Mobile architecture is one of the essentials of application design.

High-Performance Batch Processing Using Apache Spark and Spring Batch

Batch processing is dealing with a large amount of data; it actually is a method of running high-volume, repetitive data jobs and each job does a specific task without user interaction. This kind of processing started from the beginning of computation and still continues and perhaps new methods, algorithms, and tools are still being introduced. The entry point of Batch Processing Systems is offline data that gathered in any type like CSV, RDBMS, or well-formed JSON or XML files, after processing data and doing the specified process on every record of data, the desired output is generated.

Note: Batch processing and stream processing are two different concepts.

Data Processing Using Functions in Prosto: An Alternative to Map-Reduce and SQL

Why Prosto? Having Only Set Operations Is Not Enough

Typical data processing tasks have to access and analyze data stored in multiple tables. They could be called relations, collections, or sets in different systems but we will refer to them as tables for simplicity. The general task of data processing is to derive new data from these multiple tables and each solid data (processing) model must answer the following three important questions: how to compute new columns within one table, how to link tables and how to aggregate data. Below we shortly describe how these tasks are solved in a traditional set-oriented model and where these solutions have significant flaws.

Calculation. Given a table, we frequently need to add a new column with values computed from other columns in this same table. Conceptually, the task is similar to defining a cell in a spreadsheet, for example, C1=A1+B1. Easy and natural? Yes. However, it is not so easy in traditional data processing frameworks. The main problem is that we need to define a new table because adding a column to an existing table is not possible. Prosto toolkit is intended to fix this flaw by providing a dedicated operation where a new column can be added as in this example: ColumnC=ColumnA+ColumnB

8 Top eBooks APIs

Digital Transformation is impacting all parts of entertainment. Streaming TV is now almost as popular as cable TV, digital music outsells analog CDs or vinyl records, online news subscriptions are slowly replacing print newspapers, and eBooks are just as popular as paper books. Although nothing feels as great as a paper book in one's hands, eBooks have some great advantages.

Kubernetes Multi-Tenancy Best Practices With Amazon EKS

Applications running on the cloud are diving deeper towards the most critical changes in how they are developed and deployed. Perhaps, the most useful and trendy tool which has come in this space is Kubernetes. There are certain best practices that you should consider for your Kubernetes multi-tenancy SaaS application with Amazon EKS.

Kubernetes has been deployed on AWS practically since its inception. On AWS, it is popularly known as EKS. The Amazon-managed Kubernetes service provides a flexible platform for managing your containers without forcing you to control the management infrastructure. 

Quality Sense Podcast: Simon Prior – #MakeATester

In this Quality Sense episode, our host Federico has the pleasure of interviewing Simon Prior, who has worked across the cyber security, Retail, gaming and airline industries. Simon is a passionate software quality leader, advocate of the importance of teaching testing at universities and co-host of the Testing Peers podcast.

Episode Highlights

  • How Simon got started in his testing career and why
  • Why universities don’t teach the top skills needed in software testing (hint, the most critical ones aren’t technical!)
  • How to help form more potential testing candidates and widen the talent pool 
  • What to look for when hiring a tester with no experience?


MySQL to Redshift: 4 Ways to Replicate Your Data

MySQL is the most popular open source cloud database in the world, and for good reason. It’s powerful, flexible, and extremely reliable. Tens of thousands of companies use MySQL to power their web-based applications and services every day.

But when it comes to data analytics, it’s a different story. MySQL is quickly bogged down by even the smallest analytical queries, putting your entire application at risk of crashing. As one FlyData customer said to us, “I have nightmares about our MySQL production database going down.”

C#9.0 Is Here: Dealing With Record Keyword Errors

Make sure you are ready for it! Today when I started to try out some of the features of C#9.0 I was immediately blocked by an error in Visual Studio 2019 (which I have been working with for a while now).

The new record keyword gave me an error :

A Guide to Open-Source IaC Testing

Introduction

Over the past several years, Infrastructure-as-Code (IaC) platforms, such as Terraform, CloudFormation, and Kubernetes, have rapidly gained traction as the preferred mechanism to provision and manage cloud infrastructure. And for good reason.

It wasn’t that long ago that ClickOps was the dominant approach for cloud management. Everyone is sympathetic to the need for agility when there is a business-critical change required. “Just log onto the console” can seem like a perfectly justifiable action. It usually is…until it isn’t.

Localizing Dates in a Perl Web App With JavaScript

Last week's article received a comment on a private Facebook group that amounted to "just use JavaScript's built-in formatting." So what would that look like?

Perl
 




x
38


 
1
#!/usr/bin/env perl
2

           
3
use Mojolicious::Lite -signatures;
4
use DateTime;
5

           
6
get '/' =>
7
    sub ($c) { $c->render( template => 'index', date => DateTime->today ) };
8

           
9
helper localize_date => sub ( $c, $date = DateTime->today, $style = 'full' ) {
10
    my $date_params = join ',' => $date->year, $date->month_0, $date->day;
11
    return
12
        qq<new Date($date_params).toLocaleString( [], {dateStyle: "$style"})>;
13
};
14

           
15
app->start;
16
__DATA__
17

           
18
@@ index.html.ep
19
% layout 'default';
20
% title 'Today';
21

           
22
<ul>
23
    <li><script>
24
        document.write(<%== localize_date $date %>)
25
    </script></li>
26
    % for my $style ( qw(long medium short) ) {
27
    <li><script>
28
        document.write(<%== localize_date $date, $style %>)
29
    </script></li>
30
    % }
31
</ul>
32

           
33
@@ layouts/default.html.ep
34
<!DOCTYPE html>
35
<html>
36
    <head><title><%= title %></title></head>
37
    <body><%= content %></body>
38
</html>


It's structured much like the Perl-only solution, with a default "/" route and a localize_date Mojolicious helper to do the formatting. I opted to output a piece of JavaScript from the helper on lines 11 through 14 since it could be repeated several times in a document. You could instead declare a function in the default layout's HTML <head> on line 38 that would receive a date and a formatting style, outputting the resulting formatted date.

Implement a class for vehicleType with data members “int YearModel, int spe

Implement a class for vehicleType with data members "int YearModel, int speed and make (of type string or
charll)". With following member functions; - Constructor with parameter, receiving "YearModel and make" and
initialize other data members with ZERO. - int GetYearModel() const; - int GetSpeed( const; - string GetMake()

const; - void accelerate(); (increase car speed by adding 2) - void brake0; (decrease car speed by subtracting 2
up to ZERO ). Now create a new class named Truck inherited from the existing class vehicleType and add the
additional member variable for number_of wheels and a member function to print all details of Truck. Also add
appropriate constructors,

Moving From Shopify Plus to Microservices-Based Commerce

If you’re selling products online, there’s a good chance you’re using a one-size-fits-all platform. These platforms offer many advantages but they also have limitations. If you want to move beyond these limitations, microservices can help.

Shopify Plus is a one-size-fits-all platform that allows you to use headless systems while retaining most of its features. So if you already have a Shopify Plus setup, you can keep the frontend and migrate the backend to a microservices-based alternative for more flexibility.

What App Developers Should Know About GDPR Compliance

There is a price for everything, and the loss of privacy is the price for downloading and using apps on smartphones. As security technologist and cryptographer Bruce Schneier, aptly observes, walking around with a smartphone is like carrying a tracking device 24/7.

The smartphone revolution also brought on app development, with contemporary life revolving around mobile applications. This is especially true for Millennials and Gen Zers, whose desire for information at the press of a button remains unchanged over the years.