Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // DoubleDecimalTest
- Console.WriteLine("<< DoubleDecimalTest.cs >>");
- double age = 11.5;
- Console.WriteLine(age);
- Console.WriteLine();
- // Room
- Console.WriteLine("<< Room.cs >>");
- sbyte length = 15, width = 25;
- Console.WriteLine("Length(ft): " + length);
- Console.WriteLine("Width(ft): " + width);
- Console.WriteLine("The floor space is " + length * width + " square feet.");
- Console.WriteLine();
- // Carpet
- Console.WriteLine("<< Carpet.cs >>");
- int length1 = 20, width1 = 16;
- double carpet = 7;
- Console.WriteLine("Length(ft): " + length1);
- Console.WriteLine("Width(ft): " + width1);
- Console.WriteLine("Price per square foot of carpet: " + carpet.ToString("c"));
- Console.WriteLine("The base cost of carpeting the whole room is " + ((length1 * width1) * carpet).ToString("c"));
- Console.WriteLine();
- // Yards
- Console.WriteLine("<< Yards.cs >>");
- int length2 = 25, width2 = 42;
- double carpet1 = 63;
- Console.WriteLine("Length(ft): " + length2);
- Console.WriteLine("Width(ft): " + width2);
- Console.WriteLine("Price per square yard of carpet: " + carpet1.ToString("c"));
- Console.WriteLine("The base cost of carpeting the whole room is " + (((length2 * width2) / 9) * carpet1).ToString("c"));
- Console.WriteLine();
- // HoursAndMinutes
- Console.WriteLine("<< HoursAndMinutes.cs >>");
- byte minutes = 197;
- Console.WriteLine("You have worked " + (minutes / 60) + " hours and " + (minutes % 60) + " minutes today. Good Job!");
- Console.WriteLine();
- // Eggs
- Console.WriteLine("<< Eggs.cs >>");
- sbyte c1 = 23, c2 = 35, c3 = 36, c4 = 24;
- var sum = (c1 + c2 + c3 + c4);
- Console.WriteLine("A total of " + sum + " eggs have been produced this month. That's " + (sum / 12) + " dozen and " + (sum % 12) + " eggs.");
- Console.WriteLine();
- // EggsInteractive
- Console.WriteLine("<< EggsInteractive.cs >>");
- Console.Write("Chicken 1: ");
- string c5 = Console.ReadLine();
- Console.Write("Chicken 2: ");
- string c6 = Console.ReadLine();
- Console.Write("Chicken 3: ");
- string c7 = Console.ReadLine();
- Console.Write("Chicken 4: ");
- string c8 = Console.ReadLine();
- int sum1 = (int.Parse(c5) + int.Parse(c6) + int.Parse(c7) + int.Parse(c8));
- Console.WriteLine("A total of " + sum1 + " eggs have been produced this month. That's " + (sum1 / 12) + " dozen and " + (sum1 % 12) + " eggs.");
- Console.WriteLine();
- // Tests
- Console.WriteLine("<< Tests.cs >>");
- sbyte t1 = 90, t2 = 84, t3 = 96, t4 = 91, t5 = 94;
- var avg = ((t1 + t2 + t3 + t4 + t5) / 5);
- Console.WriteLine("Average test score: " + avg);
- Console.WriteLine();
- //Payroll
- Console.WriteLine("<< Payroll.cs >>");
- Console.Write("Enter your name: ");
- string name = Console.ReadLine();
- Console.Write("Social Security Number: ");
- string ssn = Console.ReadLine();
- Console.Write("Hourly pay rate: ");
- string rate = Console.ReadLine();
- Console.Write("Hours worked: ");
- string worked = Console.ReadLine();
- Console.WriteLine("Payroll summary for: " + name);
- Console.WriteLine("SSN: " + ssn);
- Console.WriteLine("You worked " + worked + " hours at " + double.Parse(rate).ToString("c") + " per hour");
- var gross = double.Parse(rate) * double.Parse(worked);
- var fed = gross * 0.15;
- var state = gross * 0.05;
- var net = gross * 0.80;
- Console.WriteLine("Gross pay: " + gross.ToString("c"));
- Console.WriteLine("Federal withholding: " + fed.ToString("c"));
- Console.WriteLine("State withholding: " + state.ToString("c"));
- Console.WriteLine("Net pay: " + net.ToString("c"));
- Console.WriteLine();
- //PigLatin
- Console.WriteLine("<< PigLatin.cs >>");
- Console.Write("Original word: ");
- string word = Console.ReadLine();
- var letter = word.Substring(0, 1);
- var translation = word.Substring(1) + letter + "ay";
- Console.WriteLine("Translated word: " + translation);
- Console.WriteLine();
- Console.ReadLine();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement