repl.it
@kironroy/

staticclassdemo

C#

No description

fork
loading
Files
  • main.cs
  • CalculateData.cs
  • main.exe
  • Notes.txt
  • RequestData.cs
  • UserMessages.cs
main.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using System;
using System.Globalization;

namespace ConsoleUI
{
    class Program
    {
        static void Main(string[] args)
        {
            CalculateData.myAge = 40;

            string firstName = RequestData.GetAString("What is your first name: ");

            string firstNameCaps = new CultureInfo("en-US").TextInfo.ToTitleCase(firstName);

            UserMessages.ApplicationStartMessage(firstNameCaps);

            double x = RequestData.GetADouble("Please enter your first number: ");
            double y = RequestData.GetADouble("Please enter your second number: ");

            double result = CalculateData.Add(x, y);

            UserMessages.PrintResultsMessage($"The sum of {x} and {y} is {result}");

            Console.ReadLine();
        }
    }
}