Remaining assignments. Also split the ass to individual projs

This commit is contained in:
Philip Johansson 2022-06-27 01:32:31 +02:00
parent 2e8ce0af8c
commit 142b44599f
181 changed files with 1923 additions and 6 deletions

View File

@ -7,6 +7,18 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Task1", "Task1\Task1.csproj
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Task2", "Task2\Task2.csproj", "{475D62E6-FD3B-4FC3-A831-76023A9EC3B8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Task3", "Task3\Task3.csproj", "{30878132-103A-4755-8DEB-1DB3F643D5C9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Task4", "Task4\Task4.csproj", "{5934756E-C7FC-4F33-B045-926E31E71282}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Task5", "Task5\Task5.csproj", "{2DC98813-B2A8-4D7F-9650-9E480A4D7ABF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Task6", "Task6\Task6.csproj", "{4B7B027E-F0C2-4A81-BFC5-13012886EB56}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Task7", "Task7\Task7.csproj", "{FAC81D21-3A37-4F9E-88D5-01BD5D33C2EE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Task8", "Task8\Task8.csproj", "{B58E9C23-C0FA-40A9-B291-FFFC8BF5B510}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -21,6 +33,30 @@ Global
{475D62E6-FD3B-4FC3-A831-76023A9EC3B8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{475D62E6-FD3B-4FC3-A831-76023A9EC3B8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{475D62E6-FD3B-4FC3-A831-76023A9EC3B8}.Release|Any CPU.Build.0 = Release|Any CPU
{30878132-103A-4755-8DEB-1DB3F643D5C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{30878132-103A-4755-8DEB-1DB3F643D5C9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{30878132-103A-4755-8DEB-1DB3F643D5C9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{30878132-103A-4755-8DEB-1DB3F643D5C9}.Release|Any CPU.Build.0 = Release|Any CPU
{5934756E-C7FC-4F33-B045-926E31E71282}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5934756E-C7FC-4F33-B045-926E31E71282}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5934756E-C7FC-4F33-B045-926E31E71282}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5934756E-C7FC-4F33-B045-926E31E71282}.Release|Any CPU.Build.0 = Release|Any CPU
{2DC98813-B2A8-4D7F-9650-9E480A4D7ABF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2DC98813-B2A8-4D7F-9650-9E480A4D7ABF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2DC98813-B2A8-4D7F-9650-9E480A4D7ABF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2DC98813-B2A8-4D7F-9650-9E480A4D7ABF}.Release|Any CPU.Build.0 = Release|Any CPU
{4B7B027E-F0C2-4A81-BFC5-13012886EB56}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4B7B027E-F0C2-4A81-BFC5-13012886EB56}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4B7B027E-F0C2-4A81-BFC5-13012886EB56}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4B7B027E-F0C2-4A81-BFC5-13012886EB56}.Release|Any CPU.Build.0 = Release|Any CPU
{FAC81D21-3A37-4F9E-88D5-01BD5D33C2EE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FAC81D21-3A37-4F9E-88D5-01BD5D33C2EE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FAC81D21-3A37-4F9E-88D5-01BD5D33C2EE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FAC81D21-3A37-4F9E-88D5-01BD5D33C2EE}.Release|Any CPU.Build.0 = Release|Any CPU
{B58E9C23-C0FA-40A9-B291-FFFC8BF5B510}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B58E9C23-C0FA-40A9-B291-FFFC8BF5B510}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B58E9C23-C0FA-40A9-B291-FFFC8BF5B510}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B58E9C23-C0FA-40A9-B291-FFFC8BF5B510}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -0,0 +1,19 @@
static void ass1()
{
const int spacing = 10;
Console.WriteLine($"{"Number",-spacing}" +
$"{"Square",-spacing}" +
$"{"Cube",-spacing}");
for (int i = 1; i <= 10; i++)
{
Console.WriteLine($"{i,-spacing}" +
$"{Math.Pow(i, 2),-spacing}" +
$"{Math.Pow(i, 3),-spacing}");
}
}
Console.WriteLine("Assignment 1");
ass1();

