Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Developer: Drennen Dooms
- * Date: 3/28/2015
- * Purpose: To retreive the info and display it
- */
- using System;
- using System.Windows.Forms;
- namespace MonthApp
- {
- class MonthApp
- {
- static void Main()
- {
- int monthNum;
- monthNum = InputMonth();
- MonthClass newMonth = new MonthClass(monthNum);
- Console.Clear();
- Console.WriteLine(newMonth);
- Console.ReadKey();
- }
- private static void AskForReturn(out bool yes)
- {
- throw new NotImplementedException();
- }
- public static int InputMonth()
- {
- string inputValue;
- int monthNumber;
- Console.WriteLine("Please enter the month number");
- inputValue = Console.ReadLine();
- if (int.TryParse(inputValue, out monthNumber) == false)
- Console.WriteLine("Invalid entry. 0 will be recorded.");
- AskForReturn();
- return monthNumber;
- }
- public static void AskForReturn(){
- string s = Console.ReadLine();
- Console.WriteLine("Would you like to run the application again?" +
- "\nIf yes, type Y. If no, enter anything else.");
- Console.Read();
- if (s != "y" || s != "Y")
- {
- return;
- }
- else { Main(); }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement