Mono == C#

in college

…but that won’t stop me from gloating about my first programming written entirely with Mono and Monodevelop:


using System;

namespace wageCalc
     class MainClass
       public static void Main (string[] args)
             Console.WriteLine (“Welcome to wageCalc v1.0. All support queries and emails should go to:nntMark Grealish (”);
             Console.WriteLine (“nwageCalc takes some input about your working week and wages, and outputs yourntake home pay.”);
             Console.WriteLine(); // Blank line.

             // Grab the user’s base pay.
             Console.Write (“Enter your hourly rate of pay: “);
             double userWageBase = Convert.ToDouble(Console.ReadLine());

             // Grab the user’s hours worked this week.
             Console.Write (“Enter how many hours you have worked this week: “);
             double userHoursWorked = Convert.ToDouble(Console.ReadLine());

             // Bonus?
             Console.Write(“Enter the amount of any bonus earned this week. Enter 0 if none: “);
             double userWageBonus = Convert.ToDouble(Console.ReadLine());

             // Per our exercise instructions, the tax rate is graven in stone.
             const double TAXRATE = 0.22;

             // We have all of our facts. Now we make science.

             // First we determine the gross, overall pay…
             double userWageGross = (userWageBase * userHoursWorked) + userWageBonus;

             // …and then we tax it.
             double userWageTax = userWageGross * TAXRATE;
             double userWageNet = userWageGross – userWageTax;

             // With our science in hand, we report on their wages:
             Console.WriteLine(“tHours worked:tt{0:}”, userHoursWorked);
             Console.WriteLine(“tHourly wage:tt{0:c}”, userWageBase);
             Console.WriteLine(“tGross income:tt{0:c}”, userWageGross);
             Console.WriteLine(“tBonus earned:tt{0:c}”, userWageBonus);
             Console.WriteLine(“tHourly wage:tt{0:c}”, userWageBase);
             Console.WriteLine(“tTax rate:tt{0:p}”, TAXRATE);
             Console.WriteLine(“tTaxes paid:tt{0:c}”, userWageTax);
             Console.WriteLine(“tNet pay:tt{0:c}”, userWageNet);


in me

Your email address will not be published. Required fields are marked *