- Create a new Repository by clicking the green "Use this Template" button and setup a new repository in your account.
git clone
the repo you just created locally.- Create a new project in Visual Studio, placing the project in the cloned repo folder.
- Paste the following template in the
Program.cs
file:Console.WriteLine("How many records do you want to add? "); var numberOfRecords = int.Parse(Console.ReadLine()); var recordList = new List<MyClass>(); for (int i = 0; i < numberOfRecords; i++) { // In this loop, populate the object's properties using Console.ReadLine() var myClass = new MyClass(); Console.WriteLine("Enter the value for "); myClass.myProperty = Console.ReadLine(); recordList.Add(myClass); } // Print out the list of records using Console.WriteLine()
- Create a new object and then create another object that inherits from it. Each object should have at least 1 property.
- Replace
MyClass
inProgram.cs
with the child class that you made in step 5. - Replace
MyClass.myProperty
inProgram.cs
with the child class property you created in step 5. - You should allow the user to add data for every property in your class.
- Print the objects in recordList to the screen
- Hint: Look into class
ToString()
method.
- Hint: Look into class
- Upload to the repository we created earlier on your Github account.
- Either through Add file > upload files
- Or via git commands
cd <to-the-project-folder>
- This will change the directory in terminal/command line to the folder you specify.
git init
- This will tell git to initialize a git repo in the current directory.
git remote add origin <url-to-repo>
- This will tell git to add a new remote to the current git repo.
git pull
- This will tell git to pull down the remote git repo which will be from github.
git add .
- This will stage all local changes.
git commit -m"I did it!"
- This commits the staged changes into the git repo.
git push
- This will push the local git history to the remote (github).
- Turn in the knowledge check in Google Classroom. Make sure you include the link to your new GitHub repository when you "Turn In" the assignment.
-
Notifications
You must be signed in to change notification settings - Fork 8
CodeLouisville/sdc1-knowledge-check-2
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Knowledge Check 2 for Software Course 1
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published