C#
C# is a sort-of extension of C and C++ that was designed by Microsoft as part of its .NET framework. It is designed to be "multi-paradigm", meaning you can do functional, or object-oriented, or procedural, or whatever other kind of programming style you want in the language. (But for this project, we'll be mostly sticking with object-oriented.)
Useful Links
- Here are some C# tutorials to get started, where you can program right in your browser to try things out.
- There is a very good wikibook on C# programming that may be useful to you.
- Wikipedia page
- 99 bottles of beer program
Tools
We will use Microsoft's .NET sdk, which runs on Linux, Mac or Windows. For this class, your programs need to run on Linux.
Specifically, we will use the .NET Core SDK version 3.1.
The dotnet
program is alreadly installed on the lab machines.
To install on your linux VM or in WSL, follow Microsoft's instructions here.
How to start programming
If you are working in the Linux console, run these commands to
create a new folder called "proj1" containing a project file
proj1.csproj
and the actual source code in
Program.cs
:
dotnet new console --output proj1
cd proj1
dotnet new gitignore
You can also do something similar if you are using Visual Studio / VSCode by creating a new C# console project.
Either way, you should have a project file called something like
proj1.csproj
and all of your source code will go into
Program.cs
.
All of your C# code should be in that single .cs file Program.cs. It's okay to have multiple classes, but they should all go into that single source code file that you will submit.
How I will run your code
You will submit your proj1.csproj
and Program.cs
files.
Then I will simply run (in the directory containing these files):
dotnet run
to compile and run your code.
Even if you write your program using an IDE such as VSCode, remember that I will run your code as described above, so make sure you test that it works that way from the command line!
Phase 1 Requirements
For this language, you need to implement modifications B, C, D, F, G, H, and I. See the Phase 1 page for details on what this means.
Phase 2
See the Phase 2 Page for the list of suggested
problems. Of the ones listed, I recommend the following as being most
well-suited for C#:
- Make (It should involve some graphical indicator of what files are being remade as it happens.)
- Image Creator
- Hangman (You would have to make it nice and fancy.)
- TODO list
- Vending Machine
- Game with hidden agenda
- Sports Ticker
- Rock, Paper, Scissors
- Music Maker
- ??? (you choose!)