Bummer! This is just a preview. You need to be signed in with a Basic account to view the entire video.
Wrap Up2:30 with Jeremy McLain
After these final thoughts, go forth and code!
Practice what you've learned by doing these projects or come up with your own projects that challenge you. Put your code on GitHub and tell me about them on Twitter. I'd love to see what you come up with! - @Jeremy_McLain
Write a program that functions as an address book. It should have entries containing at least the following information: first and last name, phone number, address, and email address. At a minimum you’ll want an address book entry class. You should be able to add entries and search for entries (by last name at a minimum).
In order to save the address book for later you’ll need to write it to a file. Don’t worry about saving the address book to a file if you don’t already know how to do that. Other C# courses on Treehouse teach how to do that.
Create a program that prints out various properties of shapes. For 2D shapes these could include the number of sides, number of vertices, area, perimeter / circumference, the number of lines of symmetry, longest dimension, number of parallel sides, and sum of the angles. You can add 3D shapes that in addition to the 2D properties also have a volume.
Allow the user to enter the relevant dimensions of the shapes and then calculate the remaining properties.
Here’s a list of common geometric shapes: http://www.math-salamanders.com/list-of-geometric-shapes.html
Recreate a computer console based version of the popular Battleship game. At a minimum, you’ll want to have classes for player, ship, and board. You might want to make other classes as well.
Start by making a two player game where each player has only one ship that takes up a single grid square on the game board. Players should be able select where they want to place their ships.
The game board is typically a 10x10 grid, but you might want to make the game board smaller to start out. You should be able to change the game board size by changing the value of a single constant.
You may also want to provide a single player option where you play against the computer. Use System.Random to randomly place the computer’s ships and to guess the location of its opponent’s ships. Think about ways you can make the computer a more challenging opponent by making it “smarter”.
You can continue to make the game more complex and interesting by adding more types of ships or allowing the ships to move. Come up with more ways to make the game more interesting and challenging and then implement them in your game.
Be sure to practice good input validation by checking that players aren’t accidentally placing ships outside of the boundaries of the game board or on top of other ships. Also check that players don’t accidentally guess locations that they’ve already guessed.
Create a computer console based version of your favorite card game. You’ll probably want to have classes for a player’s hand, a card, the table, the deck, and a round or game.
Your program should actually "shuffle" cards in an array before each deal (sounds like another good use for System.Random). It is not necessary to print graphical-looking cards on the screen. The game should support multiple players and never deal the same card twice.
Add the ability to play against one or more computer opponents. Think about ways you can make the computer a more challenging opponent by making it “smarter”.
Have your program enforce the rules of the game. Example card games include: Hearts, Gin Rummy, or Go Fish. Pick one that you enjoy, but be sure to think about how some games might be harder to implement than others.
We've reached the end of the C# objects course and we've covered a ton.
We got to learn and
practice many of the features of C# while building the Treehouse Defense Game.
Now you have a working example of object-oriented programming
that you can refer back to often.
I've tried to teach not only how to use these features, but also when and
why to use them.
With that knowledge you can go and design software using what you've learned here.
I love designing and building software using object oriented design.
I consider it an art form that when done well, creates beautiful and
elegant solutions to often very complex problems.
It takes practice though.
In fact the best way to retain what you've learned here is to use it.
Practice what you've learned here as much as possible.
In the teacher's notes of this video I've included some project ideas
that you can build yourself.
To finish them you'll need to use much of what you've learned in this course.
You can use workspaces for these projects by going to teamtreehouse.com/workspaces
and create in a new workspace.
Or you can set up your own coding environment by
installing development tools on your own computer.
I've included links to Treehouse workshops and
other resources to help you do this in the teacher's notes.
A couple of these projects might require you to use documentation and
other resources that can be found on the web.
Those are there to give you practice finding this information.
Efficiently finding the right information required to solve a problem
is one of the most important programmer skills.
You might have your own ideas for a project that you'd like to get started on.
I encourage you to just get started on it with what you already know how to do.
It's all right if you end up rewriting it a few times
as you learn more ways to do things.
It's just text after all.
I'm sure I've thrown out more code than I've had make it into a final product.
Next, I encourage you to be active in the treehouse community.
If you have questions about how to do something while working on these projects
here, you can ask them in the treehouse community.
Also, you might understand something that another student doesn't.
You can help other students out by answering their questions.
There's no more effective way to solidify what you know
than to teach it to someone else.
You can also get ahold of me on Twitter.
You need to sign up for Treehouse in order to download course files.Sign up