View File

@ -7,4 +7,8 @@
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<Compile Remove="helpers.xaml.cs" />
</ItemGroup>
</Project>

View File

@ -1 +1 @@
34261c5f4f7bff6c67261af1382874380894628e
67774fa4e73c191aa43f9a092c659ea8f8449956

View File

@ -1,4 +0,0 @@
// See https://aka.ms/new-console-template for more information

View File

@ -93,6 +93,26 @@ void ass4()
Console.WriteLine($"The year {year} the population will be {population}");
}
void ass5()
{
int celsiusToFahrenheit(int celsius)
{
return (9 / 5) * celsius + 32;
}
const int spacing = 10;
Console.WriteLine($"{"Number",-spacing}" +
$"{"Fahrenheit",spacing}");
for (int i = -30; i <= 50; i += 5)
{
Console.WriteLine($"{i,-spacing + 4}" +
$"{celsiusToFahrenheit(i),spacing}");
}
}
Console.WriteLine("Assignment 1");
ass1();
@ -108,6 +128,10 @@ Console.WriteLine();
Console.WriteLine("Assignment 4");
ass4();
Console.WriteLine();
Console.WriteLine("Assignment 5");
ass5();

View File

@ -0,0 +1,20 @@
static void ass2()
{
void calculateSphereVolume(int radius)
{
for (int i = 1; i <= radius; i++)
{
double volume = (4 / 3) * Math.PI * Math.Pow(i, 3);
Console.WriteLine($"Sphere\'s volume with radius {i} is {volume}");
}
}
Console.WriteLine("Enter a radius:");
int radius = Helpers.getInputNumber();
calculateSphereVolume(radius);
}
Console.WriteLine();
Console.WriteLine("Assignment 2");
ass2();

View File

@ -7,4 +7,9 @@
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<Compile Remove="helpers.cs" />
<Compile Remove="Task1.cs" />
</ItemGroup>
</Project>

View File

View File

@ -0,0 +1,25 @@
class Helpers
{
public static int getInputNumber()
{
int numericInput = 0;
bool validInput = false;
string textInput;
while (!validInput)
{
textInput = Console.ReadLine();
try
{
numericInput = Int32.Parse(textInput);
validInput = true;
Console.WriteLine($"You have entered the number {textInput}");
}
catch (FormatException)
{
Console.WriteLine($"Unable to parse '{getInputNumber}' as a number");
}
}
return numericInput;
}
}

View File

@ -1 +1 @@
3af6f8b0cf5fd2eae6167f84f64b88d77bca96e3
54eee374922a538eddbbe9c12d5c6c4d6a1366fc

View File

@ -0,0 +1,27 @@
static void ass3()
{
Console.WriteLine("Enter a number between 2 and 9 for square creation");
bool correntSize = false;
int squareSize = 0;
while (!correntSize)
{
squareSize = Helpers.getInputNumber();
correntSize = squareSize >= 2 && squareSize <= 9;
Console.WriteLine(correntSize ? $"You have entered size {squareSize}" : $"Size out of bound, try again");
}
for (int i = 0; i < squareSize; i++)
{
for (int j = 0; j < squareSize; j++)
{
Console.Write("*");
}
Console.Write("\n");
}
}
Console.WriteLine();
Console.WriteLine("Assignment 3");
ass3();

View File

@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

View File

@ -0,0 +1,25 @@
class Helpers
{
public static int getInputNumber()
{
int numericInput = 0;
bool validInput = false;
string textInput;
while (!validInput)
{
textInput = Console.ReadLine();
try
{
numericInput = Int32.Parse(textInput);
validInput = true;
Console.WriteLine($"You have entered the number {textInput}");
}
catch (FormatException)
{
Console.WriteLine($"Unable to parse '{getInputNumber}' as a number");
}
}
return numericInput;
}
}

View File

@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v6.0", FrameworkDisplayName = "")]

View File

