Ltt Pokemon + Start student admin
This commit is contained in:
parent
4f8b991da6
commit
b5dc3a1e68
12 changed files with 249 additions and 17 deletions
16
Emne 3/StudentAdmin/StudentAdmin.sln
Normal file
16
Emne 3/StudentAdmin/StudentAdmin.sln
Normal file
|
@ -0,0 +1,16 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StudentAdmin", "StudentAdmin\StudentAdmin.csproj", "{1BFD45C7-2573-474A-B485-B547D49FA00B}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{1BFD45C7-2573-474A-B485-B547D49FA00B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{1BFD45C7-2573-474A-B485-B547D49FA00B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{1BFD45C7-2573-474A-B485-B547D49FA00B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{1BFD45C7-2573-474A-B485-B547D49FA00B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
EndGlobal
|
15
Emne 3/StudentAdmin/StudentAdmin/Fag.cs
Normal file
15
Emne 3/StudentAdmin/StudentAdmin/Fag.cs
Normal file
|
@ -0,0 +1,15 @@
|
|||
namespace StudentAdmin;
|
||||
|
||||
internal class Fag
|
||||
{
|
||||
public int FagKode{get;set;}
|
||||
public string FagNavn{get;set;}
|
||||
public int AntallStudiePoeng {get;set;}
|
||||
|
||||
public Fag(int fagKode, string fagNavn, int antallStudiePoeng)
|
||||
{
|
||||
FagKode = fagKode;
|
||||
FagNavn = fagNavn;
|
||||
AntallStudiePoeng = antallStudiePoeng;
|
||||
}
|
||||
}
|
24
Emne 3/StudentAdmin/StudentAdmin/Karakter.cs
Normal file
24
Emne 3/StudentAdmin/StudentAdmin/Karakter.cs
Normal file
|
@ -0,0 +1,24 @@
|
|||
namespace StudentAdmin;
|
||||
|
||||
internal class Karakter
|
||||
{
|
||||
public Student Student { get; set; }
|
||||
public Fag Fag { get; set; }
|
||||
public int KarakterVerdi { get; set; }
|
||||
|
||||
public Karakter(Student student, Fag fag, int karakterVerdi)
|
||||
{
|
||||
Student = student;
|
||||
Fag = fag;
|
||||
KarakterVerdi = karakterVerdi;
|
||||
}
|
||||
|
||||
public void SkrivUtInfo(Karakter karakter)
|
||||
{
|
||||
Console.WriteLine(
|
||||
$"Student: {karakter.Student}\n" +
|
||||
$"Fag: {karakter.Fag}" +
|
||||
$"Karakter: {karakter.KarakterVerdi}\n"
|
||||
);
|
||||
}
|
||||
}
|
3
Emne 3/StudentAdmin/StudentAdmin/Program.cs
Normal file
3
Emne 3/StudentAdmin/StudentAdmin/Program.cs
Normal file
|
@ -0,0 +1,3 @@
|
|||
// See https://aka.ms/new-console-template for more information
|
||||
|
||||
Console.WriteLine("Hello, World!");
|
27
Emne 3/StudentAdmin/StudentAdmin/Student.cs
Normal file
27
Emne 3/StudentAdmin/StudentAdmin/Student.cs
Normal file
|
@ -0,0 +1,27 @@
|
|||
namespace StudentAdmin;
|
||||
|
||||
internal class Student
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public int Age { get; set; }
|
||||
public string StudieProgram { get; set; }
|
||||
public int StudentID { get; set; }
|
||||
|
||||
public Student(string name, int age, string studieProgram, int studentID)
|
||||
{
|
||||
Name = name;
|
||||
Age = age;
|
||||
StudieProgram = studieProgram;
|
||||
StudentID = studentID;
|
||||
|
||||
}
|
||||
|
||||
public void SkrivUtInfo(Student student)
|
||||
{
|
||||
Console.WriteLine($"Student info: " +
|
||||
$"\nNavn: {student.Name}" +
|
||||
$"\nAlder: {student.Age}" +
|
||||
$"\nProgram: {student.StudieProgram}"
|
||||
);
|
||||
}
|
||||
}
|
10
Emne 3/StudentAdmin/StudentAdmin/StudentAdmin.csproj
Normal file
10
Emne 3/StudentAdmin/StudentAdmin/StudentAdmin.csproj
Normal file
|
@ -0,0 +1,10 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
Loading…
Add table
Add a link
Reference in a new issue