August 21, 2018
Re-download the files you saved last time (the whole Welcome
folder) on the computer and make sure you can still open the project with Visual Studio (VS). Do you remember how to build the solution and start the program without debugging? Using the shortcuts? If not, go have another look at the previous lab.
If your backup went wrong (you can’t open the project, it won’t compile, …), try to understand what happened. Then, re-download the “Welcome” archive, extract it and make sure you can build the solution and start the program without debugging.
Have a look at the following screenshot:
You should have roughly the same on your computer. If not, you can zoom to have a better reading.
Answer the following:
Close Visual Studio (VS). With the file explorer, create a new folder (call it for instance 02
) and copy the Welcome
folder in it. You will rename and edit this copy.
Open with VS the copy of the Welcome
folder that you just created. Lets rename the solution within VS:
.sln
file changed?You should not rename a solution with the file explorer: always use VS to rename.
We will now change (edit) our “MyFirstProgram” solution.
program.cs
, replace "Welcome to the lab portion of CSCI 1301!"
with "This is my first program."
.Insert a new line after line 6, and paste the following:
Insert another new line after the one you just created, and paste the following:
WriteLine
and Write
?Insert another new line after the one you just created, and paste the following:
\t
is doing?Insert another new line after the one you just created, and paste the following:
\n
is doing?\
and the "
characters.Add a comment (using //
or /*
and */
) in your program.
Make a back up of what you just did: upload the 02
folder you created previously on your remote backup, or copy it on your thumb drive.
If you followed the instructions carefully, your were able to build the solution and start the program without debugging after each step. As you know, C# has precise rules, and not respecting them can prevent your solution from being built by VS.
In this exercise, you are asked to do the following:
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Do it three times, in order to identify three different error messages, and three ways of breaking the rules.
If you have time or lack inspiration, you can try with the following, and see which one(s) make the building impossible (don’t forget to undo your change after):
using Sytem
class Welcome
with class TestOne
}
symbol) at the last line.Console.WriteLine
with CONSOLE.WriteLine
Console.WriteLine
with Console.WRITELINE
Console.
and WriteLine
WriteLine
and (
Write
and Line
Main()
with Method()