@ -0,0 +1,23 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Task3")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
[assembly: System.Reflection.AssemblyProductAttribute("Task3")]
[assembly: System.Reflection.AssemblyTitleAttribute("Task3")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
// Generated by the MSBuild WriteCodeFragment class.

View File

@ -0,0 +1 @@
ef5db4a2d8c9c628734a6c46cff1efa454372b8f

View File

@ -0,0 +1,10 @@
is_global = true
build_property.TargetFramework = net6.0
build_property.TargetPlatformMinVersion =
build_property.UsingMicrosoftNETSdkWeb =
build_property.ProjectTypeGuids =
build_property.InvariantGlobalization =
build_property.PlatformNeutralAssembly =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = Task3
build_property.ProjectDir = D:\Git\Bashir C-sharp assignments\Module2-Assignments\Task3\

View File

@ -0,0 +1,8 @@
// <auto-generated/>
global using global::System;
global using global::System.Collections.Generic;
global using global::System.IO;
global using global::System.Linq;
global using global::System.Net.Http;
global using global::System.Threading;
global using global::System.Threading.Tasks;

View File

@ -0,0 +1,62 @@
{
"format": 1,
"restore": {
"D:\\Git\\Bashir C-sharp assignments\\Module2-Assignments\\Task3\\Task3.csproj": {}
},
"projects": {
"D:\\Git\\Bashir C-sharp assignments\\Module2-Assignments\\Task3\\Task3.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "D:\\Git\\Bashir C-sharp assignments\\Module2-Assignments\\Task3\\Task3.csproj",
"projectName": "Task3",
"projectPath": "D:\\Git\\Bashir C-sharp assignments\\Module2-Assignments\\Task3\\Task3.csproj",
"packagesPath": "C:\\Users\\phils\\.nuget\\packages\\",
"outputPath": "D:\\Git\\Bashir C-sharp assignments\\Module2-Assignments\\Task3\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"C:\\Users\\phils\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"net6.0"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net6.0": {
"targetAlias": "net6.0",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
}
},
"frameworks": {
"net6.0": {
"targetAlias": "net6.0",
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\6.0.202\\RuntimeIdentifierGraph.json"
}
}
}
}
}

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\phils\.nuget\packages\</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.1.0</NuGetToolVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="C:\Users\phils\.nuget\packages\" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />

View File

@ -0,0 +1,67 @@
{
"version": 3,
"targets": {
"net6.0": {}
},
"libraries": {},
"projectFileDependencyGroups": {
"net6.0": []
},
"packageFolders": {
"C:\\Users\\phils\\.nuget\\packages\\": {}
},
"project": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "D:\\Git\\Bashir C-sharp assignments\\Module2-Assignments\\Task3\\Task3.csproj",
"projectName": "Task3",
"projectPath": "D:\\Git\\Bashir C-sharp assignments\\Module2-Assignments\\Task3\\Task3.csproj",
"packagesPath": "C:\\Users\\phils\\.nuget\\packages\\",
"outputPath": "D:\\Git\\Bashir C-sharp assignments\\Module2-Assignments\\Task3\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"C:\\Users\\phils\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"net6.0"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net6.0": {
"targetAlias": "net6.0",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
}
},
"frameworks": {
"net6.0": {
"targetAlias": "net6.0",
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\6.0.202\\RuntimeIdentifierGraph.json"
}
}
}
}

View File

@ -0,0 +1,8 @@
{
"version": 2,
"dgSpecHash": "lX06eOy/M+GCHSU6W/TWSHTfvZblG7OHtJDk2BQXoZ5dXE6BODqVUYFKM/unpAp/7ZqRyhfUgAr3ZZzGuDIf9w==",
"success": true,
"projectFilePath": "D:\\Git\\Bashir C-sharp assignments\\Module2-Assignments\\Task3\\Task3.csproj",
"expectedPackageFiles": [],
"logs": []
}

View File

@ -0,0 +1,17 @@
void ass4()
{
double population = 6.5E12;
int year = 2022;
while (population < 10E12)
{
year++;
population *= 1.014;
}
Console.WriteLine($"The year {year} the population will be {Math.Floor(population)}");
}
Console.WriteLine();
Console.WriteLine("Assignment 4");
ass4();

