I have uploaded a bunch of test files for ECE 250, they may be found here. These test cases offer more thorough testing of the assigned projects.

Will be updated soon.

Will be updated soon.

The programs executable file (.exe), can be downloaded from here.

The source code can be downloaded from here.

Below are the contents of the source code file:

// -------------------------------------------------------------------	
// Department of Electrical and Computer Engineering
// University of Waterloo
//
// Student Name:      Aren Patel
// UWDIR Userid:      aspatel
//
// Assignment:        Programming Assignment 2
// Submission Date:   October 06, 2008
// 
// I declare that this program is my original work.
//
// -------------------------------------------------------------------


using System;

enum AVPosition
{
    left,
    right
};

class Speaker
{
    float resistance;
    AVPosition side;

//creates a constructor with the variables resistance and the side
    public Speaker(float pResistance, AVPosition pSide)
    {
        // To be implemented by you...
        resistance = pResistance;
        side = pSide;
    }
// when it is called it returns the resistance
    public float Resistance
    {
        get
        {
            // To be implemented by you...
            return resistance;
        }
    }
}



class SpeakerWire
{
    int gauge;
    float length;
    AVPosition side;
    float resistivity;
    float resistance;
    const float resAwg12km = 5.20f;
    const float resAwg16km = 13.17f;
    const float resAwg20km = 33.31f;

//constructor has a thickness - gauge, length and side l or r
    public SpeakerWire(int pGauge, float pLength, AVPosition pSide)
    {
        // To be implemented by you...
        gauge = pGauge;
        length = pLength;
        side = pSide;

//so that the only gauges used can be the ones that have know
//  resistivities - ie 12, 16, or 20
        if (gauge == 12)
        {
            resistivity = resAwg12km;
        }

        else if (gauge == 16)
        {
            resistivity = resAwg16km;
        }

        else if (gauge == 20)
        {
            resistivity = resAwg20km;
        }

// calculates the reistance for each seperate gauge of wire based on the
// resistivity determined from the if statements above
        resistance = resistivity * length;


    }

    public float Resistance
    {
        get
        {
            // To be implemented by you...
            return resistance;
        }
    }
}

public class Amplifier
{
    float voltage;

    public Amplifier(float pVoltage)
    {
        voltage = pVoltage;
    }

    public float Voltage
    {
        get
        {
            return voltage;
        }
    }
}

class TestProgram
{
    static void Main()
    {
        float amplifierVoltage;
        float speakerResistance;
        float wireLengthLeft;
        float wireLengthRight;

        // Prompt for AV system parameter values and instantiate the 
        // speaker and amplifier objects

        amplifierVoltage = GetAmplifierVoltage(0.0f, 1000.0f);

        speakerResistance = GetSpeakerResistance(0.0f, 20.0f);

        wireLengthLeft = GetWireLength(0.0f, 100.0f, AVPosition.left);

        wireLengthRight = GetWireLength(0.0f, 100.0f, AVPosition.right);
        
       // create objects amp1, SpeakerL, SpeakerR, with properties
       //   so they can be used 
       
        Amplifier amp1 = new Amplifier(amplifierVoltage);
        
        Speaker speakerL = new Speaker (speakerResistance, AVPosition.left);
        
        Speaker speakerR = new Speaker (speakerResistance, AVPosition.right);
        
        // Had to create a object for each guage of wire for each side
        SpeakerWire wireL12 = new SpeakerWire (12, wireLengthLeft, 
            AVPosition.left);
        
        SpeakerWire wireL16 = new SpeakerWire (16, wireLengthLeft, 
            AVPosition.left);
        
        SpeakerWire wireL20 = new SpeakerWire (20, wireLengthLeft, 
            AVPosition.left);
        
        SpeakerWire wireR12 = new SpeakerWire (12, wireLengthRight, 
            AVPosition.right);
        
        SpeakerWire wireR16 = new SpeakerWire (16, wireLengthRight, 
            AVPosition.right);
        
        SpeakerWire wireR20 = new SpeakerWire (20, wireLengthRight, 
            AVPosition.right);

        // For the amplifier, speaker and wire lengths input, compute 
        // the speaker audio power output and the power dissipated on 
        // speaker wires, for three different wire gauges, and output 
        // the values computed
        
        // Had to calculate seperately because there were seperate guages

        CalculateAndDisplayPower(amplifierVoltage, speakerResistance,
            wireL12.Resistance, wireR12.Resistance, 12);
            
        CalculateAndDisplayPower(amplifierVoltage, speakerResistance,
            wireL16.Resistance, wireR16.Resistance, 16);
            
        CalculateAndDisplayPower(amplifierVoltage, speakerResistance,
            wireL20.Resistance, wireR20.Resistance, 20);
            
    }

// restricting the domain allowed for the function of voltage
    static float GetAmplifierVoltage(float min, float max)
    {
        float voltage;

        do
        {
            Console.WriteLine("\nEnter the amplifier voltage in Volts:");
            Console.WriteLine(
                "(Real quantity -> {0} V <= voltage <= {1} V)",
                min, max);
            voltage = float.Parse(Console.ReadLine());
        } while ((voltage < min) || (voltage > max));

        return voltage;
    }

// restricting the domain allowed for the function of resistance
    static float GetSpeakerResistance(float min, float max)
    {
        float resistance;

        do
        {
            Console.WriteLine(
                "\nEnter the resistance of the speakers in Ohms:");
            Console.WriteLine(
                "(Real quantity -> {0} \u03a9 <= resistance <= {1} \u03a9)",
                min, max);
            resistance = float.Parse(Console.ReadLine());
        } while ((resistance < min) || (resistance > max));

        return resistance;
    }

// restricting the domain allowed for the function of length
    static float GetWireLength(float min, float max, AVPosition position)
    {
        // To be implemented by you...

        float length;

        do
        {
            Console.WriteLine(
                "\nEnter the length of the {0} speakers wire in metres",
                    position);
            Console.WriteLine(
                "(Real quantity -> {0} m <= resistance <= {1} m)",
                min, max);
            length = float.Parse(Console.ReadLine());
        } while ((length < min) || (length > max));

        return (length / 1000f);  // returns length in km NOT m

    }

// calculations and console output area - prints to console
    static void CalculateAndDisplayPower(
        float pAmplifierVoltage, float pSpeakerResistance,
        float pWireLeftRes, float pWireRightRes, int gauge)
    {
        // To be implemented by you...

        
        //all the given formulas are entered to make it easier for future
        //  editing
        
        float currentWireLeft = pAmplifierVoltage/(pWireLeftRes + 
                               pSpeakerResistance);

        float currentWireRight = pAmplifierVoltage/(pWireRightRes + 
                               pSpeakerResistance);


        float powerWireLeft = currentWireLeft*currentWireLeft*pWireLeftRes;
        float powerWireRight = currentWireRight*currentWireRight*pWireRightRes;


        float powerWireTotal = powerWireLeft+powerWireRight;


        float powerSpeakerLeft = currentWireLeft * currentWireLeft * 
                                pSpeakerResistance;

        float powerSpeakerRight = currentWireRight * currentWireRight * 
                                pSpeakerResistance;


        float powerSpeakerTotal = powerSpeakerLeft + powerSpeakerRight;
        
        

//print to console the gauge power of speaker and the power lost in wire

        Console.WriteLine("Gauge {0}: Speaker Output: {1:F2} W;" +
              " Wire Power Loss: {2:F2} W", gauge, powerSpeakerTotal, 
                      powerWireTotal);
        
        Console.WriteLine();  
        Console.WriteLine("Press any key to exit.");
        Console.ReadLine();
        
    }
    
    
}

