Skip to content

Instantly share code, notes, and snippets.

using System;
class p739
{
static void Main(string[] args)
{
int answer = generateQuestion();
int user = Convert.ToInt32(Console.ReadLine());
@cwake
cwake / p730
Created January 21, 2017 03:10
using System;
class GuessTheNumber
{
public static void Main (string[] args)
{
//user input number
int answer;
bool number = true; //
//Randomize numbers bein guessed
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;
@cwake
cwake / p411.cs
Last active January 21, 2017 03:18
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;
@cwake
cwake / p411test.cs
Last active January 21, 2017 02:21
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);
@cwake
cwake / p331.cs
Created January 14, 2017 05:37 — forked from tolmicl/p331.cs
using System;
class p331
{
static void Main(string[] args)
{
double height;
double weight;
double BMI;
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());
using System;
namespace p332
{
class Program
{
static void Main()
{
int miles;
int gas_cost;
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)
{
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)
{