View File

@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

View File

@ -0,0 +1,23 @@
{
"runtimeTarget": {
"name": ".NETCoreApp,Version=v6.0",
"signature": ""
},
"compilationOptions": {},
"targets": {
".NETCoreApp,Version=v6.0": {
"Task4/1.0.0": {
"runtime": {
"Task4.dll": {}
}
}
}
},
"libraries": {
"Task4/1.0.0": {
"type": "project",
"serviceable": false,
"sha512": ""
}
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,9 @@
{
"runtimeOptions": {
"tfm": "net6.0",
"framework": {
"name": "Microsoft.NETCore.App",
"version": "6.0.0"
}
}
}

View File

@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v6.0", FrameworkDisplayName = "")]

View File

@ -0,0 +1,23 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Task4")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
[assembly: System.Reflection.AssemblyProductAttribute("Task4")]
[assembly: System.Reflection.AssemblyTitleAttribute("Task4")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
// Generated by the MSBuild WriteCodeFragment class.

View File

@ -0,0 +1 @@
a6523ddce77817e1ac872d5244cfe0a176c323d0

View File

@ -0,0 +1,10 @@
is_global = true
build_property.TargetFramework = net6.0
build_property.TargetPlatformMinVersion =
build_property.UsingMicrosoftNETSdkWeb =
build_property.ProjectTypeGuids =
build_property.InvariantGlobalization =
build_property.PlatformNeutralAssembly =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = Task4
build_property.ProjectDir = D:\Git\Bashir C-sharp assignments\Module2-Assignments\Task4\

View File

@ -0,0 +1,8 @@
// <auto-generated/>
global using global::System;
global using global::System.Collections.Generic;
global using global::System.IO;
global using global::System.Linq;
global using global::System.Net.Http;
global using global::System.Threading;
global using global::System.Threading.Tasks;

View File

@ -0,0 +1 @@
b05d883bde0ac6973430e614cf86571eed142d03

View File

@ -0,0 +1,15 @@
D:\Git\Bashir C-sharp assignments\Module2-Assignments\Task4\bin\Debug\net6.0\Task4.exe
D:\Git\Bashir C-sharp assignments\Module2-Assignments\Task4\bin\Debug\net6.0\Task4.deps.json
D:\Git\Bashir C-sharp assignments\Module2-Assignments\Task4\bin\Debug\net6.0\Task4.runtimeconfig.json
D:\Git\Bashir C-sharp assignments\Module2-Assignments\Task4\bin\Debug\net6.0\Task4.dll
D:\Git\Bashir C-sharp assignments\Module2-Assignments\Task4\bin\Debug\net6.0\Task4.pdb
D:\Git\Bashir C-sharp assignments\Module2-Assignments\Task4\obj\Debug\net6.0\Task4.csproj.AssemblyReference.cache
D:\Git\Bashir C-sharp assignments\Module2-Assignments\Task4\obj\Debug\net6.0\Task4.GeneratedMSBuildEditorConfig.editorconfig
D:\Git\Bashir C-sharp assignments\Module2-Assignments\Task4\obj\Debug\net6.0\Task4.AssemblyInfoInputs.cache
D:\Git\Bashir C-sharp assignments\Module2-Assignments\Task4\obj\Debug\net6.0\Task4.AssemblyInfo.cs
D:\Git\Bashir C-sharp assignments\Module2-Assignments\Task4\obj\Debug\net6.0\Task4.csproj.CoreCompileInputs.cache
D:\Git\Bashir C-sharp assignments\Module2-Assignments\Task4\obj\Debug\net6.0\Task4.dll
D:\Git\Bashir C-sharp assignments\Module2-Assignments\Task4\obj\Debug\net6.0\refint\Task4.dll
D:\Git\Bashir C-sharp assignments\Module2-Assignments\Task4\obj\Debug\net6.0\Task4.pdb
D:\Git\Bashir C-sharp assignments\Module2-Assignments\Task4\obj\Debug\net6.0\Task4.genruntimeconfig.cache
D:\Git\Bashir C-sharp assignments\Module2-Assignments\Task4\obj\Debug\net6.0\ref\Task4.dll

Binary file not shown.

View File

@ -0,0 +1 @@
979a282454265105ce3538c59f6f6b46342cf691

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,62 @@
{
"format": 1,
"restore": {
"D:\\Git\\Bashir C-sharp assignments\\Module2-Assignments\\Task4\\Task4.csproj": {}
},
"projects": {
"D:\\Git\\Bashir C-sharp assignments\\Module2-Assignments\\Task4\\Task4.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "D:\\Git\\Bashir C-sharp assignments\\Module2-Assignments\\Task4\\Task4.csproj",
"projectName": "Task4",
"projectPath": "D:\\Git\\Bashir C-sharp assignments\\Module2-Assignments\\Task4\\Task4.csproj",
"packagesPath": "C:\\Users\\phils\\.nuget\\packages\\",
"outputPath": "D:\\Git\\Bashir C-sharp assignments\\Module2-Assignments\\Task4\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"C:\\Users\\phils\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"net6.0"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net6.0": {
"targetAlias": "net6.0",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
}
},
"frameworks": {
"net6.0": {
"targetAlias": "net6.0",
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\6.0.202\\RuntimeIdentifierGraph.json"
}
}
}
}
}

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\phils\.nuget\packages\</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.1.0</NuGetToolVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="C:\Users\phils\.nuget\packages\" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />

