Tuesday, November 25, 2014

Bank Account Lab


namespace BankersLibrary
{

Binary Number Lab



// OR (|) Turn all bits ON with an | of 1 for each bit you wish to turn on.
/// AND (&) Turn all bits OFF with an & of 0 for each bit you wish to turn off.
/// XOR (^) Toggles all bits ON or OFF depending on their current state.

Binary Number


namespace BinaryNumbersJackTalbert20NOV2014
{

Book Dictionary _ Lab


namespace Dictionary_Lab
{

The Dictionary Collections


namespace The_Dictionary_Collection
{

Queue Lab 2



namespace WorkingWithQueues_Lab
{
    public partial class Form1 : Form
    {

Queue Lab


namespace Zau_Queue_Lab_11_13_14
{

Generic Collection _ Stack


namespace Stack
{
    public partial class Form1 : Form
    {

Generic Collection _ Queue


namespace The_Queue_Collection
{

IComparable_Lab Assignment

//Lab assignment 
//==============
//Define a Person class with FirstName, LastName, DateOfBirth, Salary
//Add a default comparer to the Person class to compare by DateOfBirth
//In Form1: Create a list of Person objects
//   Add to it at least a dozen people
//Provide ListView to display all the people in the list
//Provide buttons to display all the people to sort using the default comparer
//to sort by salary
//to sort by last name / first name
//======================================================================

IComparable


namespace MyClassLab
{
    public class Account : IComparable<Account>  //Option1: This is added to compare accounts
    {

Thursday, November 6, 2014

Exception Class _Lab_11_6_2014


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

Exception Handling Class



using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

Monday, November 3, 2014

Sunday, November 2, 2014

Static Member Of A Class


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

Wednesday, October 22, 2014

Polymorphism with Rectangle Shapes_Lab


namespace Zau_Polymorphic_Rect_Lab
{
    [Serializable]
    public class Rectangle
    {

Polymorphism With Circle Shapes


namespace Polymorphic_Shapes
{
    public class Circle
    {

Thursday, October 16, 2014

Inheritance_Employee_Lab


namespace Zau_Lab_Employee
{
    [Serializable]
    public class employee
    {
        //private fields
        private string _fName;
        private string _lName;
        private string _emeId;
        private DateTime _dateHire;

Tuesday, October 14, 2014

Monday, October 13, 2014

Object Containing objects


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

Inheritance_Rectangle Shapes

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

Wednesday, October 8, 2014

Intro_To_Inheritance

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

Tuesday, October 7, 2014

HTML

<!-- Adding <optgroup> tag to the dropdown list element. this tag allows you to group your list by category
            -->
        <p>
            Adding &lt;optgroup&gt; tag to the dropdown list element. this tag allows you to group your list by category
        </p>
        <select name="cars">
            <optgroup label="Japanese Cars">
                <option value="Toyota">Toyota</option>
                <option value="Honda">Honda</option>
                <option value="Nissan">Nissan</option>
            </optgroup>
            <optgroup label="Sweedish Cars">
                <option value="Volvo">Volvo</option>
                <option value ="Saab">Saab</option>
            </optgroup>
            <optgroup label="German Cars">
                <option value="BMW">BMW</option>
                <option value="Mercedes">Mercedes</option>
                <option value="Audi">Audi</option>
            </optgroup>
            <optgroup label="American Cars">
                <option value="Ford">Ford</option>
                <option value="Chevrolet">Chevrolet</option>
            </optgroup>
        </select>
        <br /> <br />

        <textarea rows="10" cols="20" maxlength="256" wrap="soft" placeholder="Enter Comment"></textarea>

Thursday, October 2, 2014

Object Containing Other Objects


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

BinaryReadWrite_LabAssignment


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

BinaryReaderWriter


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

Tuesday, September 23, 2014

BinaryReaderWriter_Instr


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

Tuesday, June 24, 2014

C# Learning Web Links

http://www.tutorialspoint.com/csharp/
http://www.learncs.org/
http://www.microsoftvirtualacademy.com/training-courses/c-fundamentals-for-absolute-beginners
http://channel9.msdn.com/Series/C-Sharp-Fundamentals-Development-for-Absolute-Beginners
*****
http://www.homeandlearn.co.uk/csharp/csharp.html
http://www.csharp-station.com/
http://visualcsharptutorials.com/tutorials
https://www.udemy.com/learn-c-sharp-programming-in-ten-easy-steps/
http://www.csharp411.com/category/c/
http://www.learnvisualstudio.net/
http://www.learnvisualstudio.net/free/c-training/
*****
http://www.functionx.com/csharp/
http://www.freewebs.com/campelmxna/tutorials.htm
http://www.codeproject.com/?cat=3
http://msdn.microsoft.com/en-us/library/618ayhy6.aspx

Final Review (CSI-156)



Read and Find number of alphabets

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;

namespace Reading_txt_and_cs_files
{
    public partial class Form1 : Form
    {
        List<string> methodNames = new List<string>();

        public Form1()
        {
            InitializeComponent();
        }

        private void btnReadFromFile_Click(object sender, EventArgs e)
        {
            //create an open file dialog
            OpenFileDialog fdlg = new OpenFileDialog();
            fdlg.Filter = "txt files (*.txt)|*.txt|(*.cs)|*.cs";
            //display it
            DialogResult dr = fdlg.ShowDialog();
            if (dr == DialogResult.OK)
            {
                //get the selected file and display in the
                //textbox (txtFilePath)
                txtFilePath.Text = fdlg.FileName;
            }
        }

        private void btnReadFile_Click(object sender, EventArgs e)
        {
            StreamReader sr = null;
            try
            {
                //1. Open file for reading
                sr = File.OpenText(txtFilePath.Text);

                //2. Read it
                richTextBox1.Clear();
                while (!sr.EndOfStream)
                {
                    string line = sr.ReadLine();
                    richTextBox1.AppendText(line + "\n");
                    string output = CountAllChars(line);
                    richTextBox2.AppendText(output);
                }
            }
            catch (ArgumentException ae)
            {
                MessageBox.Show(ae.Message);
            }
            catch (IOException ioe)
            {
                MessageBox.Show(ioe.Message);
            }
            finally
            {
                //3. close
                if (sr != null)
                    sr.Close();
            }
        }

        static string CountAllChars(string s)
        {
            if (s == null) return null;
            if (s == "") return "";
            s = s.ToLower();
            char[] chars = s.ToCharArray();
            Array.Sort(chars);
            StringBuilder sb = new StringBuilder();
            int count = 0;
            for (int i = 0; i < chars.Length; i++)
            {
                if (chars[i] < 'a' || chars[i] > 'z') continue;
                if (sb.Length == 0)
                {
                    sb = sb.Append(chars[i]);
                    count = 1;
                }
                else if (chars[i] == chars[i - 1])
                {
                    count++;
                }
                else
                {
                    sb = sb.Append(count.ToString());
                    sb = sb.Append("\n" + chars[i]);
                    count = 1;
                }
            }
            sb = sb.Append(count.ToString());
            return sb.ToString();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            richTextBox1.Clear();
            richTextBox2.Clear();
            int ifcounter = 0;
            int forcounter = 0;
            StreamReader sr = null;
            try
            {
                sr = File.OpenText(txtFilePath.Text);
                while (!sr.EndOfStream)
                {
                    string line = sr.ReadLine();
                    richTextBox2.AppendText(line);
                    foreach (string c in line.Split())
                    {
                        if (c.Contains("if"))
                        {
                            if (true)
                            {
                                ifcounter++;
                            }
                        }
                        if (c.Contains("for"))
                        {
                            forcounter++;
                        }
                    }
                }
                richTextBox1.AppendText("Total if statement: " + ifcounter );
                richTextBox1.AppendText("\n" + "Total for loop " + forcounter );
               
            }
            catch (ArgumentException ae)
            {
                MessageBox.Show(ae.Message);
            }
            catch (IOException ioe)
            {
                MessageBox.Show(ioe.Message);
            }
            finally
            {
                if (sr != null)
                {
                    sr.Close();
                }
            }
        }

    }
}
//======================LAB ASSIGNMENT FOR MONDAY 6/16/14===========
//Write code to read a text file (.txt, .cs, or .java)
//and determine the number of occurrences of each character
//in the alphabet.
//Write code to read a .cs file and determine the number of for loops and if statements it has.
//forums.asp.net/t/1318256.aspx?Find+no+of+occurrence+of+each+character+in+a+string
//forums.asp.net/t/1608521.aspx?How+to+read+all+function+method+names+from+cs+file

Friday, June 6, 2014

Drawing Line with Class


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing; // Add to draw
using System.Threading.Tasks;

Thursday, June 5, 2014

Drawing Rectangular with Mouse


namespace Zau_DrawRectWithMouse
{
    public partial class Form1 : Form
    {
        Bitmap bmap;
        Graphics g;

Using Color Dialog


namespace MouseEvents
{
    public partial class Form1 : Form
    {
        Bitmap bmap;
        Graphics g;
        Point pOne;

Wednesday, June 4, 2014

Draw Line Between Two Points with Mouse


namespace Zau_DrawLine_Btn_Two_Point_wMouse
{
    public partial class Form1 : Form
    {
        Bitmap bmap;

Mouse Event & Draw Line


namespace MouseEvents
{
    public partial class Form1 : Form
    {
        Bitmap bmap;
        Graphics g;

Tuesday, June 3, 2014

Plotting



using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;

using System.Drawing.Drawing2D; //to use matrix

Friday, May 30, 2014

Simple Bar Graph and Pie Chart


namespace SimpleBarGraph
{
    public partial class Form1 : Form
    {

Graphics Transform


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;

//create metrix class
using System.Drawing.Drawing2D;

Mid Term Exam


//Car Class
namespace Zau_MidtermExam
{
    //Question No. 1
    public class Car
    {

Quiz 1


namespace Zau_CSI_154_QUIZ_1_1
{
    public partial class Form1 : Form
    {

Wednesday, May 21, 2014

Zau_Smiley Face Lab


namespace Zau_Smiley_Face
{
    public partial class Form1 : Form
    {