Skip to content

Commit af6c9e8

Browse files
committed
Update assignment project
1 parent d51e9d4 commit af6c9e8

File tree

162 files changed

+8331
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

162 files changed

+8331
-0
lines changed

.github/workflows/dotnet.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: .NET
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v2
12+
- name: Set up .NET
13+
uses: actions/setup-dotnet@v1
14+
with:
15+
dotnet-version: 6.0.x
16+
- name: Restore dependencies
17+
run: dotnet restore
18+
- name: Build
19+
run: dotnet build --no-restore
20+
- name: Test
21+
run: dotnet test --no-build --verbosity normal

.vs/CSharpBasics/v16/.suo

12 KB
Binary file not shown.

.vs/CSharpBasics/v17/.suo

12 KB
Binary file not shown.

Assignment.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Assignment
2+
3+
## Task
4+
5+
Write a program in C# that reads an integer from the user and prints "Even" if the number is even and "Odd" if the number is odd.
6+
7+
### Input
8+
9+
- An integer `n`.
10+
11+
### Output
12+
13+
- "Even" if `n` is even.
14+
- "Odd" if `n` is odd.
15+
16+
### Example
17+
18+
#### Input

CSharpBasics.sln

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.0.31903.59
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StudentSubmission", "StudentSubmission\StudentSubmission.csproj", "{029701A1-D937-4C0A-AEA3-757C8F0C1ABB}"
7+
EndProject
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "Tests\Tests.csproj", "{D9AA0945-D94B-4ABF-B3EB-56735F38C516}"
9+
EndProject
10+
Global
11+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
12+
Debug|Any CPU = Debug|Any CPU
13+
Release|Any CPU = Release|Any CPU
14+
EndGlobalSection
15+
GlobalSection(SolutionProperties) = preSolution
16+
HideSolutionNode = FALSE
17+
EndGlobalSection
18+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
19+
{029701A1-D937-4C0A-AEA3-757C8F0C1ABB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
20+
{029701A1-D937-4C0A-AEA3-757C8F0C1ABB}.Debug|Any CPU.Build.0 = Debug|Any CPU
21+
{029701A1-D937-4C0A-AEA3-757C8F0C1ABB}.Release|Any CPU.ActiveCfg = Release|Any CPU
22+
{029701A1-D937-4C0A-AEA3-757C8F0C1ABB}.Release|Any CPU.Build.0 = Release|Any CPU
23+
{D9AA0945-D94B-4ABF-B3EB-56735F38C516}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
24+
{D9AA0945-D94B-4ABF-B3EB-56735F38C516}.Debug|Any CPU.Build.0 = Debug|Any CPU
25+
{D9AA0945-D94B-4ABF-B3EB-56735F38C516}.Release|Any CPU.ActiveCfg = Release|Any CPU
26+
{D9AA0945-D94B-4ABF-B3EB-56735F38C516}.Release|Any CPU.Build.0 = Release|Any CPU
27+
EndGlobalSection
28+
EndGlobal

StudentSubmission/Program.cs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
using System;
2+
3+
namespace StudentSubmission
4+
{
5+
public class Program
6+
{
7+
public static void Main(string[] args)
8+
{
9+
// Read an integer from user input
10+
int n = int.Parse(Console.ReadLine());
11+
12+
// Determine if the number is even or odd and print the result
13+
if (n % 2 == 0)
14+
{
15+
Console.WriteLine("Even");
16+
}
17+
else
18+
{
19+
Console.WriteLine("Odd");
20+
}
21+
}
22+
}
23+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net6.0</TargetFramework>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
</PropertyGroup>
9+
10+
</Project>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"runtimeTarget": {
3+
"name": ".NETCoreApp,Version=v6.0",
4+
"signature": ""
5+
},
6+
"compilationOptions": {},
7+
"targets": {
8+
".NETCoreApp,Version=v6.0": {
9+
"StudentSubmission/1.0.0": {
10+
"runtime": {
11+
"StudentSubmission.dll": {}
12+
}
13+
}
14+
}
15+
},
16+
"libraries": {
17+
"StudentSubmission/1.0.0": {
18+
"type": "project",
19+
"serviceable": false,
20+
"sha512": ""
21+
}
22+
}
23+
}
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)