View File

@ -0,0 +1,67 @@
{
"version": 3,
"targets": {
"net6.0": {}
},
"libraries": {},
"projectFileDependencyGroups": {
"net6.0": []
},
"packageFolders": {
"C:\\Users\\phils\\.nuget\\packages\\": {}
},
"project": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "D:\\Git\\Bashir C-sharp assignments\\Module2-Assignments\\Task4\\Task4.csproj",
"projectName": "Task4",
"projectPath": "D:\\Git\\Bashir C-sharp assignments\\Module2-Assignments\\Task4\\Task4.csproj",
"packagesPath": "C:\\Users\\phils\\.nuget\\packages\\",
"outputPath": "D:\\Git\\Bashir C-sharp assignments\\Module2-Assignments\\Task4\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"C:\\Users\\phils\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"net6.0"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net6.0": {
"targetAlias": "net6.0",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
}
},
"frameworks": {
"net6.0": {
"targetAlias": "net6.0",
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\6.0.202\\RuntimeIdentifierGraph.json"
}
}
}
}

View File

@ -0,0 +1,8 @@
{
"version": 2,
"dgSpecHash": "SDhxOvEijIxjrITLLXThQj9HxmwcKQxrfPhepL1yOyfgRcUCz5Z5CPzLnNELvP7Oas27Txrs8keoz56z3bhPwg==",
"success": true,
"projectFilePath": "D:\\Git\\Bashir C-sharp assignments\\Module2-Assignments\\Task4\\Task4.csproj",
"expectedPackageFiles": [],
"logs": []
}

View File

@ -0,0 +1,23 @@
void ass5()
{
int celsiusToFahrenheit(int celsius)
{
return (9 / 5) * celsius + 32;
}
const int spacing = 10;
Console.WriteLine($"{"Number",-spacing}" +
$"{"Fahrenheit",spacing}");
for (int i = -30; i <= 50; i += 5)
{
Console.WriteLine($"{i,-spacing + 4}" +
$"{celsiusToFahrenheit(i),spacing}");
}
}
Console.WriteLine();
Console.WriteLine("Assignment 5");
ass5();

View File

@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

View File

