This file contains 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
// 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) |
This file contains 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
C# Program: | |
//Passing functions | |
// AverageAndDisplay | |
using System; | |
namespace Example | |
{ | |
public class Program | |
{ |
This file contains 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
// 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; |
This file contains 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
// 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 |
This file contains 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
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]; |
This file contains 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
//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; |
This file contains 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
//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 |
This file contains 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
//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) |
This file contains 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
//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(); |
This file contains 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
// Two Dimensional Array | |
<html> | |
<body> | |
<SCRIPT TYPE ="text/javascript"> | |
var personnel = new Array(); | |
personnel[0] = new Array(); |