Compare commits
4
Commits
e99c0805d2
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
15d938d930 | ||
|
|
9f06c2d20f | ||
|
|
13db7d0353 | ||
|
|
02367df310 |
@@ -14,11 +14,19 @@ namespace GPA_Calculator
|
|||||||
{
|
{
|
||||||
RenderGrades();
|
RenderGrades();
|
||||||
inputGrade = Console.ReadLine();
|
inputGrade = Console.ReadLine();
|
||||||
inputGrade = inputGrade.Replace("+", "Plus").Replace("-", "Minus");
|
inputGrade = inputGrade.ToUpper().Replace("+", "Plus").Replace("-", "Minus");
|
||||||
if(Enum.TryParse<Grade>(inputGrade, out Grade grade))
|
if(Enum.TryParse<Grade>(inputGrade, out Grade grade))
|
||||||
{
|
{
|
||||||
GradesList.Add(grade);
|
GradesList.Add(grade);
|
||||||
}
|
}
|
||||||
|
else if (inputGrade == "clear")
|
||||||
|
{
|
||||||
|
GradesList = new List<Grade>();
|
||||||
|
}
|
||||||
|
else if (inputGrade == "undo" && GradesList.Count > 0)
|
||||||
|
{
|
||||||
|
GradesList.RemoveAt(GradesList.Count - 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -38,7 +46,7 @@ namespace GPA_Calculator
|
|||||||
{
|
{
|
||||||
Console.SetCursorPosition(0, 3);
|
Console.SetCursorPosition(0, 3);
|
||||||
Console.WriteLine("GPA: ");
|
Console.WriteLine("GPA: ");
|
||||||
Console.WriteLine(totalGrade / GradesList.Count);
|
Console.WriteLine((totalGrade / GradesList.Count).ToString("0.##"));
|
||||||
}
|
}
|
||||||
|
|
||||||
Console.SetCursorPosition(0, 1);
|
Console.SetCursorPosition(0, 1);
|
||||||
|
|||||||
Reference in New Issue
Block a user