This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| class p739 | |
| { | |
| static void Main(string[] args) | |
| { | |
| int answer = generateQuestion(); | |
| int user = Convert.ToInt32(Console.ReadLine()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| class GuessTheNumber | |
| { | |
| public static void Main (string[] args) | |
| { | |
| //user input number | |
| int answer; | |
| bool number = true; // | |
| //Randomize numbers bein guessed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| namespace _Bar_Display{ | |
| class Program { | |
| public void Main (string[] args) { | |
| const int INPUT= 3; // setting a constant int input of 3 | |
| const string Asterisck = "*"; // setting string to display Asterisck | |
| int num; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| class Employee { | |
| public string FirstName {get; set;} //getters and setters for the values | |
| public string LastName{get, set;} | |
| private decimal Salary; | |
| public Employee(string firstName, string lastName, decimal monthlySalary) //constructor | |
| { | |
| FirstName = firstName; | |
| LastName = lastName; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| namespace p4.13 | |
| { | |
| class Program { | |
| public static void Main (string[] args) { | |
| Employee person1 = new Employee("Louise","Jones",(decimal) 25,000);// convert 25,000 to a decimal number | |
| Employee person2 = new Employee("Lourdes","Johnson", (decimal)30,000); | |
| Employee person3 = new Employee("Chloe","Smith"(decimal) 26,000); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| class p331 | |
| { | |
| static void Main(string[] args) | |
| { | |
| double height; | |
| double weight; | |
| double BMI; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| namespace Page331 | |
| class MainClass { | |
| public static void Main (string[] args) { | |
| Console.WriteLine ("Here we will calculate your BMI and let you know if there is any need for improvement");// intro for the user | |
| Console.WriteLine("Please enter your weight in lbs:"); //user input for weight | |
| int weightInPounds =int.Parse(Console.WriteLine()); | |
| Console.WriteLine("Please enter your height in inches:"); | |
| int heightInInches = int.Parse(Console.WriteLine()); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| namespace p332 | |
| { | |
| class Program | |
| { | |
| static void Main() | |
| { | |
| int miles; | |
| int gas_cost; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| class MainClass { | |
| public static void Main (string[] args) { | |
| int i; | |
| Console.WriteLine ("This app will ask the user to enter a number and then will be told if that number is even or odd."); //intro for the user | |
| Console.WriteLine("Please enter a number:"); | |
| i = int.Parse(Console.ReadLine()); | |
| if(i % 2==0) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| class Digits { | |
| public static void Main (string[] args) { | |
| int[]digits = new int[5]; | |
| Console.WriteLine ("This program is going to take in 5 digits that you enter and seperate them be three spaces");// tell the user what this program will be doing | |
| Console.WriteLine("Please enter your 5 digits:");// ask for user input | |
| int input = int.Parse(Console.ReadLine()); // store the user input as a int | |
| int i = 4; //counter | |
| while (input <= 5) | |
| { |