• 0

c++ program idea


Question

I am in an intro to c++ class and I need to come up with a program idea for my final project. It needs to be at least 300 lines, use at least one if else statement, 2 sequence or selection loops, one class, input validation, and file i/o. I am at a loss for good ideas.

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

A console application : Hangman. Get your dictionary from a text file. Save user high score in a file, display it on program start.

Use a class for the core hangman elements so that all the main method has to do is instantiate a hangman object and let it do the work.

You can use this for inspiration http://www.hangman.no/

Link to comment
Share on other sites

  • 0

You do not necessarily have to draw the hanged man though it might help in getting to fill the 300 lines (by having a method that draws each state with ASCII art, it is highly "inefficient" code-wise but it will help with the bull**** requirement that the program be 300 lines long).

Link to comment
Share on other sites

  • 0

The drawing can be replaced by a simple "chances left : X".

With enough input validation, I think the code can meet the 300 lines requirement fairly quickly. Also, if you need extra lines, you could format your dictionary in some creative way that will take some parsing to decode. Useless, but justifies the extra lines. :p

Link to comment
Share on other sites

  • 0

Yeah hangman is a pretty good as Dr_Asik says. There's a few other games you could choose between such as Connect4, Tic Tac Toe etc

Each has its own set of small problems but they'll all require some form of input validation :)

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.