Skip to content

Instantly share code, notes, and snippets.

View ChrisMoney's full-sized avatar

Chris Weathers ChrisMoney

  • Onevested
  • St. Louis, MO
View GitHub Profile
@ChrisMoney
ChrisMoney / pass_by_argument.cs
Created February 15, 2012 14:43
C# --Pass Value by Argument
// Pass value type arguments
using System;
namespace PassByValue
{
public class Program
{
// Update – try to modify the values of the arguments passed to it; note that you can declare
// functions in any order in a class
public static void Update(int I, double d)
@ChrisMoney
ChrisMoney / pass_functions.cs
Created February 15, 2012 14:45
C# --Passing functions
C# Program:
//Passing functions
// AverageAndDisplay
using System;
namespace Example
{
public class Program
{
@ChrisMoney
ChrisMoney / savings_account.cs
Created February 15, 2012 14:46
C# --Savings Account Console Program
// SavingsAccount
using System;
namespace SimpleSavingsAccount
{
// BankAccount – bank account which creates an account ID( which is assigned upon creation)
// and a balance
public class BankAccount // the base class
{
// bank accounts start at 1000 and increase sequentially from there
public static int nNextAccountNumber = 1000;
@ChrisMoney
ChrisMoney / shipping_program.cs
Created February 15, 2012 14:47
C# --Shipping Console Program
// PriorityQueue – demonstrates using lower-level queue collection objects
// (generic ones at that) to implement a higher-level generic queue that stores objects in priority order
using System;
using System.Collections.Generic;
namespace PriorityQueue
{
class Program
{
// Main – fill the priority queue with packages, then remove a random number of them
@ChrisMoney
ChrisMoney / sort_students.cs
Created February 15, 2012 14:47
C# --Sort Students Console Program
C# Program – Sort Students:
// Sort Students – This program demonstrates how to sort an array of objects
using System;
namespace Sort Students
{
public static void Main(string[] args)
{
// crate an array of students
Student[] = Student.NewStudent[5];
@ChrisMoney
ChrisMoney / ajax_form_validator.php
Created February 15, 2012 14:49
Ajax Form Validator
//Ajax / PHP Validator.
<?php
2. function validateName($name){
3. //if it's NOT valid
4. if(strlen($name) < 4)
5. return false;
6. //if it's valid
7. else
8. return true;
@ChrisMoney
ChrisMoney / chess_game.java
Created February 15, 2012 14:55
Java --Chess Game
//Chess Game in Java
import java.util.Scanner;
public class KnightMoves
{
static Scanner sc = new Scanner(System.in);
// the following static array represents the 8
// possible moves a knight can make
@ChrisMoney
ChrisMoney / servlet.java
Created February 15, 2012 14:56
Java Servlet
//Java Servlet
import java.io.*;
import javax.servlet.*;
import java.servlet.http.*;
import java.util.*;
public class HellowServlet extends HttpServlet
{
public void doGet(HttpServletRequest request, HttpServletResponse response)
@ChrisMoney
ChrisMoney / pizza_ordering_app.java
Last active March 11, 2023 01:05
Java --Pizza ordering application
//Pizza Order Application
import java.swing.*;
import java.aw.event.*;
import java.swing.border*;
public class Pizza extends JFrame
{
public static void main(String [ ] args)
{
new Pizza();
@ChrisMoney
ChrisMoney / 2dimensional_array.js
Created February 15, 2012 15:00
Javascript --2 Dimensional Array
// Two Dimensional Array
<html>
<body>
<SCRIPT TYPE ="text/javascript">
var personnel = new Array();
personnel[0] = new Array();