Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace GradeCalculatorConsole
- {
- class Program
- {
- static string userChoice, choice, confirm;
- static int choiceConfirm;
- // 1 = gpa 0 = money
- static void Main(string[] args)
- {
- //showWelcomeMessage();
- //gorm();
- //gpaCalculate();
- //consoleNoClose();
- getGrades();
- }
- static void showWelcomeMessage()
- {
- Console.WriteLine(" =========================================================");
- Console.WriteLine("|| _____ _ _____ _ ||");
- Console.WriteLine("|| |__ |___ ___| |_ ___ | __|___ ___ _| |___ ||");
- Console.WriteLine("|| | __| .'| _| |_ -| | | | _| .'| . | -_| ||");
- Console.WriteLine("|| |_____|__,|___|_|_|___| |_____|_| |__,|___|___| ||");
- Console.WriteLine("|| ||");
- Console.WriteLine("|| _____ _ _ _ ||");
- Console.WriteLine("|| | |___| |___ _ _| |___| |_ ___ ___ ||");
- Console.WriteLine("|| | --| .'| | _| | | | .'| _| . | _| ||");
- Console.WriteLine("|| |_____|__,|_|___|___|_|__,|_| |___|_| ||");
- Console.WriteLine("|| ||");
- Console.WriteLine(" =========================================================");
- Console.WriteLine();
- Console.WriteLine("=======================================");
- Console.WriteLine("Welcome to Zach's Grade Calculator V2");
- Console.WriteLine("=======================================");
- Console.WriteLine();
- }
- static void consoleNoClose()
- {
- Console.WriteLine();
- Console.WriteLine();
- Console.WriteLine("Press Any Key to Exit . . .");
- Console.ReadKey();
- }
- static void gpaCalculate()
- {
- Console.Clear();
- Console.WriteLine("GPA Calculator Initialized");
- Console.WriteLine("=======================================");
- Console.WriteLine("This is calculated using the weighted gpa system:");
- Console.WriteLine("Standard A = 4 | Honors A = 4.5 | AP A = 5");
- Console.WriteLine("Standard B = 3 | Honors B = 3.5 | AP B = 4");
- Console.WriteLine("Standard C = 2 | Honors C = 2.5 | AP C = 3");
- Console.WriteLine("Standard D = 1 | Honors D = 1.5 | AP D = 2");
- Console.WriteLine("Standard F = 0 | Honors F = 0.5 | AP F = 1");
- Console.WriteLine("=======================================");
- getGrades();
- }
- static int getGradePoints()
- {
- int total;
- stanclass1 = stanclass1.ToUpper();
- stanclass2 = stanclass2.ToUpper();
- stanclass3 = stanclass3.ToUpper();
- stanclass4 = stanclass3.ToUpper();
- honclass1 = honclass1.ToUpper()
- switch (stanclass1)
- {
- case "A":
- total = total + 4;
- break;
- case "B":
- total = total + 3;
- break;
- case "C":
- total = total + 2;
- break;
- case "D":
- total = total + 1;
- break;
- }
- }
- static string standardchar, honorschar, apchar, stanclass1, stanclass2, stanclass3, stanclass4, honclass1, honclass2, honclass3,honclass4,apclass1, apclass2, apclass3, apclass4;
- static int standard, honors, ap;
- static void getGrades()
- {
- #region old
- /*
- Console.WriteLine("How many grade level classes are you taking?");
- int standardNumber = int.Parse(Console.ReadLine());
- Console.WriteLine();
- Console.WriteLine("How many honors level classes are you taking?");
- int honorsNumber = int.Parse(Console.ReadLine());
- Console.WriteLine();
- Console.WriteLine("How many AP level classes are you taking?");
- int apNumber = int.Parse(Console.ReadLine());
- Console.WriteLine();
- Console.WriteLine("Enter your letter grades when prompted.");
- Console.WriteLine("=======================================");
- for (int a = 0; a == standardNumber; a++)
- {
- int num = 1;
- Console.WriteLine("Enter letter grade for standard class {0}:", num);
- switch (num)
- {
- case 1:
- string class1 = Console.ReadLine();
- break;
- case 2:
- string class2 = Console.ReadLine();
- break;
- case 3:
- string class3 = Console.ReadLine();
- break;
- case 4:
- string class4 = Console.ReadLine();
- break;
- default:
- break;
- }
- }
- */
- #endregion
- Console.WriteLine("How many grade level classes are you taking?");
- standardchar = Console.ReadLine();
- standard = int.Parse(standardchar);
- Console.WriteLine();
- Console.WriteLine("How many honors level classes are you taking?");
- honorschar = Console.ReadLine();
- honors = int.Parse(honorschar);
- Console.WriteLine();
- Console.WriteLine("How many AP level classes are you taking?");
- apchar = Console.ReadLine();
- ap = int.Parse(apchar);
- Console.WriteLine();
- int i = 1;
- while (i < standard + 1)
- {
- Console.WriteLine("Enter letter grade for standard class {0}", i);
- if (standard == 1)
- {
- stanclass1 = Console.ReadLine();
- }
- else if (standard == 2)
- {
- stanclass2 = Console.ReadLine();
- }
- else if (standard == 3)
- {
- stanclass3 = Console.ReadLine();
- }
- else if (standard == 4)
- {
- stanclass4 = Console.ReadLine();
- }
- i++;
- }
- i = 1;
- while (i < honors + 1)
- {
- Console.WriteLine("Enter letter grade for Honors class {0}", i);
- if (honors == 1)
- {
- honclass1 = Console.ReadLine();
- }
- else if (honors == 2)
- {
- honclass2 = Console.ReadLine();
- }
- else if (honors == 3)
- {
- honclass3 = Console.ReadLine();
- }
- else if (honors == 4)
- {
- honclass4 = Console.ReadLine();
- }
- i++;
- }
- i = 1;
- while(i < ap + 1)
- {
- if (ap == 1)
- {
- apclass1 = Console.ReadLine();
- }
- else if (ap == 2)
- {
- apclass2 = Console.ReadLine();
- }
- else if (ap == 3)
- {
- apclass3 = Console.ReadLine();
- }
- else if (ap == 4)
- {
- apclass4 = Console.ReadLine();
- }
- }
- i++;
- }
- static void moneyCalculate()
- {
- Console.Clear();
- Console.WriteLine("Money Calculator Initialized");
- }
- static void gorm()
- {
- Console.WriteLine("What would you like to do?");
- Console.WriteLine();
- Console.WriteLine("Type GPA for a GPA Calculator, type MONEY for a money calculator.");
- Console.WriteLine("=======================================");
- userChoice = Console.ReadLine();
- userChoice = userChoice.ToUpper();
- Console.WriteLine(userChoice);
- switch(userChoice)
- {
- case "GPA":
- choiceConfirm = 1;
- choice = "GPA Calculator";
- break;
- case "MONEY":
- choiceConfirm = 0;
- choice = "Money Calculator";
- break;
- default:
- Console.WriteLine("Invalid choice, reenter.");
- Console.WriteLine("=======================================");
- gorm();
- break;
- }
- confirmChoice();
- }
- static void confirmChoice()
- {
- Console.WriteLine("=======================================");
- Console.WriteLine("You chose: {0}.", choice);
- Console.WriteLine();
- Console.WriteLine("Confirm your choice Y/N:");
- Console.WriteLine("=======================================");
- confirm = Console.ReadLine();
- confirm = confirm.ToUpper();
- confirm.ToUpper();
- if (confirm == "Y")
- {
- if (choiceConfirm == 1)
- {
- gpaCalculate();
- }
- else if (choiceConfirm == 0)
- {
- moneyCalculate();
- }
- }
- else if (confirm == "N")
- {
- gorm();
- }
- else
- {
- Console.WriteLine();
- Console.WriteLine("Error: Invalid Format reenter");
- confirmChoice();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement