Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- public class Program
- {
- public static void Main()
- {
- System.Console.WriteLine("Hello!\nWelcome to my first VS app!");
- System.Console.WriteLine("Please type your name (and then press enter).");
- string name = System.Console.ReadLine();
- System.Console.WriteLine("Hello " + name + "!\nHave a very nice day!");
- System.Console.WriteLine("Please type your desired salary (and then press enter).");
- string salaryStr = System.Console.ReadLine();
- float salary = float.Parse(salaryStr);
- salary *= 1.1f;
- System.Console.WriteLine("Please type your desired working day (and then press enter).");
- string workingDayStr = System.Console.ReadLine();
- eWeekDay workingDay = (eWeekDay)Enum.Parse(typeof(eWeekDay), workingDayStr);
- //string msg = "Hello " + name + "!\nYou are going to get $" + salary.ToString() + " an hour\nand you are going to work on " + workingDay.ToString() + "!\nBye bye " + name;
- /*object[] args = new string[4];
- args[0] = name;
- args[1] = salary;
- args[2] = workingDay.ToString();
- args[3] = System.Environment.NewLine;//\n for all platforms*/
- string msg = string.Format(
- @"Hello {0}!
- You are going to get {1:c} an hour
- and you are going to work on {2}!
- Bye bye {0}",
- name, salary, workingDay);
- System.Console.WriteLine(msg);
- SpeechLib.SpVoice voice = new SpeechLib.SpVoice();
- voice.Speak(msg);
- }
- public enum eWeekDay
- {
- //I define the values can be inserted in enum set
- //it let's you define for each value NAME
- //Doesn't matter the values, Sunday=12 because
- //I am not making any arithmetic operations on these enum
- //starts with 0
- Sunday,
- Monday,
- Tuesday,
- Wednsday,
- Thursday,
- Friday,
- Saturday
- //In c# you cannot add logic [methods] to enum
- }
- public class WeekDay
- {
- private eWeekDay m_Value;
- public static int m_Test;
- public bool IsWeekEnd()
- {
- return m_Value == eWeekDay.Friday;
- }
- }
- public class Test
- {
- public Test() {}
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement