Perform multiple exercises written in this tutorial that require
making minor, trivial modification to code example given inside C#
MSDoc's. The each exercises, is complemented by a 'git
commit'
Familiarize yourself with the larger corpus of documentation on MSVS
and C# on MSDoc's as reference material for the rest of this course,
etc.
Note, this section is largely a copy of the "Presentation Conventions"
section in all my other tutorials. If you have grown comfortable
with my tutorial's presentation conventions, skip to Section 1.2
Screen Shot Figures: Most screen captures in this document
can be zoomed to full size by clicking on the image. Click
anywhere outside the zoomed image to return the image to its original
size. For example, click on the image below:
Fonts:
your_user_id – this indicates
you should input a specific text string. The specifics will be
indicated in the instructions.
path_to_a_directory_where_you_can_save_your_work
– this indicates you should input a specific text string. It is
assumed the reader can interpret what to type based on the context
and their general computer science knowledge.
[…additional output will
appear…] – this a comment describing output from a
command-line command.
Shell Code Examples: Shell code instructions appear in black
boxes. For lengthy code examples there is an interactive scroll bar on
the right. Additionally, on the right there is a button, ▽
, clicking the button will expand the box to display it's entire
contests without scrolling. An example is below:
lucretius@CCIWD-435B-1 ~/ITCS_4120 $ ls -la total 20
drwxr-xr-x 1 lucretius 197609 0 Sep 23 21:57 ./
drwxr-xr-x 1 lucretius 197609 0 Sep
23 21:37 ../
-rw-r--r-- 1 lucretius 197609 0 Sep
23 21:55 'The Hitchhickers Guide to the Galaxy.azw'
-rw-r--r-- 1 lucretius 197609 0 Sep
23 21:36 'On the nature of things - Lucretius.pdf'
-rw-r--r-- 1 lucretius 197609 0 Sep
23 21:56 'Ethica - Spinzoa.pdf'
-rw-r--r-- 1 lucretius 197609 0 Sep
23 21:57 'Moses the Egyptian: The Memory of Egypt in
Western Monotheism.azw'
-rw-r--r-- 1 lucretius 197609 0 Sep
23 21:37 Notes.docx […misc additional output
will appear…]
Structure of MSDoc's and there use for within this Tutorial Assignment
Like nearly all literature (digital, printed or otherwise) on
programming language XYZ, the doc.microsoft.com (hereafter
abbreviated as MSDoc's) documentation on on C# is roughly
carved up into 3 types of volumes:
Tutorials and "Tours of C#"
A Programming Guide
A Reference Guide
Tutorials and "Tours of C#" give a very high-level, short
introductions to the language, and programming tools. Often
these tutorials are targeted at individuals with no prior programming
experience and hence for the audience this Tutorial Assignment, much, of
the material in the C# Tutorials is a re-hash of concepts the reader
already knows and probably provide little new knowledge for the reader.
A Programming Guide - The Programming Guide's to a language often
presents themselves as being targeted to an audience with no prior
programming experience, but in my 40 years of programming, this claim is
often just false "feel good" advertising. Programming Guide's do
take the reader step by step through the core language features using many
codes example with explanatory notes. But in reality most
programming guides I've encountered are fast paced in introducing new
material. typically the readers who get the most out of a
"programming guide" already have programming experience in some other
programming language.
A Reference Guide - A Reference guide is generally just an organize
list of all the programming languages keywords, operators, statements and
control structures, etc. given with minimal examples.
Typically, this is the book a programmer starts to consult after they have
mastered the Programming Guide (or perhaps while studying the programming
guide).
Internal Language Specification - This is the official document
(highly, highly technical) written by the creators and designers of the
programming language itself and the languages compiler/interpreter and is
used to describe how to build a compiler/interpreter for the
language. Typically it is compiler/interpreter writers who
consult this document. Very experienced programmers (say with
years of experience with the given programming language) will eventually
find themselves delving into these documents. (Especially if
the said programmer has a proper Computer Science Degree has taken two
courses that teach how programming languages are designed and how
compilers implemented).
This Tutorial Assignment () pulls subsets of readings from:
Tutorials and "Tours of C#"
A Programming Guide
A Reference Guide
Based on the audience (see section Prequisites).
To make this Tutorial Assignment gradable, it contains many, small,
typically trivial 'todo' exercises based on the readings.
Each exercise involves generating some bit of code, or answering a short
question and git committing the related files
to your Tutorial Assignment Git repository.
Git Commit Protocol and Rubric
In this document's instructions, you are
required to make git commits at specific points using specific commit
messages. The git commits are a required part of the
assignment. It also introduces you to good git practices.
For a given exercise that includes specific git
commit instructions, if there is not at least 1 git commit message
associated with that exercise, 1 point will be subtracted for "poor
software development practices" for that exercise.
Your commit message need not be a verbatim copy of the commit message
given in the exercise’s instructions, but it should be very
similar. (But you can simply cut & paste
the messages, so they really should be verbatim).
The grader will allow for a few of the required commit messages to be
missing without incurring a penalty.
Finally, extra commit's are perfectly fine and common practice, such
for fixing other types of coding mistakes, etc.
For exercises that require you modify code already
given to you, if only the original example code is committed with no
change & there is no evidence from the student (documentation,
notes, etc) of trying to solve the exercise, then minimal points will
be awarded for that exercise.
Access to Microsoft Visual Studio 2019
If you already have access to a computer with Microsoft Visual Visual
Studio 2019 (henceforth abbreviated MSVS) you may not need to perform
this section. However, your MSVS 2019 installation must have
installed the components described below. If you already
have MSVS 2019, use the Windows Apps
and Features control panel to determine what components of MSVS
2019 are installed. Read through Section 3.1 to observe what
components a you would install if you were installing MSVS 2019 for the
first time. You can then add these components to your MSVS
2019 installation by selecting the Modify option for MSVS 2019 listed
under Apps and Features (search for "Visual Studio").
Option I: Using a MS
Windows 10 Computer
If you own, or have access to, Windows 10 computer and have the
administrator privileges to install software on that computer then
UNCC students can download and install MSVS Enterprise edition for
free. This can be downloaded and install through UNCC's
program with Microsoft Azure Dev Tools. This is accessed
as follows:
The product you want to download and install is called "Visual Studio
Enterprise 2019".
Download and install MSVS through Azure
Dev Tools.
When asked to install various components
-- called "Workloads", make the following selection:
The installation process will have
several other steps. Follow them as instructed.
When prompted with setting the initial
"Developer Settings" select the ones show below:
Option II: Using non-MS
Windows Computer with Native version of Visual Studio
Circa 2020, Microsoft does have versions of Visual Studio for other
operating systems. But the degree to which these support Unity
has not yet been tested by the authors of this
tutorial. Spring 2020 semester students have had
success with https://visualstudio.microsoft.com/vs/mac/
If you are considering this option,
these versions of Visual Studio for non-Windows OS's typically have
a similar install procedure for picking the installed
components/workloads and you can mentally translate the procedures
in Section 3.1 for you operating system.
Option III: CCI
Open Labs
This section is placeholder for in-progress document
development. The labs only have Visual Studio 2015 as of
1/24/2020. See recent Announcements in Canvas regarding
possibility of using Visual Studio 2015 and status of TSO's making
MSVS 2019 available. I will update this section of this
tutorial as soon as I've have confirm the status.
[Out of Order]
Option IV: Using a non-MS Windows Computer with Remote
Desktop to an Cloud Windows 10 VM
Status: Circa Spring 2022: Support for this option is
deprecated. It appears the UNCC Azure subscription has changed
and deleted all the VM's I created in the prior semester. Curses!
Circa 2/4/2020 - This Option has been successfully used by 2
individuals
This C# tutorial does not use any significant computer
graphics. Under these conditions it is sufficient to use
the Remote Desktop Protocol (RDP) to connect to a
remote Windows 10 VM on the Azure Cloud. For this
course, a Window 10 VM image on Azure Cloud has been created with
the following software installed:
On your computer, install the appropriate RDP client.
Starting and Connecting to a Cloud Windows 10
VM
Overview: From the Azure
Dev Tool Portal ("ADT Portal") you will create a
Windows VM that will run in the cloud. The Windows 10 VM
will be based on a VM image created for this course with
required software pre-installed.
You will create and start an Azure Cloud VM using the ADT
Portal, then you will connect to your cloud Windows
10 VM using your RDP client.
Details:
[PC] Install the appropriate RDP
client as discussed in Section 3.2.1
[ADT Portal]: Create a Virtual
Machine (VM) in the Azure Cloud using the image UNCC-CS-Grafix-ImageDefinition.
To do this watch the first part of video below in item
#4.
(Note: this step, #3, only needs to be done once).
[PC::RDP]: Connect to your
created cloud Virtual Machine (VM) using your Remote
Desktop client.
To do this continue watching the second part of video
below:
[PC::RDP]: Tutorial
Session: Connect to the cloud VM through your RDP
client, you can perform all the MSVS and C# exercises and
required git commit's.
[PC::RDP]: Shutdown:
When you complete a session of work on the tutorial choose
"Shutdown" within your RDP client. This will
shutdown your Azure Cloud VM. This avoids leaving your
cloud VM running -- which would uselessly use up your Azure
subscription credits.
Note: You can double check
the status of your cloud VM from the ADT Portal (shown in
the video above). More specifically, from the
ADT Portal Home page, click "Virtual Machines" to see the
status of your VM's. More information on the
Azure VM life cycle is found at this link https://docs.microsoft.com/en-us/azure/virtual-machines/windows/states-lifecycle.
[PC::RDP]: Later
Tutorial Sessions: In order to later return to
working on the tutorial, you do not need to repeat step
#3. After you created Azure VM in step #3, you only
need to re-start the VM from the ADT Portal. From the ADT
Portal Home page, click "Virtual Machines". Select
your VM and then select "Restart". After the VM
status returns to "Running", you can reconnect to it using your
RDP client.
Reminders:
Choose "Shutdown" within your RDP
Client to shutdown your Azure Cloud VM to will avoid leaving
your Cloud VM running which would uselessly use up your
Azure subscription credits.
Step #3 only needs to be done one
time to create your Cloud VM from the image UNCC-CS-Grafix-ImageDefinition.
Once created, you simply start and stop you Azure
Cloud VM through the ADT Portal and then connect to it using
your RDP client.
Git Repo Setup
Time
MSDoc: "? minutes to read"
Assignment: "? minutes to do"
As your read through various sections of the MSDoc's you will perform
various exercises. You must submit them to various directories
inside a single Git repo.
lucretius@CCIWD-435B-1~/ITCS_VRAR/ $git clone
https://cci-git.uncc.edu/your_user_id/MSVS-CSharp-Tutorial.git
MSVS-CSharp-Tutorial Cloning
into'MSVS-CSharp-Tutorial'...
warning: You appear to have cloned an empty repository.
Inside the MSVS-CSharp-Tutorial
directory create a text file called README.md.
Add your name on the first line of the file.
Git commit the file with the commit message “initial README.md”
Inside
the above directory create a second text file called Questions.txt.
Add your name on the first line of the file.
Git commit the file with the commit message “initial Questions.txt”.
Some of the exercises in this tutorial will involve you answering
questions. You will write you answers in this file.
This Tutorial Assignment currently assumes all work is done using
Visual Studio. (Instructions for alternative IDE's
such as Visual Code may be added in future semesters)
Visual Studio
Time
MSDoc: "? minutes to read"
Assignment: "? minutes to do"
In this part you will read MSDoc Welcome to the Visual Studio
IDE, perform the exercises it describes and submit the results
to Git.
Read up to section Create a program.
When instructed to pick a location for your Solution place it in
your repo directory MSVS-CSharp-Tutorial.
(The resulting sub-directory should be called HelloWorld).
Work through the Create a program section
creating all the code and related files as instructed
Git add and commit the created
directories and files with message "-started create-a-program"
Work through the rest of the MSDoc
chapter, use good Git practices and commit the code changes as you
progress through the chapter.
Do not forget to "Save All" in MSVS
Git add and commit the final code with
message "-finished create-a-program"
Note the MSDoc's chapter's See Also
section. These links contain further details that will
be useful as you expand your knowledge of MSVS.
Visual Code
.... in progress....
Visual Code, full name "Visual Studio Code", runs on Windows, Mac,
and Linux. It is a different product line that the
Community, Profession or Enterprise edition.
Visual Studio comes in 3 editions. The Community Edition
is available for free to the public, some restrictions on use may
apply. The Profession and Enterprise Editions are for-pay and
licensed for commercial use.
For this course I recommend using Community Edition for Windows and
Mac users.
In this part you will read Learn to use the code editor,
perform the exercises it describes and submit the results to Git.
Work through the Learn about
projects and solutions,section creating all the
code and the QuickDate solution and projects.
When instructed to pick a location for you Solution place it in your
repo directory MSVS-CSharp-Tutorial.
Finish the chapter; Git add and commit the
created files with message "completed QuickDate solution"
Note the MSDoc's See Also section. These
links contain further details that will be useful as you expand your
knowledge of MSVS.
Below you will work through the Create
a simple C# console app,section creating all the
code and the Calculator app solution and projects.
When instructed to pick a location for you Solution place it in your
repo directory MSVS-CSharp-Tutorial.
Work through sub section Create a
project. Save the files and git add & commit with
message "-create a project"
Work through sub section Create the
app.
For each and every sub-sub section such as Explore
integer math, save the files and git add & commit with
message that includes the sub-sub section title such as "-explorer
integer math"
Work through sub section Debug the app.
For each and every sub-sub section, save the files and
git add & commit with message that includes the sub-sub section
title such as "-fix the "format" error"
Work through sub section Close the app
and verify your final code is that describe in sectionCode complete
Visual Code
... this section is under constructions...
C#
Note the MSDoc chapter "Tour of C#" gives instructions on compiling of
the code using a standard C# command-line interface (CLI). This
tutorial will give substitute instructions using MSVS 2019 for compiling
the example code.
Read through the Program Structure
chapter once without attempting to perform the CLI
instructions.
Watch the following video that shows how to perform the above CLI
steps using MSVS 2019 instead. Perform these MSVS steps
and save your MSVS Solution.
Note, the text after the video reviews the key steps for future
reference.
Steps Covered in Video:
Create a default "Console" C#
Solution
Rename the default Project to an
appropriate name for the executable assembly.
Rename the default .cs file as
appropriate.
Add a new second Project to the
Solution. Use the default "Console" C# Solution.
Rename the second Project to an
appropriate name for the library assembly.
Rename the second Project's default
.cs file as appropriate.
Add a Dependency to the first project
(the executable) making it depend on the second project (the
library)
Adjust the first project (the
executable) to be the "Startup" Project for the solution.
For more details and in depth see the MSDocs such as:
(Note, we are following the MSDoc's chapter sequence slightly out of
order for this chapter. This is needed before proceeding to
the Statements chapter)
Read through this chapter.
You do not have to submit any code, but feel free to experiment as
needed.
In your file Question.txt answer the
following questions:
Namespaces #1: How
do C# namespaces conceptually and syntactically compare to other
languages you are familiar with?
Command Line Arguments
(Note, we are following the MSDoc's chapter sequence slightly out of
order for this chapter. This is needed before proceeding
to the Statements chapter)
In
MSVS create new Console solution called Statements
and place it your MSVS-CSharp-Tutorial
directory. Read through the MSDoc sections listed below. Copy, Paste
and Modify the code snippets for each section into the default .cs
file.
Types of statements -Just read over this list. Later, you will read an MSDoc
section that covers these in more detail
For items below perform that standard procedure of cut, pasting
and modifying the example code into a C# function or class, etc.
For the sections below perform that standard procedure of cut, pasting
and modifying the example code into a new C#
file:
Continue using the Console solution Statements create in the prior Assignment
section. Read through the MSDoc sections listed below. Copy, Paste
and Modify the code snippets for each section into the default .cs
file.
git commit the above with a message
"-completed 9.7.2 exercises"
In your file Question.txt answer the following questions:
Statements #1: Which
of the statements are new to you based on your prior programming
language experience?
Statements #2: For
each of the statement types that is new to you give a brief
description of how it works and briefly describe how it is
similar and/or different from statements in other languages with
which you are familiar?
In MSVS create new Console solution
called Types-System and place it
your MSVS-CSharp-Tutorial directory. Read through the MSDoc
sections listed below. Copy, Paste and Modify the code snippets
for each section into the default .cs file.
Unfortunately, MS removed this section recently, sometime after I created this Tutorial Assignment
In MSVS create new Console solution
called Classes-and-objects and place
it your MSVS-CSharp-Tutorial directory.
Read the MSDoc chapter.
As you read through this chapter copy and
paste all the example classes and create at least one instance of
each in Main.
Following good Git practices, you should make multiple git commits
as you progress through the chapter. Spend some time
experimenting with each code example (calling methods, etc.).
In your file Question.txt answer the
following questions. Pick one OOP language you
are most familiar with and compare and contrast it's features to C#
as detailed below.
Classes #1:
Compare C# kinds of Members to your most familiar OOP
language. Which kinds of C# members are also found in the
other language? Which are only found in C#?
[Your answer should be 3-4 sentences plus two lists]
Classes #2:
Compare C# kinds of accessibility to your most familiar OOP
language. Which of kinds of C# accessibility are found in
the other language? Which are only found in
C#?
[Your answer should be 3-4 sentences plus two lists]
Classes #3:
Compare C# kinds of parameters (ref, out, param, etc.) to your
most familiar OOP language. Which of kinds of C#
parameters are found in the other language? Which are only
found in C#?
[Your answer should be 3-4 sentences plus two lists]
Classes #4:
Does your most familiar OOP language have a feature similar to
C#'s 'static and instance methods'? Describe one
similarity and difference if applicable.
[Your answer should be 3-4 sentences]
Classes #5:
Compare C# 'Virtual, override, and abstract methods' to your
most familiar OOP language. How are these C# feature
similar or different than that language?
[Your answer should be 3-4 sentences]
Classes #6: Does
your other familiar language support method
overloading? What is an advantage and disadvantage
of this language feature?
[Your answer should be 3-4 sentences]
Classes #7: Does
your other familiar language support C# like
properties? What is an advantage and disadvantage of
this language feature?
[Your answer should be 3-4 sentences]
Classes #8:
Does your other familiar language support an equivalent to a C#
Event as a fundmental language feature? If not how would
that language support the C# Event concept using the language
features it has?
[Your answer should be 5-6 sentences]
Classes #9:
Does your other familiar language support a feature equivalent
to a C# finalizer's? What is the language feature
called? How is it similar or different than C#
finalizer?
[Your answer should be 4-5 sentences]
Git commit your updates with the
message "-answered classes questions"
In MSVS create new Console solution
called Structs and place it your MSVS-CSharp-Tutorial directory.
Read this chapter.
As you read through this chapter copy and
paste all the example classes and create at least one instance of
each in Main.
Following good Git practices, you should make multiple git commits
as you progress through the chapter.
In your file Question.txt answer the
following questions. Pick one OOP language you
are most familiar with and compare and contrast it's features to C#
as detailed below.
Structs #1:
Consider the difference in how a C# struct and a C# class
instance is allocated in memory. Does your
familiar language have two different types which are allocated
in a similarly different pair of ways? Or does
it support only one? If one, which allocation strategy is
supported?
[Your answer should be 5-6 sentences]
Git commit your updates with the
message "-answered structs questions"
In MSVS create new Console solution
called Arrays and place it your MSVS-CSharp-Tutorial directory.
Read this chapter.
Read only the section on Arrays at the above link .
While the original link has remained valid, MS greatly rearranged the page containing the overview of Arrays, sometime after I created this Tutorial Assignment
As you read through this chapter copy and
paste all the example classes and create at least one instance of
each in Main.
Following good Git practices, you should make a few git commits as
you progress through the chapter.
In your file Question.txt answer the
following questions. Pick one OOP language you
are most familiar with and compare and contrast it's features to C#
as detailed below.
Arrays #1: Describe
two ways you familiar languages array support is similar or
different from that found in C#?
[Your answer should be 4-5 sentences]
Git commit your updates with the
message "-answered arrays questions"
In MSVS create new Console solution
called Interfaces and place it your MSVS-CSharp-Tutorial directory.
Read this chapter.
As you read through this chapter copy and
paste all the example classes and create at least one instance of
each in Main.
Following good Git practices, you should make a few git commits as
you progress through the chapter.
In your file Question.txt answer the
following questions. Pick one OOP language you
are most familiar with and compare and contrast it's features to C#
as detailed below.
Interfaces #1: Does
your familiar OOP language have a specific interface
construct? If yes, how similar or different is it to
C#? If not, what language feature would you use to
mimic a C# interface?
[Your answer should be 4-5 sentences]
Git commit your updates with the message "-answered
interfaces questions"
In MSVS create new Console solution
called Delegates and place it your MSVS-CSharp-Tutorial directory.
Read this chapter.
Read only the section on Delegates at the above link.
While the original link has remained valid, MS greatly rearranged the page containing the overview of Arrays, sometime after I created this Tutorial Assignment
As you read through this chapter copy and
paste all the example classes and create at least one instance of
each in Main.
Following good Git practices, you should make a few git commits as
you progress through the chapter.
In your file Question.txt answer the
following questions. Pick one OOP language you
are most familiar with and compare and contrast it's features to C#
as detailed below.
Delegates #1: Does
your familiar OOP language have a specific
delegates construct? If yes, how similar or
different is it to C#? If not, what language feature
would you use to mimic a C# delegate?
[Your answer should be 6-7 sentences]
Git commit your updates with the message "-answered delegates
questions"
In MSVS create new Console solution called Attributes and place it
your MSVS-CSharp-Tutorial directory.
Read this chapter.
Read only the section on Attributes at the above link.
While the original link has remained valid, MS greatly rearranged the page containing the overview of Arrays, sometime after I created this Tutorial Assignment
As you read through this chapter copy and
paste all the example classes and create at least one instance of
each in Main.
Following good Git practices, you should make a few git commits as
you progress through the chapter.
In your file Question.txt answer the
following questions. Pick one OOP language you
are most familiar with and compare and contrast it's features to C#
as detailed below.
Attributes #1: Does
your familiar OOP language have a specific attribute
construct? If yes, how similar or different is it to
C#? If not, what language feature would you use to
mimic a C# attribute as best as possible?]
[Your answer should be 5-6 sentences]
Git commit your updates with the
message "-answered attributes questions"
Rubric
Section
Item
Category
Link
Check
Points
Awarded
Comments
Academic Integrity
See the course syllabus regarding partial credit and the late penalty
policy.
This is an individual student project. Each student should
be writing and submitting their own code.
Students can discuss general aspects of the various API's and tools
with each other and this is strongly encouraged. Discussing
algorithm's at the pseudo-code level is also acceptable.
However, it is not permissible:
to copy code from other students
copy code implementing entire functions or entire algorithms from
Internet resources other than the resources explicitly referenced in
this tutorial
to copy code from other students from prior semesters
translate an algorithm found on the Internet implemented in
programming X and re-write it in language Y.
If you have questions about whether using a particular resource is
acceptable or not, email the TA and/or Professor.