@ -0,0 +1,23 @@
{
"runtimeTarget": {
"name": ".NETCoreApp,Version=v6.0",
"signature": ""
},
"compilationOptions": {},
"targets": {
".NETCoreApp,Version=v6.0": {
"Task5/1.0.0": {
"runtime": {
"Task5.dll": {}
}
}
}
},
"libraries": {
"Task5/1.0.0": {
"type": "project",
"serviceable": false,
"sha512": ""
}
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,9 @@
{
"runtimeOptions": {
"tfm": "net6.0",
"framework": {
"name": "Microsoft.NETCore.App",
"version": "6.0.0"
}
}
}

View File

@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v6.0", FrameworkDisplayName = "")]

View File

@ -0,0 +1,23 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Task5")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
[assembly: System.Reflection.AssemblyProductAttribute("Task5")]
[assembly: System.Reflection.AssemblyTitleAttribute("Task5")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
// Generated by the MSBuild WriteCodeFragment class.

View File

@ -0,0 +1 @@
efec534a3a450ea290f456e8225efe80583dd190

View File

@ -0,0 +1,10 @@
is_global = true
build_property.TargetFramework = net6.0
build_property.TargetPlatformMinVersion =
build_property.UsingMicrosoftNETSdkWeb =
build_property.ProjectTypeGuids =
build_property.InvariantGlobalization =
build_property.PlatformNeutralAssembly =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = Task5
build_property.ProjectDir = D:\Git\Bashir C-sharp assignments\Module2-Assignments\Task5\

View File

@ -0,0 +1,8 @@
// <auto-generated/>
global using global::System;
global using global::System.Collections.Generic;
global using global::System.IO;
global using global::System.Linq;
global using global::System.Net.Http;
global using global::System.Threading;
global using global::System.Threading.Tasks;

View File

@ -0,0 +1 @@
0a1eb2c19d9eec36f2c38fd5568eb833e03ecb0d

View File

@ -0,0 +1,15 @@
D:\Git\Bashir C-sharp assignments\Module2-Assignments\Task5\bin\Debug\net6.0\Task5.exe
D:\Git\Bashir C-sharp assignments\Module2-Assignments\Task5\bin\Debug\net6.0\Task5.deps.json
D:\Git\Bashir C-sharp assignments\Module2-Assignments\Task5\bin\Debug\net6.0\Task5.runtimeconfig.json
D:\Git\Bashir C-sharp assignments\Module2-Assignments\Task5\bin\Debug\net6.0\Task5.dll
D:\Git\Bashir C-sharp assignments\Module2-Assignments\Task5\bin\Debug\net6.0\Task5.pdb
D:\Git\Bashir C-sharp assignments\Module2-Assignments\Task5\obj\Debug\net6.0\Task5.csproj.AssemblyReference.cache
D:\Git\Bashir C-sharp assignments\Module2-Assignments\Task5\obj\Debug\net6.0\Task5.GeneratedMSBuildEditorConfig.editorconfig
D:\Git\Bashir C-sharp assignments\Module2-Assignments\Task5\obj\Debug\net6.0\Task5.AssemblyInfoInputs.cache
D:\Git\Bashir C-sharp assignments\Module2-Assignments\Task5\obj\Debug\net6.0\Task5.AssemblyInfo.cs
D:\Git\Bashir C-sharp assignments\Module2-Assignments\Task5\obj\Debug\net6.0\Task5.csproj.CoreCompileInputs.cache
D:\Git\Bashir C-sharp assignments\Module2-Assignments\Task5\obj\Debug\net6.0\Task5.dll
D:\Git\Bashir C-sharp assignments\Module2-Assignments\Task5\obj\Debug\net6.0\refint\Task5.dll
D:\Git\Bashir C-sharp assignments\Module2-Assignments\Task5\obj\Debug\net6.0\Task5.pdb
D:\Git\Bashir C-sharp assignments\Module2-Assignments\Task5\obj\Debug\net6.0\Task5.genruntimeconfig.cache
D:\Git\Bashir C-sharp assignments\Module2-Assignments\Task5\obj\Debug\net6.0\ref\Task5.dll

Binary file not shown.

View File

@ -0,0 +1 @@
2d79a39a29a027c2e77ccfa696f5f9aa2b477ab5

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,62 @@
{
"format": 1,
"restore": {
"D:\\Git\\Bashir C-sharp assignments\\Module2-Assignments\\Task5\\Task5.csproj": {}
},
"projects": {
"D:\\Git\\Bashir C-sharp assignments\\Module2-Assignments\\Task5\\Task5.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "D:\\Git\\Bashir C-sharp assignments\\Module2-Assignments\\Task5\\Task5.csproj",
"projectName": "Task5",
"projectPath": "D:\\Git\\Bashir C-sharp assignments\\Module2-Assignments\\Task5\\Task5.csproj",
"packagesPath": "C:\\Users\\phils\\.nuget\\packages\\",
"outputPath": "D:\\Git\\Bashir C-sharp assignments\\Module2-Assignments\\Task5\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"C:\\Users\\phils\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"net6.0"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net6.0": {
"targetAlias": "net6.0",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
}
},
"frameworks": {
"net6.0": {
"targetAlias": "net6.0",
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\6.0.202\\RuntimeIdentifierGraph.json"
}
}
}
}
}

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\phils\.nuget\packages\</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.1.0</NuGetToolVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="C:\Users\phils\.nuget\packages\" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />

