Guess a Number Console App

[code lang=”csharp”] using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; /* Mark Hesser October 17, 2017 Guess a Number Console */ namespace GuessConsole { class Program { static void Main(string[] args) { Console.Title = "Guess a Number"; // Declarations Random rnd = new Random(); int randNum = rnd.Next(1, 100), guess, prevGuess = randNum, […]

Input Output Console App

[code language=”csharp”] using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Input_Output { class Program { static void Main(string[] args) { // Declarations string Name; string temp; int Age; double Temperature; bool goodInput; // input a string Console.Write("Please enter your name: "); Name = Console.ReadLine(); // output a string Console.WriteLine("You entered " + […]

Leap Year 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; namespace LeapYearForm { public partial class LeapYear : Form { public LeapYear() { InitializeComponent(); } static bool isLeapYear(int checkYear) { int year = checkYear; bool is_a_leap_year; if ((year % 4) == 0) { if ((year […]

Leap Year Console App

[code language=”csharp”] using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Leap_Year { class Program { static void Main(string[] args) { int Year; int loopCount = 1; bool Continue = true; string Stop; bool leapYes = false; Console.WriteLine("This program tells you if the year has a leap year" + " and tells you […]

P&L Chapter 3 Study Guide

Disadvantages of Unstructured Spaghetti Code – pg 84 – general info – unstructured programs – structured programs Understanding the Three Basic Structures – pg 86 – general info – sequence, selection, loop – details of selection structure – pg 87 – dual-alternative (then) – single-alternative – null – loop structure – pg 88 – stacking […]

Circle Console App

[code language=”csharp”] using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Circle { class Program { static void Main(string[] args) { Double Radius = 0; // Radius of a Circle Double Diameter = 0; // Calculated Diameter Double Circumference = 0; // Calculated Circumference string Continue = "yes"; // Continue? while (Continue != […]