Primary Objectives:

  1. Install and use Visual Studio
  2. Learn C#
  3. Be able to write a moderately complex C# console program using "C-sharpese"
  4. Continue to hone your Git skills with branching

Overall Requirements:

  • Use Visual Studio IDE for Windows only
  • Your C# version should produce identical results to the given Java version when run from the command prompt
  • All C# code must be commented with XML comments at least as much as the Java code has been with Javadoc comments
  • Do NOT use Git commands from within Visual Studio. You may only use the command line for Git.
  • Has .gitignore appropriate for C# development; repository does not contain binaries or intermediate files, i.e. source code only

"As a student in CS 460 I want to write an example C# application so I can prove that I know the C# language and can work in the professional Visual Studio environment."

Questions/Tasks:

  1. [Setup] Get your development environment set-up: download and install Visual Studio IDE. (Community 2017 free version is fine); DO NOT USE THE MAC VERSION. It is not the same product and will not do what we need this year.
  2. [Setup] Download the Java application provided here: javacode2.zip. Review the code; and compile and run to learn what it does. This version is different from last year.
  3. [Planning & Design] Your job is to replicate (i.e. translate) this Java program but in C#. You should write a C# console application from scratch that does exactly what the Java version does. Do not copy and paste the code. Type it in and translate as you go. Let me repeat. DO NOT COPY, PASTE and then TRY TO FIX THE ERRORS!
  4. [Content/Coding] Start a new C# console application whose code is inside a HW3 folder in your Git repository. Add and commit your project files and code just like normal, but do use Visual Studio's .gitignore file so that the multitude of unnecessary files are not shouting to be added to Git. As with the last homework, all work for this homework should be done in a new feature branch with multiple commits over time.
  5. [Content/Coding] Write C# class files and code as necessary to duplicate the behavior of the required code. You should try to stick as close as possible to the Java code, so translate it -- don't do it your own way. This is because I have purposefully chosen certain language features that I want you to learn in C#.

    Don't try to copy in the Java code and edit it to fix errors. You want to write it from scratch so you begin to learn the Visual Studio IDE style of development (i.e. code completion, IntelliSense, looking up documentation, keyboard shortcuts ...). You should have multiple commits showing how you wrote this from scratch.

    I highly suggest that you implement the classes in this order:

    1. Node.javaNode.cs
    2. QueueInterface.java?.cs
    3. QueueUnderflowException.javaQueueUnderflowException.cs
    4. LinkedQueue.javaLinkedQueue.cs
    5. Main.java?.cs
  6. [Content/Coding] Where the syntax is identical between C# and Java you of course do not need to change anything. However, C# makes use of new language features to solve common tasks and you should learn and use those (looking at you properties). Little things are important, for example C# has a String class but convention says you use the string type name -- so please do that. Please follow all C# conventions for naming things (names that start with upper case for example). The code does not have to be 100% exactly the same as long as the behavior is the same. Yes, you'll need to find the equivalent of System.out.println, LinkedList, StringBuilder, generics, ... Don't worry about making accessibility modifiers the same.

    You must implement and use the linked queue as was done in the java code, but you should use C#'s linked list or equivalent.

  7. [Test] Test your code from the command line. Make sure it generates output identical to the java code.
  8. [Portfolio Content] When finished with your nicely commented, professional looking code, add a new page for it to your Portfolio (with screenshots to demonstrate it in action), and make sure it is pushed to your remote repository.

Important

To reiterate the purpose of this homework, we want to learn as much C# and Visual Studio as possible this week. Don't get lulled into thinking it's just the same as Java and so you don't need to learn anything. It is its own language and Visual Studio is a large and complicated IDE. It is a larger and richer language than Java and we want to use those features. It has some quirks. It has namespaces, extension methods, lambda functions and in and out variables. Surprisingly, I didn't think I'd like it at first but I do. Between Java and C# I'd much rather write in C#.