View File

@ -0,0 +1,67 @@
{
"version": 3,
"targets": {
"net6.0": {}
},
"libraries": {},
"projectFileDependencyGroups": {
"net6.0": []
},
"packageFolders": {
"C:\\Users\\phils\\.nuget\\packages\\": {}
},
"project": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "D:\\Git\\Bashir C-sharp assignments\\Module2-Assignments\\Task5\\Task5.csproj",
"projectName": "Task5",
"projectPath": "D:\\Git\\Bashir C-sharp assignments\\Module2-Assignments\\Task5\\Task5.csproj",
"packagesPath": "C:\\Users\\phils\\.nuget\\packages\\",
"outputPath": "D:\\Git\\Bashir C-sharp assignments\\Module2-Assignments\\Task5\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"C:\\Users\\phils\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"net6.0"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net6.0": {
"targetAlias": "net6.0",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
}
},
"frameworks": {
"net6.0": {
"targetAlias": "net6.0",
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\6.0.202\\RuntimeIdentifierGraph.json"
}
}
}
}

View File

@ -0,0 +1,8 @@
{
"version": 2,
"dgSpecHash": "pjAkGQM7smJ/JaUX9F1oXRR4aorIspkYxjNU8c5UfZ5OpsJIwefJnYO7TExxME+12PBZ409vcRR/gtnIGjnpug==",
"success": true,
"projectFilePath": "D:\\Git\\Bashir C-sharp assignments\\Module2-Assignments\\Task5\\Task5.csproj",
"expectedPackageFiles": [],
"logs": []
}

View File

@ -0,0 +1,42 @@
static void ass6()
{
Dictionary<String, String> Grades = new Dictionary<String, String> {
{"A", "Excellent - outstanding performance with only minor errors"},
{"B", "Very good above the average standard but with some errors" },
{"C", "Good generally sound work with a number of notable errors" },
{"D", "Satisfactory fair but with significant shortcomings" },
{"E", "Sufficient performance meets the minimum criteria" },
{"Fx", "Fail some more work required before the credit can be awarded" },
{"F", "Fail - considerable further work is required" }
};
bool inputIsG = false;
Console.Write("Write your grade in [");
foreach (var item in Grades)
{
Console.Write(" " + item.Key);
}
Console.Write(" ]\n Type \"G\" to exit\n");
while (!inputIsG)
{
String input = Console.ReadLine();
if (Grades.ContainsKey(input))
{
Console.WriteLine(Grades[input]);
}
else if (input == "G")
{
inputIsG = true;
}
else
{
Console.WriteLine("Invalid input, try again");
}
}
}
Console.WriteLine("Assignment 6");
ass6();

View File

@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

View File

@ -0,0 +1,23 @@
{
"runtimeTarget": {
"name": ".NETCoreApp,Version=v6.0",
"signature": ""
},
"compilationOptions": {},
"targets": {
".NETCoreApp,Version=v6.0": {
"Task6/1.0.0": {
"runtime": {
"Task6.dll": {}
}
}
}
},
"libraries": {
"Task6/1.0.0": {
"type": "project",
"serviceable": false,
"sha512": ""
}
}
}

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More