Skip to content

Instantly share code, notes, and snippets.

@M-Ramir
M-Ramir / Elimination
Created April 20, 2022 04:07
Takes in users 5 numbers, displays them side by side - if number is entered twice only one gets shown
sing System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Elimination
{
internal class Program
{
@M-Ramir
M-Ramir / Airline
Created April 20, 2022 04:05
Airline - Gives customer option for first class or second. Assigns seat, if first class is full, second class is offered - vice versa
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Airline
{
internal class Program
{
@M-Ramir
M-Ramir / CarPool
Created April 20, 2022 04:02
CarPool : Asks user a series of questions regarding their daily miles driven, cost of gas, mpg, and any parking // fees or tolls. After this the program calculates how much money you could be saving daily, monthly, and yearly if // you carpooled.
// Message to user before they enter info
// Lets them know what to expect using this program
// Puts line between message to user and prompt
Console.WriteLine("\n");
// Prompts user to input total miles driven per day
Console.WriteLine("Enter total miles driven per day : \n");
// Stores input given by user so it can be used in calculations
@M-Ramir
M-Ramir / OddOrEven
Created April 20, 2022 04:01
OddOrEven : Takes in user input, analyzes values, outputs whether the // value is odd or even.
{ // Message to user before they enter info
// Lets them know what to expect using this program
Console.WriteLine(@"
**** WELCOME TO THE ODD OR EVEN TOOL ****
*****************************************
Here you'll be asked to put in an integer
as a whole number and we'll display if***
the value is odd or even!****************
******** LETS GET STARTED! **************");
@M-Ramir
M-Ramir / Digital Parser
Last active April 20, 2022 16:53
1-DigitalParser : Prompts user to enter a number containing five digits, takes the five digit number and puts three spaces between each integer.
// Prompts user to enter a number containing five digits
Console.WriteLine("Please enter one number containing 5 digits (ex. 12345) :\n");
// Stores users input as a string
String userString = Console.ReadLine();
// Takes users string and converts it to an integer
int userNumbers= Convert.ToInt32(userString);
// Takes the users integer and picks off each digit
@M-Ramir
M-Ramir / Calculator
Created April 20, 2022 03:59
Calc - Creates A working calculator ( To be used with CalculatorGUI). Calculator does simple calculations such as addition // subtraction, multiplication, and division. Numbers can be single digit or double digit with or without decimal. // Calculator has option to clear entry, clear, or backspace depending on button used.
namespace Calc { public partial class Form1 : Form
{
// All variables set to be used in later code
// Sets string to an empty string
private string mathOperation = string.Empty;
// Sets double to 0.0
private double leftOperand = 0.0;
// Sets boolean to false
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
@M-Ramir
M-Ramir / gist:5c08caaf2a8f1cc3f71501e0c3aa0fdd
Created April 20, 2022 03:56
Economy - Gets users information and gives your miles per gallon / how eco friendly your trip was
/// This program asks users a series of questions such as name, their trip destination, /// amount of miles driven, and amount of fuel used. With this information the program /// calculates their miles per gallon and lets the user know if their trip was /// economical and if their miles per gallon was very good/good/poor.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Economic { internal class Program { static void Main(string[] args) { // Line produces an output for user. // Describes the program and information needed from user. Console.WriteLine(@" ** WELCOME TO THE ECONOMIC TRIP CALCULATOR ** ** This program will help you determine how ** ** efficient and economical your trips are!*** ********** LETS GET STARTED! ***************");