Compare commits
No commits in common. "e99c0805d2084ec799934b06531d12dbbba58e6b" and "767e1a6a1feacc7e9b9301e65aac42c1e12c1b96" have entirely different histories.
e99c0805d2
...
767e1a6a1f
15
.gitignore
vendored
15
.gitignore
vendored
@ -1,3 +1,4 @@
|
||||
# ---> VisualStudio
|
||||
## Ignore Visual Studio temporary files, build results, and
|
||||
## files generated by popular Visual Studio add-ons.
|
||||
##
|
||||
@ -29,7 +30,6 @@ x86/
|
||||
bld/
|
||||
[Bb]in/
|
||||
[Oo]bj/
|
||||
[Oo]ut/
|
||||
[Ll]og/
|
||||
[Ll]ogs/
|
||||
|
||||
@ -361,4 +361,15 @@ MigrationBackup/
|
||||
|
||||
# Fody - auto-generated XML schema
|
||||
FodyWeavers.xsd
|
||||
/.gitattributes
|
||||
|
||||
# ---> VisualStudioCode
|
||||
.vscode/*
|
||||
!.vscode/settings.json
|
||||
!.vscode/tasks.json
|
||||
!.vscode/launch.json
|
||||
!.vscode/extensions.json
|
||||
*.code-workspace
|
||||
|
||||
# Local History for Visual Studio Code
|
||||
.history/
|
||||
|
||||
|
@ -1,25 +0,0 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.1.31911.260
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GPA Calculator", "GPA Calculator\GPA Calculator.csproj", "{3A401574-8EE0-4BE0-A38A-4F44283D29C6}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{3A401574-8EE0-4BE0-A38A-4F44283D29C6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{3A401574-8EE0-4BE0-A38A-4F44283D29C6}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{3A401574-8EE0-4BE0-A38A-4F44283D29C6}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{3A401574-8EE0-4BE0-A38A-4F44283D29C6}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {8DBB1FCB-D387-4A6E-A9FA-5FE3556E0774}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
@ -1,9 +0,0 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<RootNamespace>GPA_Calculator</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
@ -1,64 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace GPA_Calculator
|
||||
{
|
||||
internal class Program
|
||||
{
|
||||
static List<Grade> GradesList = new List<Grade>();
|
||||
static void Main(string[] args)
|
||||
{
|
||||
|
||||
string inputGrade = string.Empty;
|
||||
while (inputGrade != "q")
|
||||
{
|
||||
RenderGrades();
|
||||
inputGrade = Console.ReadLine();
|
||||
inputGrade = inputGrade.Replace("+", "Plus").Replace("-", "Minus");
|
||||
if(Enum.TryParse<Grade>(inputGrade, out Grade grade))
|
||||
{
|
||||
GradesList.Add(grade);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void RenderGrades()
|
||||
{
|
||||
Console.Clear();
|
||||
Console.WriteLine("Enter a Grade:\t\t\tGrades:");
|
||||
decimal totalGrade = 0;
|
||||
foreach (var item in GradesList)
|
||||
{
|
||||
Console.WriteLine("\t\t\t\t" + item.ToString().Replace("Plus", "+").Replace("Minus", "-"));
|
||||
totalGrade += (int)item;
|
||||
}
|
||||
if (GradesList.Count > 0)
|
||||
{
|
||||
Console.SetCursorPosition(0, 3);
|
||||
Console.WriteLine("GPA: ");
|
||||
Console.WriteLine(totalGrade / GradesList.Count);
|
||||
}
|
||||
|
||||
Console.SetCursorPosition(0, 1);
|
||||
|
||||
}
|
||||
|
||||
enum Grade
|
||||
{
|
||||
APlus = 9,
|
||||
A = 8,
|
||||
AMinus = 7,
|
||||
BPlus = 6,
|
||||
B = 5,
|
||||
BMinus = 4,
|
||||
CPlus = 3,
|
||||
C = 2,
|
||||
CMinus = 1,
|
||||
Fail = 0,
|
||||
F = 0,
|
||||
D = 0,
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user