Flight Reservation Console App

Download Documentation   [code language=”csharp”] /* Mark Hesser * Nov 13, 2017 * Intro to P&L * Flight Reservation */ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.IO; namespace Flight_Reservation_Console { class Program { public static void Main(string[] args) { //Declarations //File Paths string path = Directory.GetParent(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)).FullName; if (Environment.OSVersion.Version.Major >= 6) […]

P&L Review 3

Loops Loops Allows repeated execution of a statement or block of statements (within curly braces) Types While loop – used to execute the statements 0 or more times, depending on whether the loop control condition is true or false. while (userEntry != “quit”) while (contStr == “Y”) while (counter < userCount) while (num < 999) […]

Error Handling

[code language=”csharp”] using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ErrorHandling { class Program { static void Main(string[] args) { //input problem 1 //Declarations byte value = 0; bool tryagain = true; //try loop while tryagain is true while (tryagain) { Console.Write("Enter a Number Between 0 and 255: "); try //try to […]

Programming Problems

[code language=”csharp”] /* Mark Hesser Nov 3, 2017 Intro to P&L Programming Problems */ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Programming_Problems { class Program { static void Main(string[] args) { bool Quit = false; //Declarations bool[] program = new bool[8] { true, false, false, false, false, false, false, false }; […]

Base Salary Console App

[code language=”csharp”] using System; namespace BaseSalary { class MainClass { public static void Main(string[] args) { double baseSalary; double totalSales; double commissionRate; double totalPay; string continuetemp; bool Continue = true; while (Continue) { Console.Clear(); Console.Write("Enter Your Base Salary: "); if (Double.TryParse(Console.ReadLine(), out baseSalary)) { Console.Write("Enter your total sales: "); if (Double.TryParse(Console.ReadLine(), out totalSales)) { Console.Write("Enter […]

Random Number Game Form App

[code language=”csharp”] using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; /* Mark Hesser October 17, 2017 Random Number Game Form App */ namespace Random_Number_Game { public partial class rand_num : Form { public rand_num() { InitializeComponent(); } int randNum, guess, prevGuess, tryCounter; string guessTemp; bool […]