The programs executable file (.exe), can be downloaded from here.

The source code can be downloaded from here.

Below are the contents of the source code file:

// -------------------------------------------------------------------	
// Department of Electrical and Computer Engineering
// University of Waterloo
//
// Student Name:      Aren Patel
// UWDIR Userid:      aspatel
//
// Assignment:        Programming Assignment 1
// Submission Date:   September 18, 2008
// 
// I declare that this program is my original work.
//
// -------------------------------------------------------------------


using System;

class PA1
{
  static void Main()
    {
                
        // Constants of resistivity that are given in ohms/km,
        //  obtained from the original information.       
        const double res14 = 8.286d;
        const double res18 = 20.95d;
        
        
        // Make blank line for space - makes the program look better.
        // Tells the user what the program is.
        // Make blank line for space - makes the program look better.
        Console.WriteLine("");
        Console.WriteLine("");
        Console.WriteLine("");
        Console.WriteLine("Calculator for the Voltage Drop in a " +
        "Length of Speaker Wire");
        Console.WriteLine("");
        
        
        // Request for user's input.
        Console.WriteLine("What is the length of the speaker " +
        "wire in metres?");
        
        
        // Takes the input, ensures it's stored as double (lengthm).
        // Takes the stored double (lengthm) coverts to km and stores
        //  as another double (lengthkm).
        // Make blank line for space - makes the program look better.
        double lengthm = double.Parse(Console.ReadLine());
        double lengthkm = lengthm/1000d;
        Console.WriteLine("");
        
        
        // Request for the user's input.
        Console.WriteLine("What is the resistance of the speaker " +
        "in Ohms?");      
        
        
        // Takes the input, ensures it's stored as double (resspeak).
        // Make blank line for space - makes the program look better.
        double resspeaker = double.Parse(Console.ReadLine());
        Console.WriteLine("");
        
        // Store to memory the resistance of 14 & 18 AWG wire,
        //  calculated by the given formula (Resistivity � Length)
        double rwire14 = lengthkm*res14;
        double rwire18 = lengthkm*res18;
        
        
        // Output to user the calculated resistance of the specified
        //  length of 14 & 18 AWG wire, round to two decimal places.
        Console.WriteLine("The resistance of {0} metres of 14 AWG " +
        "speaker wire is {1:F2} Ohms", lengthm, rwire14);
        Console.WriteLine("The resistance of {0} metres of 18 AWG " +
        "speaker wire is {1:F2} Ohms", lengthm, rwire18);
        
        
        // Make blank line for space - makes the program look better.
        Console.WriteLine("");
        
        
        // Output to user the % voltage drop of the specified length
        //  of 14 & 18 AWG wire, rounded to one decimal place.
        Console.WriteLine("The voltage drop for 14 AWG wire is " + 
        "{0:F1}%", (rwire14/(rwire14+resspeaker))*100d);
        Console.WriteLine("The voltage drop for 18 AWG wire is " + 
        "{0:F1}%", (rwire18/(rwire18+resspeaker))*100d);
        
        
        // Make blank line for space - makes the program look better.
        Console.WriteLine("");
        Console.WriteLine("");
        Console.WriteLine("");
        
    }
}