<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1083017836179388179</id><updated>2012-02-17T01:48:09.472-08:00</updated><category term='ITC 172'/><category term='ITC226'/><category term='ITC172'/><category term='ITC285'/><category term='ITC255'/><category term='Trends'/><category term='ITC222'/><category term='ITC110'/><category term='ITC220'/><category term='ITC115'/><category term='Java'/><category term='Android'/><category term='ITC224'/><title type='text'>ITC Resources</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default?start-index=101&amp;max-results=100'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>300</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-6216308983254041271</id><published>2012-02-15T12:19:00.000-08:00</published><updated>2012-02-15T12:19:58.762-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC172'/><title type='text'>LINQ ADO and Other Stuff</title><content type='html'>&lt;p&gt;here is the code for the ListView, but remember to look at chapter 11&lt;/p&gt;&lt;hr/&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;%@ Page Language="C#" AutoEventWireup="true" &lt;br /&gt;CodeFile="Default.aspx.cs" Inherits="_Default"  &lt;br /&gt;ViewStateMode="Enabled" ViewStateEncryptionMode="Always"%&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;!DOCTYPE html &lt;br /&gt;PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" &lt;br /&gt;"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;&lt;br /&gt;&amp;lt;head runat="server"&gt;&lt;br /&gt;    &amp;lt;title&gt;&amp;lt;/title&gt;&lt;br /&gt;&amp;lt;/head&gt;&lt;br /&gt;&amp;lt;body&gt;&lt;br /&gt;    &amp;lt;form id="form1" runat="server"&gt;&lt;br /&gt;    &amp;lt;div&gt;&lt;br /&gt;    &amp;lt;table&gt;&lt;br /&gt;        &amp;lt;asp:ListView ID="ListView1" runat="server"&gt;&lt;br /&gt;         &amp;lt;ItemTemplate&gt;&lt;br /&gt;            &amp;lt;tr&gt;&lt;br /&gt;            &amp;lt;td&gt;&amp;lt;%#Eval("ServiceName")%&gt;&amp;lt;/td&gt;&lt;br /&gt;            &amp;lt;td&gt;&amp;lt;%#Eval("ServiceDescription")%&gt;&amp;lt;/td&gt;&lt;br /&gt;            &amp;lt;/tr&gt;&lt;br /&gt;        &amp;lt;/ItemTemplate&gt;&lt;br /&gt;        &amp;lt;/asp:ListView&gt;&lt;br /&gt;        &amp;lt;/table&gt;&lt;br /&gt;    &amp;lt;/div&gt;&lt;br /&gt;    &amp;lt;/form&gt;&lt;br /&gt;&amp;lt;/body&gt;&lt;br /&gt;&amp;lt;/html&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;hr/&gt;&lt;p&gt;Here is the ADO code behind for that page&lt;/p&gt;&lt;hr/&gt;&lt;pre&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Web;&lt;br /&gt;using System.Web.UI;&lt;br /&gt;using System.Web.UI.WebControls;&lt;br /&gt;using System.Data;&lt;br /&gt;using System.Data.SqlClient;&lt;br /&gt;&lt;br /&gt;public partial class _Default : System.Web.UI.Page&lt;br /&gt;{&lt;br /&gt;    protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;    {&lt;br /&gt;        SqlConnection connect = new SqlConnection&lt;br /&gt;       ("Data Source=Localhost;initial catalog=CommunityAssist;integrated security=true");&lt;br /&gt;&lt;br /&gt;        string sql = "Select ServiceName, ServiceDescription from [Service]";&lt;br /&gt;&lt;br /&gt;        SqlCommand cmd = new SqlCommand(sql, connect);&lt;br /&gt;&lt;br /&gt;        SqlDataReader reader=null;&lt;br /&gt;&lt;br /&gt;        try&lt;br /&gt;        {&lt;br /&gt;            connect.Open();&lt;br /&gt;            reader = cmd.ExecuteReader();&lt;br /&gt;            ListView1.DataSource = reader;&lt;br /&gt;            ListView1.DataBind();&lt;br /&gt;        }&lt;br /&gt;        catch (SqlException )&lt;br /&gt;        {&lt;br /&gt;            Session["error"] = "There is an error in the SQL String";&lt;br /&gt;            Response.Redirect("Default2.aspx");&lt;br /&gt;        }&lt;br /&gt;        catch (Exception)&lt;br /&gt;        {&lt;br /&gt;            Session["error"] = "Something went wrong, sorry";&lt;br /&gt;            Response.Redirect("Default2.aspx");&lt;br /&gt;        }&lt;br /&gt;        finally&lt;br /&gt;        {&lt;br /&gt;            reader.Dispose();&lt;br /&gt;            connect.Close();&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;hr/&gt;&lt;p&gt;Here is the source for the Error page&lt;/p&gt;&lt;hr/&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;%@ Page Language="C#" AutoEventWireup="true" &lt;br /&gt;CodeFile="Default2.aspx.cs" Inherits="Default2" %&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;!DOCTYPE html PUBLIC &lt;br /&gt;"-//W3C//DTD XHTML 1.0 Transitional//EN" &lt;br /&gt;"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;&lt;br /&gt;&amp;lt;head runat="server"&gt;&lt;br /&gt;    &amp;lt;title&gt;&amp;lt;/title&gt;&lt;br /&gt;&amp;lt;/head&gt;&lt;br /&gt;&amp;lt;body&gt;&lt;br /&gt;    &amp;lt;form id="form1" runat="server"&gt;&lt;br /&gt;    &amp;lt;div&gt;&lt;br /&gt;        &amp;lt;asp:Label ID="Label1" runat="server" Text="Label"&gt;&amp;lt;/asp:Label&gt;&lt;br /&gt;    &amp;lt;/div&gt;&lt;br /&gt;    &amp;lt;/form&gt;&lt;br /&gt;&amp;lt;/body&gt;&lt;br /&gt;&amp;lt;/html&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;hr/&gt;&lt;p&gt;And here is the c# from the error page&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Web;&lt;br /&gt;using System.Web.UI;&lt;br /&gt;using System.Web.UI.WebControls;&lt;br /&gt;&lt;br /&gt;public partial class Default2 : System.Web.UI.Page&lt;br /&gt;{&lt;br /&gt;    protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;    {&lt;br /&gt;        if (Session["error"] != null)&lt;br /&gt;        {&lt;br /&gt;            //Exception ex = (Exception)Session["error"];&lt;br /&gt;            //Label1.Text = ex.Message;&lt;br /&gt;            Label1.Text = Session["Error"].ToString();&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;hr /&gt;&lt;h2&gt;Linq&lt;/h2&gt;&lt;p&gt;Remember with LINQ you need to add a new a LINQ to SQL object.&lt;/p&gt;&lt;p&gt;It adds the LINQ Designer&lt;/p&gt;&lt;p&gt;From the solution explored drag tables from a connection onto the designer. This causes Visual Studio to generate classes we can access.&lt;/p&gt;&lt;p&gt;Here is the code for the Linq example&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Web;&lt;br /&gt;using System.Web.UI;&lt;br /&gt;using System.Web.UI.WebControls;&lt;br /&gt;&lt;br /&gt;public partial class _Default : System.Web.UI.Page&lt;br /&gt;{&lt;br /&gt;    protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;    {&lt;br /&gt;        try&lt;br /&gt;        {&lt;br /&gt;        CommunityAssistDataContext dc = new CommunityAssistDataContext();&lt;br /&gt;&lt;br /&gt;       &lt;br /&gt;            var donors = from d in dc.PersonContacts&lt;br /&gt;                         where d.ContactTypeKey == 6&lt;br /&gt;                         orderby d.Person.LastName&lt;br /&gt;                         select new&lt;br /&gt;                         {&lt;br /&gt;                             d.Person.LastName,&lt;br /&gt;                             d.Person.FirstName,&lt;br /&gt;                             d.ContactInfo&lt;br /&gt;                         };&lt;br /&gt;&lt;br /&gt;            GridView1.DataSource = donors.ToList();&lt;br /&gt;            GridView1.DataBind();&lt;br /&gt;        }&lt;br /&gt;        catch (Exception ex)&lt;br /&gt;        {&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-6216308983254041271?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/6216308983254041271/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2012/02/linq-ado-and-other-stuff.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/6216308983254041271'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/6216308983254041271'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2012/02/linq-ado-and-other-stuff.html' title='LINQ ADO and Other Stuff'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-2111318917088858522</id><published>2012-02-15T11:18:00.001-08:00</published><updated>2012-02-15T11:18:18.601-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC222'/><title type='text'>Functions and Simple Procedures</title><content type='html'>&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;--a simple function&lt;br /&gt;Create Function fx_cube&lt;br /&gt;(@number int) --parameter provided by the user&lt;br /&gt;returns int --what data type the function returns&lt;br /&gt;As -- function is an alias for the content below&lt;br /&gt;Begin&lt;br /&gt;--result to return&lt;br /&gt;return @number * @number * @number &lt;br /&gt;End&lt;br /&gt;&lt;br /&gt;--using the function (always needs the schema "dbo" &lt;br /&gt;--or whatever schema owns it&lt;br /&gt;Select dbo.fx_Cube(3)&lt;br /&gt;&lt;br /&gt;--using the function with a field&lt;br /&gt;Select EmployeeKey, dbo.fx_cube(EmployeeKey) From Employee&lt;br /&gt;&lt;br /&gt;/***********************&lt;br /&gt;always plot out the function or procedure first&lt;br /&gt;the function will return the price of a subscription&lt;br /&gt;parameters magid and subscriptionTypeID&lt;br /&gt;use MagazineId and SubscriptionTypeID to look up price&lt;br /&gt;********************************/&lt;br /&gt;Use MagazineSubscription &lt;br /&gt;Go&lt;br /&gt;&lt;br /&gt;Create function fx_GetSubscriptionPrice&lt;br /&gt;(@magid int, @subscriptTypeID int) --parameters&lt;br /&gt;Returns money --return type&lt;br /&gt;AS&lt;br /&gt;Begin&lt;br /&gt;Declare @Price money --internal variable&lt;br /&gt;--assign the value from a select statement&lt;br /&gt;Select @Price=SubscriptionPrice&lt;br /&gt;From MagazineDetail&lt;br /&gt;Where MagID=@MagID&lt;br /&gt;AND SubscriptTypeID=@subscriptTypeID&lt;br /&gt;Return @Price --return the value&lt;br /&gt;&lt;br /&gt;End&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Select * From Magazine&lt;br /&gt;Select * From magazineDetail where MagID=2&lt;br /&gt;&lt;br /&gt;--using the function&lt;br /&gt;Select MagName, SubscriptTypeName, &lt;br /&gt;dbo.fx_GetSubscriptionPrice(m.MagID, st.SubscriptTypeID) &lt;br /&gt;From Magazine m&lt;br /&gt;Inner Join MagazineDetail md&lt;br /&gt;on m.MagID=md.MagID&lt;br /&gt;inner join SubscriptionType st&lt;br /&gt;on st.SubscriptTypeID=md.SubscriptTypeID&lt;br /&gt;Where m.MagID=2&lt;br /&gt;&lt;br /&gt;--another way to declare and set a value&lt;br /&gt;--for a variable&lt;br /&gt;Declare @Today DateTime&lt;br /&gt;Set @Today=GETDATE()&lt;br /&gt;Select @Today&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Declare @ID int &lt;br /&gt;set @ID=@@Identity --retursn the last identity&lt;br /&gt;--created in the database&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Declare @ID2 int&lt;br /&gt;--returns the last identity created in the table&lt;br /&gt;set @ID2=IDENT_CURRENT('MagazineDetail')&lt;br /&gt;Select @ID2&lt;br /&gt;&lt;br /&gt;Select * from MagazineDetail&lt;br /&gt;&lt;br /&gt;Use CommunityAssist&lt;br /&gt;&lt;br /&gt;--simple stored procedure&lt;br /&gt;--really a parameterized view&lt;br /&gt;Create proc usp_DonorContact&lt;br /&gt;@contactType int --parameter&lt;br /&gt;As&lt;br /&gt;Select Distinct lastname [Last Name],&lt;br /&gt;Firstname [First Name],&lt;br /&gt;ContactInfo [Contact]&lt;br /&gt;From Person p&lt;br /&gt;inner join PersonContact pc&lt;br /&gt;on p.PersonKey=pc.PersonKey&lt;br /&gt;inner join Donation d&lt;br /&gt;on p.PersonKey=d.PersonKey&lt;br /&gt;Where ContactTypeKey=@ContactType&lt;br /&gt;&lt;br /&gt;--calling the procedure&lt;br /&gt;--the exec is optional&lt;br /&gt;--6 is the contact type&lt;br /&gt;Exec usp_DonorContact 6&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-2111318917088858522?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/2111318917088858522/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2012/02/functions-and-simple-procedures.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/2111318917088858522'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/2111318917088858522'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2012/02/functions-and-simple-procedures.html' title='Functions and Simple Procedures'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-6087627300128066821</id><published>2012-02-13T11:36:00.001-08:00</published><updated>2012-02-13T11:36:57.477-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC222'/><title type='text'>Indexes and Views</title><content type='html'>&lt;pre&gt;&lt;br /&gt;--views&lt;br /&gt;&lt;br /&gt;Use CommunityAssist &lt;br /&gt;&lt;br /&gt;Go&lt;br /&gt;If exists&lt;br /&gt; (Select name from sys.views&lt;br /&gt;  where name='vw_Donors')&lt;br /&gt;Begin&lt;br /&gt;Drop View vw_Donors&lt;br /&gt;end &lt;br /&gt;Go&lt;br /&gt;--create a view&lt;br /&gt;Create view vw_Donors&lt;br /&gt;As&lt;br /&gt;Select Distinct lastname [Last Name],&lt;br /&gt;Firstname [First Name],&lt;br /&gt;ContactInfo [Email]&lt;br /&gt;From Person p&lt;br /&gt;inner join PersonContact pc&lt;br /&gt;on p.PersonKey=pc.PersonKey&lt;br /&gt;inner join Donation d&lt;br /&gt;on p.PersonKey=d.PersonKey&lt;br /&gt;Where ContactTypeKey=6&lt;br /&gt;Go&lt;br /&gt;&lt;br /&gt;--use the view just like a table&lt;br /&gt;Select * from vw_Donors&lt;br /&gt; where [Last Name] Like 'Mann%' &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;--clustered index primary keys have a clustered index by default &lt;br /&gt;&lt;br /&gt;Create index ix_Lastname on Person(LastName)&lt;br /&gt;&lt;br /&gt;--Force a query to use an index&lt;br /&gt;Select * from Person with  (index(ix_LastName))&lt;br /&gt;&lt;br /&gt;--a filtered index&lt;br /&gt;Create index ix_City on PersonAddress(City)&lt;br /&gt;Where City != 'Seattle'&lt;br /&gt;&lt;br /&gt;--a unique index&lt;br /&gt;Create unique index ix_contact on PersonContact(contactInfo)&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-6087627300128066821?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/6087627300128066821/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2012/02/indexes-and-views.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/6087627300128066821'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/6087627300128066821'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2012/02/indexes-and-views.html' title='Indexes and Views'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-5628861535944970517</id><published>2012-02-12T14:27:00.000-08:00</published><updated>2012-02-12T14:27:12.708-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC222'/><title type='text'>Final Project</title><content type='html'>&lt;p&gt;The final project is based on the BitbyBitEbooks database. You will install this database and then write the SQL to answer a set of questions. You can work on this in groups of two to four people, or you can do it alone. I would suggest a group. A group often has more ideas and better ideas about how to solve certain problems.&lt;/p&gt;&lt;p&gt;First here is the ERD for the database:&lt;/p&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-FWnmBGXoqPM/TzgvErLdmpI/AAAAAAAAAYs/l4jMKqTPIV8/s1600/BitByBitERD.PNG" imageanchor="1" style=""&gt;&lt;img border="0" height="254" width="320" src="http://2.bp.blogspot.com/-FWnmBGXoqPM/TzgvErLdmpI/AAAAAAAAAYs/l4jMKqTPIV8/s320/BitByBitERD.PNG" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;Here is the code to create the database&lt;/p&gt;&lt;hr/&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;USE MASTER&lt;br /&gt;GO&lt;br /&gt;IF EXISTS&lt;br /&gt; (SELECT Name FROM sys.databases&lt;br /&gt; WHERE name='BitbyBitEBooks')&lt;br /&gt;BEGIN&lt;br /&gt;DROP DATABASE BitbyBitEBooks&lt;br /&gt;END&lt;br /&gt;GO&lt;br /&gt;CREATE DATABASE BitbyBitEbooks&lt;br /&gt;&lt;br /&gt;GO&lt;br /&gt;USE [BitbyBitEbooks]&lt;br /&gt;GO&lt;br /&gt;/****** Object:  Table [dbo].[Project]    Script Date: 02/12/2012 11:21:24 ******/&lt;br /&gt;SET ANSI_NULLS ON&lt;br /&gt;GO&lt;br /&gt;SET QUOTED_IDENTIFIER ON&lt;br /&gt;GO&lt;br /&gt;CREATE TABLE [dbo].[Project](&lt;br /&gt; [ProjectKEy] [int] IDENTITY(1,1) NOT NULL,&lt;br /&gt; [ProjectName] [nvarchar](255) NOT NULL,&lt;br /&gt; [ProjectStart] [date] NOT NULL,&lt;br /&gt; [ProjectEnd] [date] NULL,&lt;br /&gt; [ProjectDescription] [nvarchar](255) NOT NULL,&lt;br /&gt; [ProjectAdvance] [money] NULL,&lt;br /&gt; [ProjectAuthorPercent] [decimal](3, 2) NULL,&lt;br /&gt; CONSTRAINT [PK_Project] PRIMARY KEY CLUSTERED &lt;br /&gt;(&lt;br /&gt; [ProjectKEy] ASC&lt;br /&gt;)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]&lt;br /&gt;) ON [PRIMARY]&lt;br /&gt;GO&lt;br /&gt;SET IDENTITY_INSERT [dbo].[Project] ON&lt;br /&gt;INSERT [dbo].[Project] ([ProjectKEy], [ProjectName], [ProjectStart], [ProjectEnd], [ProjectDescription], [ProjectAdvance], [ProjectAuthorPercent]) VALUES (1, N'WordPress', CAST(0xED300B00 AS Date), CAST(0xCF320B00 AS Date), N'Beginning WordPress', 2000.0000, CAST(0.07 AS Decimal(3, 2)))&lt;br /&gt;INSERT [dbo].[Project] ([ProjectKEy], [ProjectName], [ProjectStart], [ProjectEnd], [ProjectDescription], [ProjectAdvance], [ProjectAuthorPercent]) VALUES (2, N'Snacks for Gamers', CAST(0x42310B00 AS Date), CAST(0x01330B00 AS Date), N'A recipe book for snacks', 800.0000, CAST(0.05 AS Decimal(3, 2)))&lt;br /&gt;INSERT [dbo].[Project] ([ProjectKEy], [ProjectName], [ProjectStart], [ProjectEnd], [ProjectDescription], [ProjectAdvance], [ProjectAuthorPercent]) VALUES (4, N'SQL Server 2008 R2', CAST(0x6F320B00 AS Date), CAST(0x8A330B00 AS Date), N'Administering SQL Server', 2500.0000, CAST(0.07 AS Decimal(3, 2)))&lt;br /&gt;INSERT [dbo].[Project] ([ProjectKEy], [ProjectName], [ProjectStart], [ProjectEnd], [ProjectDescription], [ProjectAdvance], [ProjectAuthorPercent]) VALUES (5, N'SQL', CAST(0x6E320B00 AS Date), CAST(0xE1330B00 AS Date), N'Basic SQL', 2500.0000, CAST(0.08 AS Decimal(3, 2)))&lt;br /&gt;INSERT [dbo].[Project] ([ProjectKEy], [ProjectName], [ProjectStart], [ProjectEnd], [ProjectDescription], [ProjectAdvance], [ProjectAuthorPercent]) VALUES (6, N'Java for Android', CAST(0xA6320B00 AS Date), NULL, N'Introduction to Java for Android Development', 3000.0000, CAST(0.08 AS Decimal(3, 2)))&lt;br /&gt;INSERT [dbo].[Project] ([ProjectKEy], [ProjectName], [ProjectStart], [ProjectEnd], [ProjectDescription], [ProjectAdvance], [ProjectAuthorPercent]) VALUES (7, N'WPF Development', CAST(0xC6320B00 AS Date), NULL, N'windows Presentation foundation and silverlight', 2800.0000, CAST(0.08 AS Decimal(3, 2)))&lt;br /&gt;SET IDENTITY_INSERT [dbo].[Project] OFF&lt;br /&gt;/****** Object:  Table [dbo].[Employee]    Script Date: 02/12/2012 11:21:24 ******/&lt;br /&gt;SET ANSI_NULLS ON&lt;br /&gt;GO&lt;br /&gt;SET QUOTED_IDENTIFIER ON&lt;br /&gt;GO&lt;br /&gt;CREATE TABLE [dbo].[Employee](&lt;br /&gt; [EmployeeKey] [int] IDENTITY(1,1) NOT NULL,&lt;br /&gt; [EmployeeLasName] [nvarchar](50) NOT NULL,&lt;br /&gt; [EmployeeFirstName] [nvarchar](50) NOT NULL,&lt;br /&gt; [EmployeePosition] [nvarchar](50) NOT NULL,&lt;br /&gt; [EmployeeHireDate] [date] NOT NULL,&lt;br /&gt; [EmployeeLeaveDate] [date] NULL,&lt;br /&gt; CONSTRAINT [PK_Employee] PRIMARY KEY CLUSTERED &lt;br /&gt;(&lt;br /&gt; [EmployeeKey] ASC&lt;br /&gt;)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]&lt;br /&gt;) ON [PRIMARY]&lt;br /&gt;GO&lt;br /&gt;SET IDENTITY_INSERT [dbo].[Employee] ON&lt;br /&gt;INSERT [dbo].[Employee] ([EmployeeKey], [EmployeeLasName], [EmployeeFirstName], [EmployeePosition], [EmployeeHireDate], [EmployeeLeaveDate]) VALUES (1, N'Brown', N'Paul', N'Chief Editor', CAST(0x48270B00 AS Date), NULL)&lt;br /&gt;INSERT [dbo].[Employee] ([EmployeeKey], [EmployeeLasName], [EmployeeFirstName], [EmployeePosition], [EmployeeHireDate], [EmployeeLeaveDate]) VALUES (2, N'Gardner', N'Susan', N'Copy Editor', CAST(0x48270B00 AS Date), NULL)&lt;br /&gt;INSERT [dbo].[Employee] ([EmployeeKey], [EmployeeLasName], [EmployeeFirstName], [EmployeePosition], [EmployeeHireDate], [EmployeeLeaveDate]) VALUES (3, N'West', N'Melissa', N'Design Editor', CAST(0x352A0B00 AS Date), NULL)&lt;br /&gt;INSERT [dbo].[Employee] ([EmployeeKey], [EmployeeLasName], [EmployeeFirstName], [EmployeePosition], [EmployeeHireDate], [EmployeeLeaveDate]) VALUES (4, N'Long', N'Mark', N' Design Editor', CAST(0x79280B00 AS Date), CAST(0xD9290B00 AS Date))&lt;br /&gt;INSERT [dbo].[Employee] ([EmployeeKey], [EmployeeLasName], [EmployeeFirstName], [EmployeePosition], [EmployeeHireDate], [EmployeeLeaveDate]) VALUES (5, N'Peterson', N'Fred', N'Sales Manager', CAST(0xCA290B00 AS Date), NULL)&lt;br /&gt;SET IDENTITY_INSERT [dbo].[Employee] OFF&lt;br /&gt;/****** Object:  Table [dbo].[Customer]    Script Date: 02/12/2012 11:21:24 ******/&lt;br /&gt;SET ANSI_NULLS ON&lt;br /&gt;GO&lt;br /&gt;SET QUOTED_IDENTIFIER ON&lt;br /&gt;GO&lt;br /&gt;CREATE TABLE [dbo].[Customer](&lt;br /&gt; [CustomerKey] [int] IDENTITY(1,1) NOT NULL,&lt;br /&gt; [CustomerLastName] [nvarchar](50) NULL,&lt;br /&gt; [CustomerFirstName] [nvarchar](50) NULL,&lt;br /&gt; [CustomerEmail] [nvarchar](50) NULL,&lt;br /&gt; CONSTRAINT [PK_Customer] PRIMARY KEY CLUSTERED &lt;br /&gt;(&lt;br /&gt; [CustomerKey] ASC&lt;br /&gt;)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]&lt;br /&gt;) ON [PRIMARY]&lt;br /&gt;GO&lt;br /&gt;SET IDENTITY_INSERT [dbo].[Customer] ON&lt;br /&gt;INSERT [dbo].[Customer] ([CustomerKey], [CustomerLastName], [CustomerFirstName], [CustomerEmail]) VALUES (1, N'Martin', N'Jeff', N'jMartin@yahoo.com')&lt;br /&gt;INSERT [dbo].[Customer] ([CustomerKey], [CustomerLastName], [CustomerFirstName], [CustomerEmail]) VALUES (2, N'Lawrence', N'Larry', N'll@gmail.com')&lt;br /&gt;INSERT [dbo].[Customer] ([CustomerKey], [CustomerLastName], [CustomerFirstName], [CustomerEmail]) VALUES (3, N'Towne', N'Peter', N'pTowne@msn.com')&lt;br /&gt;INSERT [dbo].[Customer] ([CustomerKey], [CustomerLastName], [CustomerFirstName], [CustomerEmail]) VALUES (4, N'Bradely', N'Susan', N'sBradely@hotmail.com')&lt;br /&gt;INSERT [dbo].[Customer] ([CustomerKey], [CustomerLastName], [CustomerFirstName], [CustomerEmail]) VALUES (5, N'Anderson', N'Laura', N'landerson@hotmail.com')&lt;br /&gt;INSERT [dbo].[Customer] ([CustomerKey], [CustomerLastName], [CustomerFirstName], [CustomerEmail]) VALUES (6, N'Harding', N'Melanie', N'mHarding@gmail.com')&lt;br /&gt;INSERT [dbo].[Customer] ([CustomerKey], [CustomerLastName], [CustomerFirstName], [CustomerEmail]) VALUES (7, N'Nelson', N'Sam', N'sNelson@harvard.edu')&lt;br /&gt;INSERT [dbo].[Customer] ([CustomerKey], [CustomerLastName], [CustomerFirstName], [CustomerEmail]) VALUES (8, N'Smith', N'Jason', N'jSmith405@yahoo.com')&lt;br /&gt;INSERT [dbo].[Customer] ([CustomerKey], [CustomerLastName], [CustomerFirstName], [CustomerEmail]) VALUES (9, N'Simpson', N'Maggie', N'mSimpson@hotmail.com')&lt;br /&gt;INSERT [dbo].[Customer] ([CustomerKey], [CustomerLastName], [CustomerFirstName], [CustomerEmail]) VALUES (10, N'Zilla ', N'God', N'godzilla@gmail.com')&lt;br /&gt;SET IDENTITY_INSERT [dbo].[Customer] OFF&lt;br /&gt;/****** Object:  Table [dbo].[Author]    Script Date: 02/12/2012 11:21:24 ******/&lt;br /&gt;SET ANSI_NULLS ON&lt;br /&gt;GO&lt;br /&gt;SET QUOTED_IDENTIFIER ON&lt;br /&gt;GO&lt;br /&gt;CREATE TABLE [dbo].[Author](&lt;br /&gt; [AuthorKey] [int] IDENTITY(1,1) NOT NULL,&lt;br /&gt; [AuthorName] [nvarchar](50) NOT NULL,&lt;br /&gt; [AuthorEmail] [nvarchar](50) NOT NULL,&lt;br /&gt; CONSTRAINT [PK_Author] PRIMARY KEY CLUSTERED &lt;br /&gt;(&lt;br /&gt; [AuthorKey] ASC&lt;br /&gt;)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]&lt;br /&gt;) ON [PRIMARY]&lt;br /&gt;GO&lt;br /&gt;SET IDENTITY_INSERT [dbo].[Author] ON&lt;br /&gt;INSERT [dbo].[Author] ([AuthorKey], [AuthorName], [AuthorEmail]) VALUES (1, N'Robert Jakobs', N'rj@hotmail.com')&lt;br /&gt;INSERT [dbo].[Author] ([AuthorKey], [AuthorName], [AuthorEmail]) VALUES (2, N'Linda Manning', N'linda@manning.com')&lt;br /&gt;INSERT [dbo].[Author] ([AuthorKey], [AuthorName], [AuthorEmail]) VALUES (3, N'Bradley Stevens', N'bradlys@yahoo.com')&lt;br /&gt;INSERT [dbo].[Author] ([AuthorKey], [AuthorName], [AuthorEmail]) VALUES (4, N'Mark Lewis', N'ml@Lewis.org')&lt;br /&gt;INSERT [dbo].[Author] ([AuthorKey], [AuthorName], [AuthorEmail]) VALUES (5, N'Tabitha King', N'King@gmail.com')&lt;br /&gt;INSERT [dbo].[Author] ([AuthorKey], [AuthorName], [AuthorEmail]) VALUES (6, N'Neil Hart', N'harttohart@msn.com')&lt;br /&gt;INSERT [dbo].[Author] ([AuthorKey], [AuthorName], [AuthorEmail]) VALUES (7, N'Melanie Dodge', N'melanie@gmail.com')&lt;br /&gt;INSERT [dbo].[Author] ([AuthorKey], [AuthorName], [AuthorEmail]) VALUES (8, N'Beth Charity', N'charity@yahoo.com')&lt;br /&gt;INSERT [dbo].[Author] ([AuthorKey], [AuthorName], [AuthorEmail]) VALUES (9, N'Gerald Norris', N'gnorris@hotmail.com')&lt;br /&gt;INSERT [dbo].[Author] ([AuthorKey], [AuthorName], [AuthorEmail]) VALUES (10, N'Abby Kingston', N'ak@kingston.net')&lt;br /&gt;SET IDENTITY_INSERT [dbo].[Author] OFF&lt;br /&gt;/****** Object:  Table [dbo].[Sale]    Script Date: 02/12/2012 11:21:24 ******/&lt;br /&gt;SET ANSI_NULLS ON&lt;br /&gt;GO&lt;br /&gt;SET QUOTED_IDENTIFIER ON&lt;br /&gt;GO&lt;br /&gt;CREATE TABLE [dbo].[Sale](&lt;br /&gt; [SaleKey] [int] IDENTITY(1,1) NOT NULL,&lt;br /&gt; [SaleDate] [date] NULL,&lt;br /&gt; [CustomerKey] [int] NULL,&lt;br /&gt; CONSTRAINT [PK_Sale] PRIMARY KEY CLUSTERED &lt;br /&gt;(&lt;br /&gt; [SaleKey] ASC&lt;br /&gt;)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]&lt;br /&gt;) ON [PRIMARY]&lt;br /&gt;GO&lt;br /&gt;SET IDENTITY_INSERT [dbo].[Sale] ON&lt;br /&gt;INSERT [dbo].[Sale] ([SaleKey], [SaleDate], [CustomerKey]) VALUES (1, CAST(0xEE320B00 AS Date), 1)&lt;br /&gt;INSERT [dbo].[Sale] ([SaleKey], [SaleDate], [CustomerKey]) VALUES (2, CAST(0xEF320B00 AS Date), 2)&lt;br /&gt;INSERT [dbo].[Sale] ([SaleKey], [SaleDate], [CustomerKey]) VALUES (3, CAST(0x20330B00 AS Date), 3)&lt;br /&gt;INSERT [dbo].[Sale] ([SaleKey], [SaleDate], [CustomerKey]) VALUES (4, CAST(0x0C330B00 AS Date), 4)&lt;br /&gt;INSERT [dbo].[Sale] ([SaleKey], [SaleDate], [CustomerKey]) VALUES (5, CAST(0x0F330B00 AS Date), 1)&lt;br /&gt;INSERT [dbo].[Sale] ([SaleKey], [SaleDate], [CustomerKey]) VALUES (6, CAST(0x2C330B00 AS Date), 5)&lt;br /&gt;INSERT [dbo].[Sale] ([SaleKey], [SaleDate], [CustomerKey]) VALUES (7, CAST(0x8A330B00 AS Date), 6)&lt;br /&gt;INSERT [dbo].[Sale] ([SaleKey], [SaleDate], [CustomerKey]) VALUES (8, CAST(0x93330B00 AS Date), 3)&lt;br /&gt;INSERT [dbo].[Sale] ([SaleKey], [SaleDate], [CustomerKey]) VALUES (9, CAST(0xDC330B00 AS Date), 7)&lt;br /&gt;INSERT [dbo].[Sale] ([SaleKey], [SaleDate], [CustomerKey]) VALUES (10, CAST(0xF6330B00 AS Date), 9)&lt;br /&gt;INSERT [dbo].[Sale] ([SaleKey], [SaleDate], [CustomerKey]) VALUES (11, CAST(0x3D340B00 AS Date), 10)&lt;br /&gt;INSERT [dbo].[Sale] ([SaleKey], [SaleDate], [CustomerKey]) VALUES (12, CAST(0x3F340B00 AS Date), 3)&lt;br /&gt;SET IDENTITY_INSERT [dbo].[Sale] OFF&lt;br /&gt;/****** Object:  Table [dbo].[ProjectDetail]    Script Date: 02/12/2012 11:21:24 ******/&lt;br /&gt;SET ANSI_NULLS ON&lt;br /&gt;GO&lt;br /&gt;SET QUOTED_IDENTIFIER ON&lt;br /&gt;GO&lt;br /&gt;CREATE TABLE [dbo].[ProjectDetail](&lt;br /&gt; [ProjectDetailKey] [int] IDENTITY(1,1) NOT NULL,&lt;br /&gt; [ProjectKey] [int] NOT NULL,&lt;br /&gt; [ProjectTask] [nvarchar](50) NOT NULL,&lt;br /&gt; [EmployeeKey] [int] NOT NULL,&lt;br /&gt; [ProjectChargedAmount] [money] NULL,&lt;br /&gt; [Notes] [nvarchar](max) NULL,&lt;br /&gt; [ProjectDetailDate] [date] NULL,&lt;br /&gt; CONSTRAINT [PK_ProjectDetail] PRIMARY KEY CLUSTERED &lt;br /&gt;(&lt;br /&gt; [ProjectDetailKey] ASC&lt;br /&gt;)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]&lt;br /&gt;) ON [PRIMARY]&lt;br /&gt;GO&lt;br /&gt;SET IDENTITY_INSERT [dbo].[ProjectDetail] ON&lt;br /&gt;INSERT [dbo].[ProjectDetail] ([ProjectDetailKey], [ProjectKey], [ProjectTask], [EmployeeKey], [ProjectChargedAmount], [Notes], [ProjectDetailDate]) VALUES (1, 1, N'Initial Review and Contract', 1, 300.0000, N'lunch and contract', CAST(0xED300B00 AS Date))&lt;br /&gt;INSERT [dbo].[ProjectDetail] ([ProjectDetailKey], [ProjectKey], [ProjectTask], [EmployeeKey], [ProjectChargedAmount], [Notes], [ProjectDetailDate]) VALUES (3, 1, N'First outline', 2, 150.0000, N'reviewed outline with author', CAST(0x07310B00 AS Date))&lt;br /&gt;INSERT [dbo].[ProjectDetail] ([ProjectDetailKey], [ProjectKey], [ProjectTask], [EmployeeKey], [ProjectChargedAmount], [Notes], [ProjectDetailDate]) VALUES (4, 2, N'Conceptual meeting', 1, 200.0000, N'reviewed outline and concpt', CAST(0x64310B00 AS Date))&lt;br /&gt;INSERT [dbo].[ProjectDetail] ([ProjectDetailKey], [ProjectKey], [ProjectTask], [EmployeeKey], [ProjectChargedAmount], [Notes], [ProjectDetailDate]) VALUES (5, 4, N'Initial review', 1, 120.0000, NULL, CAST(0xCD320B00 AS Date))&lt;br /&gt;INSERT [dbo].[ProjectDetail] ([ProjectDetailKey], [ProjectKey], [ProjectTask], [EmployeeKey], [ProjectChargedAmount], [Notes], [ProjectDetailDate]) VALUES (6, 5, N'Initial Review', 1, 130.0000, N'Included dinner', CAST(0xAB320B00 AS Date))&lt;br /&gt;INSERT [dbo].[ProjectDetail] ([ProjectDetailKey], [ProjectKey], [ProjectTask], [EmployeeKey], [ProjectChargedAmount], [Notes], [ProjectDetailDate]) VALUES (7, 1, N'Design review', 3, 85.0000, N'Discuss design Options', CAST(0x59310B00 AS Date))&lt;br /&gt;INSERT [dbo].[ProjectDetail] ([ProjectDetailKey], [ProjectKey], [ProjectTask], [EmployeeKey], [ProjectChargedAmount], [Notes], [ProjectDetailDate]) VALUES (8, 2, N'Copy Editing', 2, 1200.0000, N'editing text', CAST(0x5F320B00 AS Date))&lt;br /&gt;INSERT [dbo].[ProjectDetail] ([ProjectDetailKey], [ProjectKey], [ProjectTask], [EmployeeKey], [ProjectChargedAmount], [Notes], [ProjectDetailDate]) VALUES (9, 1, N'Copy Editing', 2, 500.0000, NULL, CAST(0x6F320B00 AS Date))&lt;br /&gt;INSERT [dbo].[ProjectDetail] ([ProjectDetailKey], [ProjectKey], [ProjectTask], [EmployeeKey], [ProjectChargedAmount], [Notes], [ProjectDetailDate]) VALUES (10, 4, N'Design Review', 4, 120.0000, N'Reviewed Layout', CAST(0x91320B00 AS Date))&lt;br /&gt;INSERT [dbo].[ProjectDetail] ([ProjectDetailKey], [ProjectKey], [ProjectTask], [EmployeeKey], [ProjectChargedAmount], [Notes], [ProjectDetailDate]) VALUES (11, 1, N'Sales Plan', 5, 100.0000, N'Discussed price and sales plan', CAST(0xB7320B00 AS Date))&lt;br /&gt;INSERT [dbo].[ProjectDetail] ([ProjectDetailKey], [ProjectKey], [ProjectTask], [EmployeeKey], [ProjectChargedAmount], [Notes], [ProjectDetailDate]) VALUES (12, 5, N'Copy editing', 2, 400.0000, NULL, CAST(0xB9320B00 AS Date))&lt;br /&gt;INSERT [dbo].[ProjectDetail] ([ProjectDetailKey], [ProjectKey], [ProjectTask], [EmployeeKey], [ProjectChargedAmount], [Notes], [ProjectDetailDate]) VALUES (13, 5, N'Design Review', 4, 450.0000, N'Included hotel', CAST(0xC6320B00 AS Date))&lt;br /&gt;INSERT [dbo].[ProjectDetail] ([ProjectDetailKey], [ProjectKey], [ProjectTask], [EmployeeKey], [ProjectChargedAmount], [Notes], [ProjectDetailDate]) VALUES (14, 6, N'Initial Review', 1, 300.0000, NULL, CAST(0xC6320B00 AS Date))&lt;br /&gt;INSERT [dbo].[ProjectDetail] ([ProjectDetailKey], [ProjectKey], [ProjectTask], [EmployeeKey], [ProjectChargedAmount], [Notes], [ProjectDetailDate]) VALUES (15, 7, N'Initial Review', 1, 250.0000, N'Lunch and contract', CAST(0xD2320B00 AS Date))&lt;br /&gt;INSERT [dbo].[ProjectDetail] ([ProjectDetailKey], [ProjectKey], [ProjectTask], [EmployeeKey], [ProjectChargedAmount], [Notes], [ProjectDetailDate]) VALUES (16, 2, N'Design Review', 3, 450.0000, NULL, CAST(0xCD320B00 AS Date))&lt;br /&gt;INSERT [dbo].[ProjectDetail] ([ProjectDetailKey], [ProjectKey], [ProjectTask], [EmployeeKey], [ProjectChargedAmount], [Notes], [ProjectDetailDate]) VALUES (17, 4, N'Sales Plan', 4, 200.0000, NULL, CAST(0xCE320B00 AS Date))&lt;br /&gt;SET IDENTITY_INSERT [dbo].[ProjectDetail] OFF&lt;br /&gt;/****** Object:  Table [dbo].[ProjectAuthor]    Script Date: 02/12/2012 11:21:24 ******/&lt;br /&gt;SET ANSI_NULLS ON&lt;br /&gt;GO&lt;br /&gt;SET QUOTED_IDENTIFIER ON&lt;br /&gt;GO&lt;br /&gt;CREATE TABLE [dbo].[ProjectAuthor](&lt;br /&gt; [AuthorKey] [int] NOT NULL,&lt;br /&gt; [ProjectKey] [int] NOT NULL,&lt;br /&gt; CONSTRAINT [PK_ProjectAuthor] PRIMARY KEY CLUSTERED &lt;br /&gt;(&lt;br /&gt; [AuthorKey] ASC,&lt;br /&gt; [ProjectKey] ASC&lt;br /&gt;)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]&lt;br /&gt;) ON [PRIMARY]&lt;br /&gt;GO&lt;br /&gt;INSERT [dbo].[ProjectAuthor] ([AuthorKey], [ProjectKey]) VALUES (1, 1)&lt;br /&gt;INSERT [dbo].[ProjectAuthor] ([AuthorKey], [ProjectKey]) VALUES (2, 2)&lt;br /&gt;INSERT [dbo].[ProjectAuthor] ([AuthorKey], [ProjectKey]) VALUES (3, 2)&lt;br /&gt;INSERT [dbo].[ProjectAuthor] ([AuthorKey], [ProjectKey]) VALUES (4, 4)&lt;br /&gt;INSERT [dbo].[ProjectAuthor] ([AuthorKey], [ProjectKey]) VALUES (5, 4)&lt;br /&gt;INSERT [dbo].[ProjectAuthor] ([AuthorKey], [ProjectKey]) VALUES (6, 4)&lt;br /&gt;INSERT [dbo].[ProjectAuthor] ([AuthorKey], [ProjectKey]) VALUES (7, 5)&lt;br /&gt;INSERT [dbo].[ProjectAuthor] ([AuthorKey], [ProjectKey]) VALUES (8, 6)&lt;br /&gt;INSERT [dbo].[ProjectAuthor] ([AuthorKey], [ProjectKey]) VALUES (9, 7)&lt;br /&gt;INSERT [dbo].[ProjectAuthor] ([AuthorKey], [ProjectKey]) VALUES (10, 7)&lt;br /&gt;/****** Object:  Table [dbo].[EBook]    Script Date: 02/12/2012 11:21:24 ******/&lt;br /&gt;SET ANSI_NULLS ON&lt;br /&gt;GO&lt;br /&gt;SET QUOTED_IDENTIFIER ON&lt;br /&gt;GO&lt;br /&gt;CREATE TABLE [dbo].[EBook](&lt;br /&gt; [EBookKey] [int] IDENTITY(1,1) NOT NULL,&lt;br /&gt; [EbookTitle] [nvarchar](255) NOT NULL,&lt;br /&gt; [EbookPrice] [money] NOT NULL,&lt;br /&gt; [EbookDescription] [nvarchar](255) NOT NULL,&lt;br /&gt; [ProjectKey] [int] NOT NULL,&lt;br /&gt; CONSTRAINT [PK_EBook] PRIMARY KEY CLUSTERED &lt;br /&gt;(&lt;br /&gt; [EBookKey] ASC&lt;br /&gt;)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]&lt;br /&gt;) ON [PRIMARY]&lt;br /&gt;GO&lt;br /&gt;SET IDENTITY_INSERT [dbo].[EBook] ON&lt;br /&gt;INSERT [dbo].[EBook] ([EBookKey], [EbookTitle], [EbookPrice], [EbookDescription], [ProjectKey]) VALUES (1, N'Wordpress Made Easy', 33.5000, N'All you need to know to get started with word Press', 1)&lt;br /&gt;INSERT [dbo].[EBook] ([EBookKey], [EbookTitle], [EbookPrice], [EbookDescription], [ProjectKey]) VALUES (2, N'Snacks for Gamers', 15.7000, N'How to keep from dying of malnutrition while beating Halo', 2)&lt;br /&gt;INSERT [dbo].[EBook] ([EBookKey], [EbookTitle], [EbookPrice], [EbookDescription], [ProjectKey]) VALUES (3, N'SQL Server 2008 R2', 65.5000, N'A complete guide ', 4)&lt;br /&gt;INSERT [dbo].[EBook] ([EBookKey], [EbookTitle], [EbookPrice], [EbookDescription], [ProjectKey]) VALUES (4, N'SQL', 35.7500, N'All the SQL you will ever need to know', 5)&lt;br /&gt;SET IDENTITY_INSERT [dbo].[EBook] OFF&lt;br /&gt;/****** Object:  Table [dbo].[SaleDetail]    Script Date: 02/12/2012 11:21:24 ******/&lt;br /&gt;SET ANSI_NULLS ON&lt;br /&gt;GO&lt;br /&gt;SET QUOTED_IDENTIFIER ON&lt;br /&gt;GO&lt;br /&gt;CREATE TABLE [dbo].[SaleDetail](&lt;br /&gt; [SaleDetailKey] [int] IDENTITY(1,1) NOT NULL,&lt;br /&gt; [SaleKey] [int] NULL,&lt;br /&gt; [EbookKey] [int] NULL,&lt;br /&gt; [Quantity] [int] NULL,&lt;br /&gt; [Discount] [decimal](3, 2) NULL,&lt;br /&gt; CONSTRAINT [PK_SaleDetail] PRIMARY KEY CLUSTERED &lt;br /&gt;(&lt;br /&gt; [SaleDetailKey] ASC&lt;br /&gt;)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]&lt;br /&gt;) ON [PRIMARY]&lt;br /&gt;GO&lt;br /&gt;SET IDENTITY_INSERT [dbo].[SaleDetail] ON&lt;br /&gt;INSERT [dbo].[SaleDetail] ([SaleDetailKey], [SaleKey], [EbookKey], [Quantity], [Discount]) VALUES (1, 1, 1, 3, NULL)&lt;br /&gt;INSERT [dbo].[SaleDetail] ([SaleDetailKey], [SaleKey], [EbookKey], [Quantity], [Discount]) VALUES (2, 2, 1, 1, NULL)&lt;br /&gt;INSERT [dbo].[SaleDetail] ([SaleDetailKey], [SaleKey], [EbookKey], [Quantity], [Discount]) VALUES (3, 3, 1, 30, CAST(0.05 AS Decimal(3, 2)))&lt;br /&gt;INSERT [dbo].[SaleDetail] ([SaleDetailKey], [SaleKey], [EbookKey], [Quantity], [Discount]) VALUES (4, 4, 1, 5, NULL)&lt;br /&gt;INSERT [dbo].[SaleDetail] ([SaleDetailKey], [SaleKey], [EbookKey], [Quantity], [Discount]) VALUES (5, 4, 2, 1, NULL)&lt;br /&gt;INSERT [dbo].[SaleDetail] ([SaleDetailKey], [SaleKey], [EbookKey], [Quantity], [Discount]) VALUES (6, 5, 2, 1, NULL)&lt;br /&gt;INSERT [dbo].[SaleDetail] ([SaleDetailKey], [SaleKey], [EbookKey], [Quantity], [Discount]) VALUES (7, 6, 1, 15, CAST(0.05 AS Decimal(3, 2)))&lt;br /&gt;INSERT [dbo].[SaleDetail] ([SaleDetailKey], [SaleKey], [EbookKey], [Quantity], [Discount]) VALUES (8, 7, 4, 1, NULL)&lt;br /&gt;INSERT [dbo].[SaleDetail] ([SaleDetailKey], [SaleKey], [EbookKey], [Quantity], [Discount]) VALUES (9, 8, 4, 25, CAST(0.05 AS Decimal(3, 2)))&lt;br /&gt;INSERT [dbo].[SaleDetail] ([SaleDetailKey], [SaleKey], [EbookKey], [Quantity], [Discount]) VALUES (10, 8, 1, 20, CAST(0.05 AS Decimal(3, 2)))&lt;br /&gt;INSERT [dbo].[SaleDetail] ([SaleDetailKey], [SaleKey], [EbookKey], [Quantity], [Discount]) VALUES (11, 9, 2, 5, CAST(0.03 AS Decimal(3, 2)))&lt;br /&gt;INSERT [dbo].[SaleDetail] ([SaleDetailKey], [SaleKey], [EbookKey], [Quantity], [Discount]) VALUES (12, 9, 1, 1, NULL)&lt;br /&gt;INSERT [dbo].[SaleDetail] ([SaleDetailKey], [SaleKey], [EbookKey], [Quantity], [Discount]) VALUES (15, 10, 4, 20, CAST(0.05 AS Decimal(3, 2)))&lt;br /&gt;INSERT [dbo].[SaleDetail] ([SaleDetailKey], [SaleKey], [EbookKey], [Quantity], [Discount]) VALUES (16, 10, 1, 20, CAST(0.05 AS Decimal(3, 2)))&lt;br /&gt;INSERT [dbo].[SaleDetail] ([SaleDetailKey], [SaleKey], [EbookKey], [Quantity], [Discount]) VALUES (17, 10, 2, 1, NULL)&lt;br /&gt;INSERT [dbo].[SaleDetail] ([SaleDetailKey], [SaleKey], [EbookKey], [Quantity], [Discount]) VALUES (18, 11, 3, 2, NULL)&lt;br /&gt;INSERT [dbo].[SaleDetail] ([SaleDetailKey], [SaleKey], [EbookKey], [Quantity], [Discount]) VALUES (19, 12, 3, 30, CAST(0.05 AS Decimal(3, 2)))&lt;br /&gt;INSERT [dbo].[SaleDetail] ([SaleDetailKey], [SaleKey], [EbookKey], [Quantity], [Discount]) VALUES (20, 12, 1, 25, CAST(0.05 AS Decimal(3, 2)))&lt;br /&gt;SET IDENTITY_INSERT [dbo].[SaleDetail] OFF&lt;br /&gt;/****** Object:  ForeignKey [FK_EBook_Project]    Script Date: 02/12/2012 11:21:24 ******/&lt;br /&gt;ALTER TABLE [dbo].[EBook]  WITH CHECK ADD  CONSTRAINT [FK_EBook_Project] FOREIGN KEY([ProjectKey])&lt;br /&gt;REFERENCES [dbo].[Project] ([ProjectKEy])&lt;br /&gt;GO&lt;br /&gt;ALTER TABLE [dbo].[EBook] CHECK CONSTRAINT [FK_EBook_Project]&lt;br /&gt;GO&lt;br /&gt;/****** Object:  ForeignKey [FK_ProjectAuthor_Author]    Script Date: 02/12/2012 11:21:24 ******/&lt;br /&gt;ALTER TABLE [dbo].[ProjectAuthor]  WITH CHECK ADD  CONSTRAINT [FK_ProjectAuthor_Author] FOREIGN KEY([AuthorKey])&lt;br /&gt;REFERENCES [dbo].[Author] ([AuthorKey])&lt;br /&gt;GO&lt;br /&gt;ALTER TABLE [dbo].[ProjectAuthor] CHECK CONSTRAINT [FK_ProjectAuthor_Author]&lt;br /&gt;GO&lt;br /&gt;/****** Object:  ForeignKey [FK_ProjectAuthor_Project]    Script Date: 02/12/2012 11:21:24 ******/&lt;br /&gt;ALTER TABLE [dbo].[ProjectAuthor]  WITH CHECK ADD  CONSTRAINT [FK_ProjectAuthor_Project] FOREIGN KEY([ProjectKey])&lt;br /&gt;REFERENCES [dbo].[Project] ([ProjectKEy])&lt;br /&gt;GO&lt;br /&gt;ALTER TABLE [dbo].[ProjectAuthor] CHECK CONSTRAINT [FK_ProjectAuthor_Project]&lt;br /&gt;GO&lt;br /&gt;/****** Object:  ForeignKey [FK_ProjectDetail_Employee]    Script Date: 02/12/2012 11:21:24 ******/&lt;br /&gt;ALTER TABLE [dbo].[ProjectDetail]  WITH CHECK ADD  CONSTRAINT [FK_ProjectDetail_Employee] FOREIGN KEY([EmployeeKey])&lt;br /&gt;REFERENCES [dbo].[Employee] ([EmployeeKey])&lt;br /&gt;GO&lt;br /&gt;ALTER TABLE [dbo].[ProjectDetail] CHECK CONSTRAINT [FK_ProjectDetail_Employee]&lt;br /&gt;GO&lt;br /&gt;/****** Object:  ForeignKey [FK_ProjectDetail_Project]    Script Date: 02/12/2012 11:21:24 ******/&lt;br /&gt;ALTER TABLE [dbo].[ProjectDetail]  WITH CHECK ADD  CONSTRAINT [FK_ProjectDetail_Project] FOREIGN KEY([ProjectKey])&lt;br /&gt;REFERENCES [dbo].[Project] ([ProjectKEy])&lt;br /&gt;GO&lt;br /&gt;ALTER TABLE [dbo].[ProjectDetail] CHECK CONSTRAINT [FK_ProjectDetail_Project]&lt;br /&gt;GO&lt;br /&gt;/****** Object:  ForeignKey [FK_Sale_Customer]    Script Date: 02/12/2012 11:21:24 ******/&lt;br /&gt;ALTER TABLE [dbo].[Sale]  WITH CHECK ADD  CONSTRAINT [FK_Sale_Customer] FOREIGN KEY([CustomerKey])&lt;br /&gt;REFERENCES [dbo].[Customer] ([CustomerKey])&lt;br /&gt;GO&lt;br /&gt;ALTER TABLE [dbo].[Sale] CHECK CONSTRAINT [FK_Sale_Customer]&lt;br /&gt;GO&lt;br /&gt;/****** Object:  ForeignKey [FK_SaleDetail_EBook]    Script Date: 02/12/2012 11:21:24 ******/&lt;br /&gt;ALTER TABLE [dbo].[SaleDetail]  WITH CHECK ADD  CONSTRAINT [FK_SaleDetail_EBook] FOREIGN KEY([EbookKey])&lt;br /&gt;REFERENCES [dbo].[EBook] ([EBookKey])&lt;br /&gt;GO&lt;br /&gt;ALTER TABLE [dbo].[SaleDetail] CHECK CONSTRAINT [FK_SaleDetail_EBook]&lt;br /&gt;GO&lt;br /&gt;/****** Object:  ForeignKey [FK_SaleDetail_Sale]    Script Date: 02/12/2012 11:21:24 ******/&lt;br /&gt;ALTER TABLE [dbo].[SaleDetail]  WITH CHECK ADD  CONSTRAINT [FK_SaleDetail_Sale] FOREIGN KEY([SaleKey])&lt;br /&gt;REFERENCES [dbo].[Sale] ([SaleKey])&lt;br /&gt;GO&lt;br /&gt;ALTER TABLE [dbo].[SaleDetail] CHECK CONSTRAINT [FK_SaleDetail_Sale]&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;hr/&gt;&lt;h2&gt;The questions&lt;/h2&gt;&lt;p&gt;Create a view that shows the ebook title, its author(s) and its price.&lt;/p&gt;&lt;p&gt;What was the total cost of producing the book Wordpess made easy?"&lt;/p&gt;&lt;p&gt;What, if any, royalties are due the author Robert Jacobs? Royalties are based on the author's percent of sales, but all advances must be paid back before they receive any additional money). (&lt;/p&gt;&lt;p&gt;What is the average time in months for a project from start date to completion?&lt;/p&gt;&lt;p&gt;Are there any customers who have never purchased a book? If there are, delete that customer&lt;/p&gt;&lt;p&gt;Increase the price of the ebook "Snacks for Gamers" by 3%.&lt;/p&gt;&lt;p&gt;How many copies of the ebook "SQL Server 2008 R2" have been sold?&lt;/p&gt;&lt;p&gt;What is the average charge for services by the editorial staff?&lt;/p&gt;&lt;p&gt;what is the total charged by each editor?&lt;/p&gt;&lt;p&gt;Which employees have charged more than 1000 dollars total?&lt;/p&gt;&lt;p&gt;Add a new customer and a purchase to the database.&lt;/p&gt;&lt;p&gt;Create a function that can be used to determine the total amount for a sale detail.&lt;/p&gt;&lt;p&gt;Create a stored procedure that takes the sale key for a parameter and returns a reciept with the sale information, the details and totals.&lt;/p&gt;&lt;p&gt;It is a business rule of the database that any sale item with a quantity of 15 or above gets a 5% discount. Create a trigger to enforce this.&lt;/p&gt;&lt;p&gt;add a table that is a child to project. Its purpose is to record meetings among the staff concerning project status. The table should have an identity for a key, a date and a topic line, and an xml column with this structure. Below is an example of the xml document and a schema for it. Before creating the table create a new schema collection to validate the xml field.&lt;/p&gt;&lt;hr/&gt;&lt;p&gt;The xml document&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&gt;&lt;br /&gt;&amp;lt;meeting xmlns="http://www.BitbyBitEbooks.com/meeting"&gt;&lt;br /&gt; &amp;lt;head&gt;&lt;br /&gt;  &amp;lt;present&gt;Brown&amp;lt;/present&gt;&lt;br /&gt;  &amp;lt;present&gt;Garner&amp;lt;/present&gt;&lt;br /&gt;  &amp;lt;present&gt;Peterson&amp;lt;/present&gt;&lt;br /&gt; &amp;lt;/head&gt;&lt;br /&gt; &amp;lt;body&gt;&lt;br /&gt;  &amp;lt;discussion&gt;&lt;br /&gt;   The book has a lot of grammatical and writing errors. &lt;br /&gt;   It is going to take work and time to clear them&lt;br /&gt;   up.&lt;br /&gt;  &amp;lt;/discussion&gt;&lt;br /&gt;  &amp;lt;issues&gt;&lt;br /&gt;   &amp;lt;issue&gt;Grammatical Errors&amp;lt;/issue&gt;&lt;br /&gt;   &amp;lt;issue&gt;timeLine&amp;lt;/issue&gt;&lt;br /&gt;  &amp;lt;/issues&gt;&lt;br /&gt;  &amp;lt;tasks&gt;&lt;br /&gt;   &amp;lt;task&gt;contact author&amp;lt;/task&gt;&lt;br /&gt;   &amp;lt;task&gt;Revise timeline&amp;lt;/task&gt;&lt;br /&gt;  &amp;lt;/tasks&gt;&lt;br /&gt; &amp;lt;/body&gt;&lt;br /&gt; &lt;br /&gt;&amp;lt;/meeting&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;hr/&gt;&lt;p&gt;The schema&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&gt;&lt;br /&gt;&amp;lt;xs:schema attributeFormDefault="unqualified" &lt;br /&gt;elementFormDefault="qualified" &lt;br /&gt;targetNamespace="http://www.BitbyBitEbooks.com/meeting" &lt;br /&gt;xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;&lt;br /&gt;&amp;lt;xs:element name="meeting"&gt;&lt;br /&gt;&amp;lt;xs:complexType&gt;&lt;br /&gt;&amp;lt;xs:sequence&gt;&lt;br /&gt;&amp;lt;xs:element name="head"&gt;&lt;br /&gt;&amp;lt;xs:complexType&gt;&lt;br /&gt;&amp;lt;xs:sequence&gt;&lt;br /&gt;&amp;lt;xs:element maxOccurs="unbounded" &lt;br /&gt;name="present" type="xs:string" /&gt;&lt;br /&gt;&amp;lt;/xs:sequence&gt;&lt;br /&gt;&amp;lt;/xs:complexType&gt;&lt;br /&gt;&amp;lt;/xs:element&gt;&lt;br /&gt;&amp;lt;xs:element name="body"&gt;&lt;br /&gt;&amp;lt;xs:complexType&gt;&lt;br /&gt;&amp;lt;xs:sequence&gt;&lt;br /&gt;&amp;lt;xs:element name="discussion" type="xs:string" /&gt;&lt;br /&gt;&amp;lt;xs:element name="issues"&gt;&lt;br /&gt;&amp;lt;xs:complexType&gt;&lt;br /&gt;&amp;lt;xs:sequence&gt;&lt;br /&gt;&amp;lt;xs:element maxOccurs="unbounded" name="issue" type="xs:string" /&gt;&lt;br /&gt;&amp;lt;/xs:sequence&gt;&lt;br /&gt;&amp;lt;/xs:complexType&gt;&lt;br /&gt;&amp;lt;/xs:element&gt;&lt;br /&gt;&amp;lt;xs:element name="tasks"&gt;&lt;br /&gt;&amp;lt;xs:complexType&gt;&lt;br /&gt;&amp;lt;xs:sequence&gt;&lt;br /&gt;&amp;lt;xs:element maxOccurs="unbounded" name="task" type="xs:string" /&gt;&lt;br /&gt;&amp;lt;/xs:sequence&gt;&lt;br /&gt;&amp;lt;/xs:complexType&gt;&lt;br /&gt;&amp;lt;/xs:element&gt;&lt;br /&gt;&amp;lt;/xs:sequence&gt;&lt;br /&gt;&amp;lt;/xs:complexType&gt;&lt;br /&gt;&amp;lt;/xs:element&gt;&lt;br /&gt;&amp;lt;/xs:sequence&gt;&lt;br /&gt;&amp;lt;/xs:complexType&gt;&lt;br /&gt;&amp;lt;/xs:element&gt;&lt;br /&gt;&amp;lt;/xs:schema&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/hr&gt;&lt;p&gt;Make a login and role for authors.&lt;/p&gt;&lt;p&gt;Create an Author role. authors should be able see projects, but not project details. They should be able to see the list of ebooks, and sale and sale detail information. But they shouldn't be able to add or change anything. Add the author user to the role.&lt;/p&gt;&lt;hr/&gt;&lt;h2&gt;What I am looking for&lt;/h2&gt;&lt;p&gt;The project is worth 50 points. I want to see the SQL that would answer the question or complete the request(as in stored procedures and functions.) There are about 20 separate tasks, so each task is worth about 2 points with 10 points assigned to the more difficult tasks such as the stored procedure and trigger.&lt;/p&gt;&lt;p&gt;the questions do no have to be done in the order listed. Just let me know which one the code is for. &lt;/p&gt;p&gt;If you worked on this as a group, you only need to turn in one copy for the whole group. Just be sure to include all the names on the document.&lt;/p&gt;&lt;hr/&gt;&lt;h2&gt;To turn in&lt;/h2&gt;&lt;p&gt;as always paste all the code and questions into a Google doc and share it with spconger@gmail.com&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-5628861535944970517?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/5628861535944970517/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2012/02/final-project.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/5628861535944970517'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/5628861535944970517'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2012/02/final-project.html' title='Final Project'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-FWnmBGXoqPM/TzgvErLdmpI/AAAAAAAAAYs/l4jMKqTPIV8/s72-c/BitByBitERD.PNG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-5176174244939036589</id><published>2012-02-11T15:12:00.000-08:00</published><updated>2012-02-11T15:12:33.912-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC222'/><title type='text'>Assignment 12</title><content type='html'>&lt;h2&gt;Creating Logins, Users and roles&lt;/h2&gt;&lt;p&gt;This is fairly simple&lt;/p&gt;&lt;p&gt;1. Create a new login called CustLogin which has a password of "P@ssw0rd1" and the default database "Automart."&lt;/p&gt;&lt;p&gt;2. Create a new User that uses the login CustLogin called CustUser with a default schema of Customer&lt;/p&gt;&lt;p&gt;3. Create a role called CustomerRole.&lt;/p&gt;&lt;p&gt;4. Grant select on the Customer schema to the role Customer Role&lt;/p&gt;&lt;p&gt;5. Use the stored procedure to add the user CustUser to the Role Customer&lt;/p&gt;&lt;p&gt;You should try to log on as the new user and see if everything is working as it should. You should only be able to see those tables and objects that belong to the customer schema. You should only be able to select, not insert update or delete&lt;/p&gt;&lt;hr/&gt;&lt;h2&gt;What I am looking for&lt;/h2&gt;&lt;p&gt;Each step is worth 2 points for a total of 10&lt;/p&gt;&lt;hr/&gt;&lt;h2&gt;What to turn in&lt;/h2&gt;&lt;p&gt;copy the code into a Google doc and share it with spconger@gmail.com&lt;p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-5176174244939036589?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/5176174244939036589/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2012/02/assignment-12.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/5176174244939036589'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/5176174244939036589'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2012/02/assignment-12.html' title='Assignment 12'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-8797190971547821870</id><published>2012-02-11T13:32:00.000-08:00</published><updated>2012-02-11T13:32:35.769-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC222'/><title type='text'>Assignment 11</title><content type='html'>&lt;h2&gt;Xml&lt;/h2&gt;&lt;h3&gt;Outputting data as XML&lt;/h3&gt;&lt;p&gt;1. Out put person as xml raw as elements with a root of 'People'&lt;p&gt;2. Do an inner join bwtween Person and employee and output the resultsas xml auto with a root element of "Employees"&lt;p&gt;&lt;hr/&gt;&lt;h3&gt;Querying XML&lt;/h3&gt;&lt;p&gt;3. Select all the fields from the Customer.Autoservice table. Use the xml query() method on the Service description to only return the contents of the description element. Don't forget to account for the namespace.&lt;/p&gt;&lt;hr/&gt;&lt;h3&gt;XML Schema and XML data type&lt;/h3&gt;&lt;p&gt;4. Alter the table InspectionDetail that we created in an earlier assignment and drop the xml column Description.&lt;/p&gt;&lt;p&gt;5. Create a new xml schema collection called "DescriptionSchema" using the following schema:&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&gt;&lt;br /&gt;&amp;lt;xs:schema attributeFormDefault="unqualified" &lt;br /&gt; elementFormDefault="qualified" &lt;br /&gt; targetNamespace="http://www.automart.com/inspectionDescription" &lt;br /&gt; xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;&lt;br /&gt; &amp;lt;xs:element name="inspectiondescription"&gt;&lt;br /&gt;   &amp;lt;xs:complexType&gt;&lt;br /&gt;     &amp;lt;xs:sequence&gt;&lt;br /&gt;  &amp;lt;xs:element name="issue" type="xs:string" /&gt;&lt;br /&gt;  &amp;lt;xs:element name="details"&gt;&lt;br /&gt;  &amp;lt;xs:complexType&gt;&lt;br /&gt;  &amp;lt;xs:sequence&gt;&lt;br /&gt;  &amp;lt;xs:element maxOccurs="unbounded" &lt;br /&gt;   name="detail" &lt;br /&gt;   type="xs:string" /&gt;&lt;br /&gt;  &amp;lt;/xs:sequence&gt;&lt;br /&gt;  &amp;lt;/xs:complexType&gt;&lt;br /&gt;  &amp;lt;/xs:element&gt;&lt;br /&gt;         &amp;lt;/xs:sequence&gt;&lt;br /&gt;    &amp;lt;/xs:complexType&gt;&lt;br /&gt; &amp;lt;/xs:element&gt;&lt;br /&gt;&amp;lt;/xs:schema&gt;&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;6. Now alter the table again, to add the xml column back in, but with schema added:&lt;/p&gt;&lt;pre&gt;&lt;br /&gt; Description xml (DescriptionSchema),&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;7. Insert an new record into the inspection and then the inspectionDetail. You can make up the values, but for the column description enter the following xml:&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&gt;&lt;br /&gt;&amp;lt;inspectiondescription &lt;br /&gt;xmlns="http://www.automart.com/inspectionDescription" &gt;&lt;br /&gt; &amp;lt;issue&gt;&lt;br /&gt;  cleanliness of the work area&lt;br /&gt; &amp;lt;/issue&gt;&lt;br /&gt; &amp;lt;details&gt;&lt;br /&gt;  &amp;lt;detail&gt;discarded oil rags on counter&amp;lt;/detail&gt;&lt;br /&gt;  &amp;lt;detail&gt;Open pan of used oil left &lt;br /&gt;beside pit where it could be spilled&amp;lt;/detail&gt;&lt;br /&gt;  &amp;lt;detail&gt;Tools not cleaned immediately after use&amp;lt;/detail&gt;&lt;br /&gt; &amp;lt;/details&gt;&lt;br /&gt; &lt;br /&gt;&amp;lt;/inspectiondescription&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;hr/&gt;&lt;h2&gt;What I am looking for&lt;/h2&gt;&lt;p&gt; 1-5 are worth 1 point each, 6 is worth 3 and 7 is worth 2 for a total of 10&lt;/p&gt;&lt;hr/&gt;&lt;h2&gt;To Turn in&lt;/h2&gt;&lt;p&gt;copy all the code to a google doc and share with spconger@gmail.com&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-8797190971547821870?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/8797190971547821870/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2012/02/assignment-11.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/8797190971547821870'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/8797190971547821870'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2012/02/assignment-11.html' title='Assignment 11'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-1337924235327439943</id><published>2012-02-11T12:42:00.000-08:00</published><updated>2012-02-11T12:42:52.202-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC222'/><title type='text'>Assignment 10</title><content type='html'>&lt;h2&gt;More Stored Procedures and Triggers&lt;/h2&gt;&lt;h3&gt;Stored Procedure&lt;/h3&gt;&lt;p&gt;Create a stored procedure to add a new customer. To do this add person, vehice and registerd customer info. First check to maks sure the customer does not already exist. If they do just print out a message saying they already exist; If they don't exist insert into all the tables necessary. Put the inserts in a transaction and a try catch. You want all the inserts to happen or none of them. &lt;/p&gt;&lt;p&gt;Remember you will need to find the newly generated person key. You can use @@identity or IDENT_Current to find it.&lt;/p&gt;&lt;p&gt;The procedure will create a temporary password that uses the first letter of the first name, the whole last name, and the first 3 characters of their vehicle License number. If you feel clever you can seperate this into a function and then call the function in the stored procedure&lt;/p&gt;&lt;p&gt;Use the procedure to enter a customer&lt;/p&gt;&lt;p&gt;Try Entering the same customer. You should get the message that the customer exists&lt;/p&gt;&lt;hr/&gt;&lt;h3&gt;Trigger&lt;/h3&gt;&lt;p&gt;Create a trigger for insert on the table RegisteredCustomer. If a customer rates the service at 2 or less, copy the record to a table called "Problem". This table should have the same structure as the CustomerSurvey table. The trigger should check to make sure the customer survey table exists. If it doesn't it should create it.&lt;/p&gt;&lt;p&gt;Enter a survey record with a rating of 1 and see if the trigger works. Also enter one with a rating of 3 to make sure that it isn't written to the problem table.&lt;/p&gt;&lt;h2&gt;What I am Looking for&lt;/h2&gt;&lt;p&gt;The stored procedure code will be worth 5 points&lt;br/&gt;1 point for checking to see if the customer exists&lt;br/&gt;1 point for creating a transactions&lt;br/&gt;1 point for inserting the records&lt;br/&gt;2 points for creating the temporary password&lt;/p&gt;&lt;p&gt;The trigger will also be worth 5 points&lt;br/&gt;1 point for checking that the table exists&lt;br/&gt;1 point for creating the table&lt;br/&gt;1 point for checking the value of the rating&lt;br/&gt;1 point for copying the results to the new table&lt;br/&gt;1 point for a working trigger&lt;/p&gt;&lt;h2&gt;To Turn in&lt;/h2&gt;&lt;p&gt;Copy the code for the trigger and the stored procedure into a google doc and share with spconger@gmail.com&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-1337924235327439943?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/1337924235327439943/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2012/02/assignment-10.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/1337924235327439943'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/1337924235327439943'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2012/02/assignment-10.html' title='Assignment 10'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-4317734508141110839</id><published>2012-02-10T15:20:00.001-08:00</published><updated>2012-02-10T15:20:29.996-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC172'/><title type='text'>My Version of the Calculator</title><content type='html'>&lt;p&gt;Here is my version of the calculator. I am only including the C# code. It is fully functional.&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Web;&lt;br /&gt;using System.Web.UI;&lt;br /&gt;using System.Web.UI.WebControls;&lt;br /&gt;&lt;br /&gt;/***********************************&lt;br /&gt; * This is a fully functional version of the calculator&lt;br /&gt; * the key to completing this is to spend some time&lt;br /&gt; * prior to actully coding. Think about what a calculator&lt;br /&gt; * actually does when you click a number, when you&lt;br /&gt; * click an operator, etc. &lt;br /&gt; * Steve Conger February 2012&lt;br /&gt; * ********************************************/&lt;br /&gt;&lt;br /&gt;public partial class _Default : System.Web.UI.Page&lt;br /&gt;{&lt;br /&gt;   &lt;br /&gt;&lt;br /&gt;    protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;    {&lt;br /&gt;       &lt;br /&gt;       &lt;br /&gt;    }&lt;br /&gt;    protected void number_click(object sender, EventArgs e)&lt;br /&gt;    {&lt;br /&gt;        //all the number buttons and the decimal &lt;br /&gt;        //share this event. &lt;br /&gt;        //first we figure out which button was clicked&lt;br /&gt;        //and then we add it to the text box&lt;br /&gt;        Button b = (Button)sender;&lt;br /&gt;        TextBox1.Text += b.Text;&lt;br /&gt;    }&lt;br /&gt;    protected void operator_click(object sender, EventArgs e)&lt;br /&gt;    {&lt;br /&gt;        //all the operators except the equal sign&lt;br /&gt;        //share this event&lt;br /&gt;        Button b = (Button)sender;&lt;br /&gt;        //we get the operator from the button text&lt;br /&gt;        //and write it to a session variable&lt;br /&gt;        string op = b.Text;&lt;br /&gt;        Session["Operator"] = op;&lt;br /&gt;        //we call the DoCalculation Method&lt;br /&gt;        DoCalculation();&lt;br /&gt;            &lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    protected void equal_click(object sender, EventArgs e)&lt;br /&gt;    {&lt;br /&gt;        //first I check that the session variable is not null&lt;br /&gt;        if (Session["Result"] != null)&lt;br /&gt;        {&lt;br /&gt;            //we call DoCalculation method to process the number&lt;br /&gt;            //still in the textbox&lt;br /&gt;            DoCalculation();&lt;br /&gt;            //we display the answer in the textbox&lt;br /&gt;            TextBox1.Text = Session["Result"].ToString();&lt;br /&gt;            //we clear the session variable&lt;br /&gt;            //this took me awhile to figure out, but it is key&lt;br /&gt;            //to the calculator behaving properly.&lt;br /&gt;            Session["Result"] = null;&lt;br /&gt;&lt;br /&gt;            &lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;    protected void Clear_click(object sender, EventArgs e)&lt;br /&gt;    {&lt;br /&gt;        //this event clears the textbox and&lt;br /&gt;        //resets the session&lt;br /&gt;        TextBox1.Text = "";&lt;br /&gt;        Session["Result"] = null;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    protected void DoCalculation()&lt;br /&gt;    {&lt;br /&gt;        //this method handles all the calcualtions and &lt;br /&gt;        //and stores them in the session variable&lt;br /&gt;        double number;&lt;br /&gt;&lt;br /&gt;        //first we get the current operator&lt;br /&gt;        //I maybe should check to make sure it is not null,&lt;br /&gt;        string op = Session["Operator"].ToString();&lt;br /&gt;        &lt;br /&gt;        //Then we get the number from the text box&lt;br /&gt;        bool isDouble = double.TryParse(TextBox1.Text, out number);&lt;br /&gt;        if (isDouble)&lt;br /&gt;        {&lt;br /&gt;            //if it is the first number we just assign&lt;br /&gt;            //it to the session variable&lt;br /&gt;            if (Session["Result"] == null)&lt;br /&gt;            {&lt;br /&gt;                Session["Result"] = number;&lt;br /&gt;               &lt;br /&gt;&lt;br /&gt;            }&lt;br /&gt;            else&lt;br /&gt;            {&lt;br /&gt;                //so if it isn't the first number&lt;br /&gt;                //do the math and assign the result&lt;br /&gt;                //to the Session variable&lt;br /&gt;                double number1 = (double)Session["Result"];&lt;br /&gt;                switch (op)&lt;br /&gt;                {&lt;br /&gt;                    case "+":&lt;br /&gt;                        Session["Result"] = number1 + number;&lt;br /&gt;                        break;&lt;br /&gt;                    case "-":&lt;br /&gt;                        Session["Result"] = number1 - number;&lt;br /&gt;                        break;&lt;br /&gt;                    case "*":&lt;br /&gt;                        Session["Result"] = number1 * number;&lt;br /&gt;                        break;&lt;br /&gt;                    case "/":&lt;br /&gt;                        Session["Result"] = number1 / number;&lt;br /&gt;                        break;&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;        //clear the text box&lt;br /&gt;        TextBox1.Text = "";&lt;br /&gt;&lt;br /&gt;    }&lt;br /&gt;} &lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-4317734508141110839?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/4317734508141110839/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2012/02/my-version-of-calculator.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/4317734508141110839'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/4317734508141110839'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2012/02/my-version-of-calculator.html' title='My Version of the Calculator'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-6562034207485312611</id><published>2012-02-08T11:54:00.000-08:00</published><updated>2012-02-08T11:54:43.117-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC222'/><title type='text'>Assignment 9</title><content type='html'>&lt;h2&gt;Functions&lt;/h2&gt;&lt;p&gt;We are going to create just one function. The purpose of the function is to total the cost of each service provided for a car. This has to take into account the price of the service, the discount amount and the tax amount. Here are a couple of queries that use the function. You can use these to test the function&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;Select ServicePrice, vs.VehicleServiceID, VehicleID, DiscountPercent,&lt;br /&gt;TaxPercent, dbo.fx_TotalDue(ServicePrice, DiscountPercent, TaxPercent) as Total&lt;br /&gt;From Employee.VehicleServiceDetail vsd&lt;br /&gt;inner Join Employee.VehicleService vs&lt;br /&gt;on vsd.VehicleServiceID=vs.VehicleServiceID&lt;br /&gt;inner join Customer.AutoService a&lt;br /&gt;on a.AutoServiceID=vsd.AutoServiceID&lt;br /&gt;&lt;br /&gt;Select SUM( dbo.fx_TotalDue(ServicePrice, DiscountPercent, TaxPercent)) as Total&lt;br /&gt;From Employee.VehicleServiceDetail vsd&lt;br /&gt;inner Join Employee.VehicleService vs&lt;br /&gt;on vsd.VehicleServiceID=vs.VehicleServiceID&lt;br /&gt;inner join Customer.AutoService a&lt;br /&gt;on a.AutoServiceID=vsd.AutoServiceID&lt;br /&gt;Where vsd.VehicleServiceID=4&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;hr/&gt;&lt;h2&gt;Simple Stored procedures &lt;/h2&gt;&lt;p&gt;In a sense this is just redoing the views to add a parameter.&lt;/p&gt; &lt;p&gt;Make a stored procedure that returns the employee information. It will take the parameter @Locationname&lt;/p&gt;&lt;p&gt;Make one that returns all the names, vehicle information and email for registered customers. It will take a parameter of @VehicleLicense&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-6562034207485312611?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/6562034207485312611/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2012/02/assignment-9.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/6562034207485312611'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/6562034207485312611'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2012/02/assignment-9.html' title='Assignment 9'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-5626939815468656823</id><published>2012-02-08T10:38:00.000-08:00</published><updated>2012-02-08T10:38:01.086-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC222'/><title type='text'>Assignment 8</title><content type='html'>&lt;h2&gt;Views&lt;/h2&gt;&lt;p&gt;1. Create a view that shows Employee information. The view should include the employee's first name, last name, hire date and location name. You should alias each column.&lt;/p&gt;&lt;p&gt;2. Create a view that shows all the information about a registered customer. It should include their name, their vehicle licenses and makes and their email. &lt;/p&gt;&lt;hr/&gt;&lt;h2&gt;Indexes&lt;/h2&gt;&lt;p&gt;3. Create a non clustered index on LastName in Person &lt;/p&gt;&lt;p&gt;4. Create a non clustered index on the License number in Vehicle&lt;/p&gt;&lt;p&gt;5. Create a non clustered index on AutoServiceID in VehicleServiceDetail&lt;/p&gt;&lt;p&gt;6. Create a non clustered index on ServiceDate in VehicleService&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-5626939815468656823?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/5626939815468656823/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2012/02/assignment-8.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/5626939815468656823'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/5626939815468656823'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2012/02/assignment-8.html' title='Assignment 8'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-3088357873747946031</id><published>2012-02-07T15:09:00.000-08:00</published><updated>2012-02-07T15:12:00.015-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC220'/><title type='text'>DVD Diagram</title><content type='html'>&lt;h2&gt;Shorthand for Normalization&lt;/h2&gt;&lt;p&gt;These three rules will get you through most of database design&lt;/p&gt;&lt;hr/&gt;&lt;p&gt;1. Every table should be only about one thing. Split out every separate topic into its own entity&lt;/p&gt;&lt;p&gt;2. any multivalued attributes should be removed to their own entity&lt;/p&gt;&lt;p&gt;3. Whenever you have a many to many relationship you must resolve the relationship into two one to many relationships by adding a linking table&lt;/p&gt;&lt;hr/&gt;&lt;p&gt;Here is the diagram for the DVD we did in class. Click on it to get a larger image.&lt;/p&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-rnbDY-LJSz4/TzGvaZ1RUDI/AAAAAAAAAYg/Sci6OZBHg1Y/s1600/DVDERD.png" imageanchor="1" style=""&gt;&lt;img border="0" height="174" width="320" src="http://2.bp.blogspot.com/-rnbDY-LJSz4/TzGvaZ1RUDI/AAAAAAAAAYg/Sci6OZBHg1Y/s320/DVDERD.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-3088357873747946031?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/3088357873747946031/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2012/02/dvd-diagram.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/3088357873747946031'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/3088357873747946031'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2012/02/dvd-diagram.html' title='DVD Diagram'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-rnbDY-LJSz4/TzGvaZ1RUDI/AAAAAAAAAYg/Sci6OZBHg1Y/s72-c/DVDERD.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-8702131642047758215</id><published>2012-02-07T12:21:00.000-08:00</published><updated>2012-02-07T12:21:02.610-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC172'/><title type='text'>LINQ</title><content type='html'>&lt;p&gt;I will add to this in the near future and provide the stepswe took in SQL Server and the link designer&lt;/p&gt;&lt;p&gt;for now here is the LINQ code&lt;/p&gt;&lt;pre&gt;&lt;br /&gt; protected void Button1_Click(object sender, EventArgs e)&lt;br /&gt; {&lt;br /&gt;   AutomartDataClassesDataContext dc = new AutomartDataClassesDataContext();&lt;br /&gt;   var ourCustomers = from c in dc.RegisteredCustomers&lt;br /&gt;                      orderby c.Person.LastName&lt;br /&gt;                      where c.Person.LastName=="Anderson"&lt;br /&gt;                      select new {c.Person.LastName, &lt;br /&gt;                            c.Person.FirstName,c.Email};&lt;br /&gt;&lt;br /&gt;    GridView1.DataSource = ourCustomers.ToList();&lt;br /&gt;    GridView1.DataBind();&lt;br /&gt; }&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-8702131642047758215?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/8702131642047758215/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2012/02/linq.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/8702131642047758215'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/8702131642047758215'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2012/02/linq.html' title='LINQ'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-4719117766279585683</id><published>2012-02-06T11:54:00.002-08:00</published><updated>2012-02-06T11:54:40.034-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC222'/><title type='text'>Creating and altering Tables</title><content type='html'>&lt;pre&gt;&lt;br /&gt;--Creating and altering tables&lt;br /&gt;use master&lt;br /&gt;go&lt;br /&gt;Create database grading&lt;br /&gt;&lt;br /&gt;use grading&lt;br /&gt;&lt;br /&gt;Create Table Student&lt;br /&gt;(&lt;br /&gt;   StudentID nchar(12) primary key,&lt;br /&gt;   StudentLastName nvarchar(255),&lt;br /&gt;   StudentFirstName nvarchar(255)&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;Create Table Course&lt;br /&gt;(&lt;br /&gt;    CourseNumber nchar(7),&lt;br /&gt; CourseName nvarchar(255) not null,&lt;br /&gt; CourseCredits int not null,&lt;br /&gt; Constraint pk_Course Primary Key (CourseNumber)&lt;br /&gt; &lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Create Table Section&lt;br /&gt;(&lt;br /&gt;   SectionNumber nchar(4) not null,&lt;br /&gt;   CourseNumber nchar(7) Foreign Key &lt;br /&gt;   References Course(CourseNumber),&lt;br /&gt; SectionQuarter nvarchar(7) not null,&lt;br /&gt; SectionYear char(4) not null&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;Drop Table Section&lt;br /&gt;&lt;br /&gt;alter Table Section&lt;br /&gt;Add Constraint Pk_Section Primary Key(SectionNumber)&lt;br /&gt;&lt;br /&gt;Create Table Roster&lt;br /&gt;(&lt;br /&gt; RosterID int identity(1,1),&lt;br /&gt; StudentID nchar(12),&lt;br /&gt; SectionNumber nchar(4),&lt;br /&gt; Grade Decimal(3,2),&lt;br /&gt; Notes xml,&lt;br /&gt; Constraint pk_Roster primary key(RosterID),&lt;br /&gt; Constraint FK_Student Foreign key (StudentID)&lt;br /&gt;  References Student(StudentID)&lt;br /&gt;&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;Alter Table Roster&lt;br /&gt;Add constraint FK_Section Foreign Key(SectionNumber)&lt;br /&gt;References Section(SectionNumber)&lt;br /&gt;&lt;br /&gt;Alter Table Roster&lt;br /&gt;Add Constraint Ck_Grade Check(Grade between 0 and 4)&lt;br /&gt;&lt;br /&gt;Alter Table Section&lt;br /&gt;Add Constraint ch_Quarter &lt;br /&gt;Check (SectionQuarter in ('Fall', 'Winter', 'Spring', 'Summer'))&lt;br /&gt;&lt;br /&gt;Insert into Student(StudentID, StudentLastName, StudentFirstName)&lt;br /&gt;Values('919-00-9876','Smith','John')&lt;br /&gt;&lt;br /&gt;Insert into Course(CourseNumber, CourseName, CourseCredits)&lt;br /&gt;Values('ITC222','SQL',5)&lt;br /&gt;&lt;br /&gt;Insert into Section(SectionNumber, CourseNumber, &lt;br /&gt;SectionQuarter, SectionYear)&lt;br /&gt;Values('3208','ITC222','Winter','2012')&lt;br /&gt;&lt;br /&gt;--these will cause errors because of the check constraints&lt;br /&gt;Insert into Section(SectionNumber, CourseNumber, &lt;br /&gt;SectionQuarter, SectionYear)&lt;br /&gt;Values('3209','ITC222','Jan','2012')&lt;br /&gt;&lt;br /&gt;Insert into Roster(StudentID, SectionNumber, Grade, Notes)&lt;br /&gt;Values ('919-00-9876','3208',5,null)&lt;br /&gt;&lt;br /&gt;Create Table Student&lt;br /&gt;(&lt;br /&gt;   StudentKey int identity(1,1) primary key,&lt;br /&gt;   StudentID nchar(12) unique&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-4719117766279585683?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/4719117766279585683/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2012/02/creating-and-altering-tables.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/4719117766279585683'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/4719117766279585683'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2012/02/creating-and-altering-tables.html' title='Creating and altering Tables'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-194415664526911291</id><published>2012-02-01T14:02:00.000-08:00</published><updated>2012-02-01T14:07:30.829-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC255'/><title type='text'></title><content type='html'>&lt;p&gt;Here are a couple of examples of use case written documentation. These are from a program and database I wrote to track short term certificates&lt;/p&gt;&lt;hr/&gt;&lt;p&gt;Here is the use Case diagram. The documentation is below:&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;a href="http://3.bp.blogspot.com/-IlcrbeR3Svs/Tym1-JG7pUI/AAAAAAAAAX8/bQeKr1Q6HdU/s1600/UseCase1.jpg" imageanchor="1" style=""&gt;&lt;img border="0" height="125" width="249" src="http://3.bp.blogspot.com/-IlcrbeR3Svs/Tym1-JG7pUI/AAAAAAAAAX8/bQeKr1Q6HdU/s320/UseCase1.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;h2&gt;Enter Certificate Information Use Case&lt;/h2&gt; &lt;p&gt;&lt;strong&gt;Trigger: &lt;/strong&gt; &lt;/p&gt;&lt;p&gt;First use of database-- adding new Certificate &lt;/p&gt;&lt;p&gt;&lt;strong&gt;Steps: &lt;/strong&gt;&lt;/p&gt;&lt;p&gt;1. Enter Certificates into database (through Form)&lt;/p&gt;&lt;p&gt;2. Enter Courses required for certificate &lt;/p&gt; &lt;p&gt;    a. Select course from course table &lt;/p&gt;&lt;p&gt;    b. add foreign key to Certificate Course table &lt;/p&gt;&lt;p&gt;3. Review and confirm &lt;/p&gt;&lt;p&gt;&lt;strong&gt;Terminal Condition: &lt;/strong&gt;&lt;/p&gt;&lt;p&gt;List of certificates with required courses in database&lt;/p&gt; &lt;hr/&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;a href="http://1.bp.blogspot.com/-vW50T7_bwN0/Tym2Z8V2lbI/AAAAAAAAAYI/mVvHXJlTW2c/s1600/UseCase2.jpg" imageanchor="1" style=""&gt;&lt;img border="0" height="125" width="249" src="http://1.bp.blogspot.com/-vW50T7_bwN0/Tym2Z8V2lbI/AAAAAAAAAYI/mVvHXJlTW2c/s320/UseCase2.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;h2&gt;List Students Getting Certificates Use Case &lt;/h2&gt;&lt;p&gt;&lt;strong&gt;Precondition:&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Students and grades imported into database &lt;/p&gt;&lt;p&gt;&lt;strong&gt;Trigger: &lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Quarterly Report on Certificate completions&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Constraints:&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Must have a 2.0 or greater grade point average (or cert specific average) &lt;/p&gt;&lt;p&gt;&lt;strong&gt;Steps:&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;1. Run query for each which students have taken all the courses for one certificate (Each certificate will have to be queries separately) &lt;/p&gt;&lt;p&gt;2. Average the grades of all the students who have completed the certificate &lt;/p&gt;&lt;p&gt;3. Select only those who have an average greater than 2.0 &lt;/p&gt;&lt;p&gt;4. Write them into a Certificates received (or temp?) table &lt;/p&gt;&lt;p&gt;5. Run the queries again for each possible certificate &lt;/p&gt;&lt;p&gt;6. Summarize the results of all queries in a report (from the Certificates Received table) &lt;/p&gt;&lt;p&gt;&lt;strong&gt;Terminal Condition:&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Quarterly report of Certificates completed for given quarter&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-194415664526911291?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/194415664526911291/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2012/02/here-are-couple-of-examples-of-use-case.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/194415664526911291'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/194415664526911291'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2012/02/here-are-couple-of-examples-of-use-case.html' title=''/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-IlcrbeR3Svs/Tym1-JG7pUI/AAAAAAAAAX8/bQeKr1Q6HdU/s72-c/UseCase1.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-8117730335607390395</id><published>2012-02-01T12:08:00.000-08:00</published><updated>2012-02-01T12:08:17.398-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC172'/><title type='text'>Assignment 4 Notes</title><content type='html'>&lt;p&gt;It is not possible to assign the results of the web Service method directly to the DataSet, (though I swear I did this when I previewed the assignment some months ago.) It must be read as an XML file and then loaded into the DataSet. Here is a bit of code for that. Then you can bind the DataSet to the GridView&lt;/p&gt;&lt;hr/&gt;&lt;pre&gt;&lt;br /&gt;XmlNode node = zip.GetInfoByCity(txtCity.Text);&lt;br /&gt;DataSet ds = new DataSet();&lt;br /&gt;XmlNodeReader reader = new XmlNodeReader(node);&lt;br /&gt;           &lt;br /&gt;ds.ReadXml(reader);&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-8117730335607390395?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/8117730335607390395/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2012/02/assignment-4-notes.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/8117730335607390395'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/8117730335607390395'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2012/02/assignment-4-notes.html' title='Assignment 4 Notes'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-719596023957225188</id><published>2012-02-01T11:48:00.001-08:00</published><updated>2012-02-01T11:48:20.455-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC222'/><title type='text'>Insert Update Delete</title><content type='html'>&lt;pre&gt;&lt;br /&gt;--inserts, updates and deletes&lt;br /&gt;Use CommunityAssist &lt;br /&gt;Insert into Person (LastName, FirstName)&lt;br /&gt;Values('Smith', 'John'),&lt;br /&gt;('Doe', 'Jane')&lt;br /&gt;&lt;br /&gt;Select * from Person&lt;br /&gt;&lt;br /&gt;Use Master&lt;br /&gt;Drop table Employee.VehicleService&lt;br /&gt;&lt;br /&gt;Create table Person2&lt;br /&gt;(&lt;br /&gt;FirstName nvarchar(255),&lt;br /&gt;LastName Nvarchar(255)&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;--bulk insert of sorts&lt;br /&gt;Insert into Person2(FirstName, LastName)&lt;br /&gt;Select FirstName, LastName From Person&lt;br /&gt;&lt;br /&gt;Select * From Person2&lt;br /&gt;&lt;br /&gt;--creating a temporary table&lt;br /&gt;Select LastName, Firstname&lt;br /&gt;into #SpecialPeople&lt;br /&gt;From Person&lt;br /&gt;&lt;br /&gt;Select * From #SpecialPeople&lt;br /&gt;&lt;br /&gt;--update with multiple fields an &lt;br /&gt;--update should always &lt;br /&gt;--have a where clause&lt;br /&gt;update Person2&lt;br /&gt;Set LastName='Anders',&lt;br /&gt;Firstname='bob'&lt;br /&gt;Where LastName='Anderson'&lt;br /&gt;And FirstName='Jay'&lt;br /&gt;&lt;br /&gt;Select * From Person2&lt;br /&gt;Drop table Person2&lt;br /&gt;&lt;br /&gt;--explicitly using a transaction&lt;br /&gt;--can give you an undo&lt;br /&gt;Begin transaction&lt;br /&gt;&lt;br /&gt;--This turns everyone's name the same&lt;br /&gt;Update Person2&lt;br /&gt;Set Firstname='Bob'&lt;br /&gt;Where LastName='zimmerman'&lt;br /&gt;&lt;br /&gt;Select * From Person2&lt;br /&gt;&lt;br /&gt;Rollback tran-- will undo all transactions\&lt;br /&gt;--since the begin&lt;br /&gt;Commit Tran -- will commit the transaction&lt;br /&gt;--to the database&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Use MagazineSubscription&lt;br /&gt;&lt;br /&gt;Select * From magazineDetail&lt;br /&gt;&lt;br /&gt;--increase all the prices by 20%&lt;br /&gt;Update MagazineDetail&lt;br /&gt;Set SubscriptionPrice=SubscriptionPrice * 1.2&lt;br /&gt;&lt;br /&gt;-- Deletions&lt;br /&gt;--can't delete records that&lt;br /&gt;--have child records&lt;br /&gt;Use CommunityAssist&lt;br /&gt;Begin Tran&lt;br /&gt;Delete From Person&lt;br /&gt;Where PersonKey &gt; 51&lt;br /&gt;&lt;br /&gt;Select * From Person&lt;br /&gt;Rollback tran&lt;br /&gt;Commit tran&lt;br /&gt;--removes all rows because no&lt;br /&gt;--related records in a child table&lt;br /&gt;Delete from Person2&lt;br /&gt;&lt;br /&gt;--does the same as delete&lt;br /&gt;--but more efficient&lt;br /&gt;--doesn't do it row by row&lt;br /&gt;Truncate table Person2&lt;br /&gt;&lt;br /&gt;Select * From Person2&lt;br /&gt;&lt;br /&gt;--get table information&lt;br /&gt;exec sp_help PersonAddress&lt;br /&gt;&lt;br /&gt;--system views&lt;br /&gt;Select * from sys.Databases&lt;br /&gt;&lt;br /&gt;Select name from sys.Tables&lt;br /&gt;&lt;br /&gt;Select name from sys.procedures&lt;br /&gt;&lt;br /&gt;Select * From Sys.columns&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-719596023957225188?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/719596023957225188/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2012/02/insert-update-delete.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/719596023957225188'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/719596023957225188'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2012/02/insert-update-delete.html' title='Insert Update Delete'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-8377150193632196168</id><published>2012-01-31T14:59:00.000-08:00</published><updated>2012-01-31T14:59:26.904-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC220'/><title type='text'>Dentist Appointment ERD</title><content type='html'>Here is the ERD (Entity Relation Diagrom) for the Dentist office we did in class:&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-azPkvJWBLT0/TyhyNeQiXII/AAAAAAAAAXw/01vkidut_i0/s1600/DentistAppointments.jpg" imageanchor="1" style=""&gt;&lt;img border="0" height="271" width="320" src="http://2.bp.blogspot.com/-azPkvJWBLT0/TyhyNeQiXII/AAAAAAAAAXw/01vkidut_i0/s320/DentistAppointments.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-8377150193632196168?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/8377150193632196168/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2012/01/dentist-appointment-erd.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/8377150193632196168'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/8377150193632196168'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2012/01/dentist-appointment-erd.html' title='Dentist Appointment ERD'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-azPkvJWBLT0/TyhyNeQiXII/AAAAAAAAAXw/01vkidut_i0/s72-c/DentistAppointments.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-1470829075916873976</id><published>2012-01-30T11:23:00.000-08:00</published><updated>2012-01-30T11:23:17.300-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC222'/><title type='text'>SubQueries</title><content type='html'>&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;Use MagazineSubscription&lt;br /&gt;&lt;br /&gt;Select MagID From MagazineDetail&lt;br /&gt;Where SubscriptionPrice = &lt;br /&gt;(Select MAX(SubscriptionPrice) From MagazineDetail)&lt;br /&gt;&lt;br /&gt;Select MagID, SubscriptionPrice, &lt;br /&gt;(Select AVG(SubscriptionPrice) From MagazineDetail) as Average&lt;br /&gt;From MagazineDetail&lt;br /&gt;Where SubscriptionPrice &gt;&lt;br /&gt;(Select AVG(SubscriptionPrice) From MagazineDetail)&lt;br /&gt;&lt;br /&gt;Insert into Customer(CustLastName, CustFirstName, &lt;br /&gt;CustAddress, CustCity, CustState, CustZipcode, CustPhone)&lt;br /&gt;Values('John', 'Larry', '100 somewhere st','Seattle','Wa','98000',null)&lt;br /&gt;&lt;br /&gt;Select CustID, CustLastName, CustFirstName&lt;br /&gt;From Customer&lt;br /&gt;Where CustID Not in (Select CustID from Subscription)&lt;br /&gt;&lt;br /&gt;Select MagName &lt;br /&gt; From Magazine&lt;br /&gt; Where MagID not in &lt;br /&gt; (Select MagID &lt;br /&gt;  from MagazineDetail&lt;br /&gt;  Where MagDetID in&lt;br /&gt;  (Select MagDetID &lt;br /&gt;   from Subscription))&lt;br /&gt;     &lt;br /&gt;                  Select MagID &lt;br /&gt;      from MagazineDetail&lt;br /&gt;   Where exists&lt;br /&gt;   (Select MagDetID &lt;br /&gt;    from Subscription&lt;br /&gt;    where SubscriptionPrice &gt; 100)&lt;br /&gt;     &lt;br /&gt;Select MagdetID, SubscriptionPrice&lt;br /&gt;From MagazineDetail&lt;br /&gt;Where SubscriptionPrice &gt;= all&lt;br /&gt;(Select SubscriptionPrice&lt;br /&gt;From MagazineDetail)&lt;br /&gt;&lt;br /&gt;--any says that the subcription price must be&lt;br /&gt;--greater than any one of the other prices&lt;br /&gt;--the effect is to return all but the smallest price&lt;br /&gt;Select MagdetID, SubscriptionPrice&lt;br /&gt;From MagazineDetail&lt;br /&gt;Where SubscriptionPrice &gt; any&lt;br /&gt;(Select SubscriptionPrice&lt;br /&gt;From MagazineDetail)&lt;br /&gt;&lt;br /&gt;Select SubscriptTypeID, AVG(SubscriptionPrice) as Average&lt;br /&gt;From MagazineDetail&lt;br /&gt;Group by SubscriptTypeID&lt;br /&gt;&lt;br /&gt;--this is a correlated subquery&lt;br /&gt;--that means the subquery is dependent&lt;br /&gt;--on a value from the main query&lt;br /&gt;--for its completion&lt;br /&gt;--it is equivalent to a recursive function&lt;br /&gt;--in programming&lt;br /&gt;--Note that like a self join the same table&lt;br /&gt;--is aliased with two different aliases&lt;br /&gt;--treating it like two tables&lt;br /&gt;Select md.SubscriptTypeID, MagDetID, SubscriptionPrice&lt;br /&gt;From magazineDetail md&lt;br /&gt;Where SubscriptionPrice &gt;=&lt;br /&gt;(Select AVG(SubscriptionPrice)&lt;br /&gt;From magazinedetail amd&lt;br /&gt;where md.SubscripttypeID = amd.SubscripttypeID)&lt;br /&gt;&lt;br /&gt;Select * from SubscriptionType&lt;br /&gt;&lt;br /&gt;--exists returns a boolean does it exist&lt;br /&gt;--in the subset or not&lt;br /&gt;--a bit more efficient than in&lt;br /&gt;Select Magname&lt;br /&gt;From Magazine&lt;br /&gt;Where Exists&lt;br /&gt;(Select MagID&lt;br /&gt;from MagazineDetail&lt;br /&gt;Where SubscriptTypeID=5)&lt;br /&gt;&lt;br /&gt;Use CommunityAssist&lt;br /&gt;Select Distinct (Select MAX(hireDate) from Employee) as "Newest", &lt;br /&gt;(Select MIN(HireDate) From Employee) as "Oldest",&lt;br /&gt;DateDiff(yy,  (Select MIN(HireDate) From Employee),&lt;br /&gt;(Select MAX(hireDate) from Employee) ) as "Range"&lt;br /&gt;From Employee&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-1470829075916873976?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/1470829075916873976/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2012/01/subqueries.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/1470829075916873976'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/1470829075916873976'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2012/01/subqueries.html' title='SubQueries'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-737265663484748714</id><published>2012-01-27T11:01:00.000-08:00</published><updated>2012-02-08T11:06:01.058-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC222'/><title type='text'>ITC 222 Assignment 7</title><content type='html'>&lt;h2&gt;Creating and altering tables&lt;/h2&gt;&lt;p&gt;Automart has decided to implement a new inspection process where they go to each location at random times. They want to add the results of these inspections to the database. This involves adding three tables. One look up table that contains the various types of infractions or problems. One for the inspection date and location and another for the details of each inspection&lt;/p&gt;&lt;hr/&gt;&lt;h3&gt;The Problems&lt;/h3&gt;&lt;p&gt;Create the following tables. Each table should be in the Schema "Employee".&lt;/p&gt;&lt;p&gt;&lt;strong&gt;InspectionCategory&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;It will contain the column CategoryID which will be an identity starting at 1 and incrementing by ones. This column will also be the primary key. The next column will be CategoryName which will provide the descriptive name of the category such as "cleanliness" or " waiting area" etc.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Inspection&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;This table will contain an InspectionID which is the primary key and and identity starting with 1 and incrementing by 1s. It will contain an InspectionDate and a LocationID which is a foreign key relating to the table location.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Inspection Detail&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;This table will contain the columns InspectionDetailID, an Identity and primary key, InspectionID, a foreign key, CategoryID a foreign key related to InspectionCategory and a Description column which will contain xml.&lt;/p&gt;&lt;hr/&gt;&lt;p&gt;We also are going to make some changes to existing tables&lt;/p&gt;&lt;p&gt;Alter the Customer.RegisteredCustomer table to make emails unique. Do the same for passwords.&lt;/p&gt;&lt;p&gt;Also the CustomerSurvey table has check constraint on the column "rating" that limits it to a number between 1 and 10. The constraint name is CK__CustomerS__Ratin__25869641. Drop it and add a new constraint that limits it to numbers between 1 and 5.&lt;/p&gt;&lt;p&gt;We are also going to correct a mistake in the current database. The vehicleID in Employee.VehicleService should be a foreign key related to the VehicleID in Customer.Vehicle. Add the Foreign Key constraint to correct this oversite.&lt;/p&gt;&lt;hr/&gt;&lt;h3&gt;What I am looking for&lt;/h3&gt;&lt;p&gt;I want to see the code for the three tables and the  alter tables. I am especially looking at the primary key and foreign key constraints for those tables&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-737265663484748714?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/737265663484748714/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2012/01/itc-222-assignent-7.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/737265663484748714'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/737265663484748714'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2012/01/itc-222-assignent-7.html' title='ITC 222 Assignment 7'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-63971361878668903</id><published>2012-01-27T09:42:00.000-08:00</published><updated>2012-01-27T11:55:22.580-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC172'/><title type='text'>Calculator Examples</title><content type='html'>&lt;p&gt;I am posting two examples of Calculator code that work. They both have different but effective approaches. The first is From Victoria Bailey. I have only included the code from the form.&lt;/p&gt;&lt;p&gt;Victoria's only works with binary operations, that is [number] [operator] [number], for example 4 + 2, 3 * 5, etc. It doesn't work with examples like 4 + 3 * 2 / 2. Christian's does&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;&lt;b&gt;Default.aspx&lt;/b&gt;&lt;br /&gt;   &amp;lt;form id="form1" runat="server"&gt;&lt;br /&gt;    &amp;lt;div&gt;&lt;br /&gt;    &lt;br /&gt;        &amp;lt;asp:Label ID="lblScreen" runat="server" Text=""&gt;&amp;lt;/asp:Label&gt;&amp;lt;br /&gt;&lt;br /&gt;        &amp;lt;asp:Button ID="Button1" runat="server" Text="1"  &lt;br /&gt;onclick="btnNumber_Click" /&gt;&amp;lt;asp:Button ID="Button2"&lt;br /&gt;runat="server" Text="2" onclick="btnNumber_Click" /&gt; &lt;br /&gt;&amp;lt;asp:Button ID="Button3" runat="server" Text="3" onclick="btnNumber_Click" /&gt;&amp;lt;br /&gt;&lt;br /&gt;        &amp;lt;asp:Button ID="Button4" runat="server" &lt;br /&gt;Text="4" onclick="btnNumber_Click" /&gt;&amp;lt;asp:Button ID="Button5"&lt;br /&gt;            runat="server" Text="5" onclick="btnNumber_Click" /&gt;&lt;br /&gt;&amp;lt;asp:Button ID="Button6" runat="server" Text="6" onclick="btnNumber_Click" /&gt;&amp;lt;br /&gt;&lt;br /&gt;        &amp;lt;asp:Button ID="Button7" runat="server" &lt;br /&gt;Text="7" onclick="btnNumber_Click" /&gt;&amp;lt;asp:Button ID="Button8"&lt;br /&gt;            runat="server" Text="8" &lt;br /&gt;onclick="btnNumber_Click" /&gt;&lt;br /&gt;&amp;lt;asp:Button ID="Button9" runat="server" Text="9" &lt;br /&gt;onclick="btnNumber_Click" /&gt;&amp;lt;br /&gt;&lt;br /&gt;        &amp;lt;asp:Button ID="Button10" runat="server" Text="0" &lt;br /&gt;onclick="btnNumber_Click" /&gt;&amp;lt;br /&gt;&lt;br /&gt;        &amp;lt;asp:Button ID="Button11" runat="server" Text="+" &lt;br /&gt;onclick="btnOperation_Click" /&gt;&lt;br /&gt;        &amp;lt;asp:Button ID="Button12" runat="server" Text="-" &lt;br /&gt;onclick="btnOperation_Click" /&gt;&lt;br /&gt;        &amp;lt;asp:Button ID="Button13" runat="server" Text="*" &lt;br /&gt;onclick="btnOperation_Click" /&gt;&lt;br /&gt;        &amp;lt;asp:Button ID="Button14" runat="server" Text="/" &lt;br /&gt;onclick="btnOperation_Click" /&gt;&lt;br /&gt;        &amp;lt;br /&gt;&amp;lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        &amp;lt;asp:Button ID="btnCalculate"&lt;br /&gt;            runat="server" Text="Calculate" onclick="btnCalculate_Click" /&gt;&amp;lt;br /&gt;&amp;lt;br /&gt;&lt;br /&gt;        &amp;lt;asp:Label ID="lblAnswer" runat="server" Text="Answer: "&gt;&amp;lt;/asp:Label&gt;&lt;br /&gt;        &amp;lt;asp:Label ID="lblCalculation" runat="server" Text=""&gt;&amp;lt;/asp:Label&gt;&amp;lt;br /&gt;&amp;lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;/div&gt;&lt;br /&gt;    &amp;lt;/form&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Code Behind:&lt;/b&gt;&lt;br /&gt;    protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;    {&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    protected void btnCalculate_Click(object sender, EventArgs e)&lt;br /&gt;    {&lt;br /&gt;        string op = Session["operation"].ToString();&lt;br /&gt;        double number = 0;&lt;br /&gt;        double secondNumber = 0;&lt;br /&gt;        double total = 0;&lt;br /&gt;        if (lblScreen.Text != String.Empty)&lt;br /&gt;        {&lt;br /&gt;            secondNumber = double.Parse(lblScreen.Text);&lt;br /&gt;        }&lt;br /&gt;        if ((Session["firstNumber"] != null) &amp;&amp; (Session["firstNumber"].ToString() != ""))&lt;br /&gt;        {&lt;br /&gt;            number = double.Parse(Session["firstNumber"].ToString());&lt;br /&gt;        }&lt;br /&gt;        switch (op)&lt;br /&gt;        {&lt;br /&gt;            case "+":&lt;br /&gt;                total = number + secondNumber;&lt;br /&gt;                break;&lt;br /&gt;            case "-":&lt;br /&gt;                total = number - secondNumber;&lt;br /&gt;                break;&lt;br /&gt;            case "*":&lt;br /&gt;                total = number * secondNumber;&lt;br /&gt;                break;&lt;br /&gt;            case "/":&lt;br /&gt;                total = number / secondNumber;&lt;br /&gt;                break;&lt;br /&gt;            default:&lt;br /&gt;                break;&lt;br /&gt;        }&lt;br /&gt;        lblCalculation.Text = total.ToString();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    protected void btnNumber_Click(object sender, EventArgs e)&lt;br /&gt;    {&lt;br /&gt;        Button button = (Button)sender;&lt;br /&gt;        lblScreen.Text += button.Text;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    protected void btnOperation_Click(object sender, EventArgs e)&lt;br /&gt;    {&lt;br /&gt;        Session["firstNumber"] = lblScreen.Text;&lt;br /&gt;        Button button = (Button)sender;&lt;br /&gt;        Session["operation"] = button.Text;&lt;br /&gt;        lblScreen.Text = String.Empty;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;hr/&gt;The second example is from Christian Roehr. It uses a very different approach. It is also well commented. Again I have only included the source from the form&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;&gt;&lt;br /&gt; &amp;lt;form id="form1" runat="server"&gt;&lt;br /&gt; &amp;lt;div&gt;&lt;br /&gt; &amp;lt;table&gt;&lt;br /&gt; &amp;lt;tbody&gt;&lt;br /&gt;&lt;br /&gt; &amp;lt;tr&gt;&lt;br /&gt; &amp;lt;td colspan="4"&gt;&amp;lt;/td&gt;&lt;br /&gt;     &amp;lt;asp:TextBox ID="txtDisplay" runat="server"&gt;&amp;lt;/asp:TextBox&gt;&lt;br /&gt; &amp;lt;/tr&gt;&lt;br /&gt;&lt;br /&gt; &amp;lt;tr&gt;&lt;br /&gt; &amp;lt;td&gt;&lt;br /&gt;     &amp;lt;asp:Button ID="Button1" runat="server" Text="7" &lt;br /&gt;CssClass="buttonstyle" OnClick="InputNumber_Click"/&gt;&amp;lt;/td&gt;&lt;br /&gt; &amp;lt;td&gt;&lt;br /&gt;     &amp;lt;asp:Button ID="Button2" runat="server" Text="8" &lt;br /&gt;CssClass="buttonstyle" OnClick="InputNumber_Click"/&gt;&amp;lt;/td&gt;&lt;br /&gt; &amp;lt;td&gt;&lt;br /&gt;     &amp;lt;asp:Button ID="Button3" runat="server" Text="9" &lt;br /&gt;CssClass="buttonstyle" OnClick="InputNumber_Click"/&gt;&amp;lt;/td&gt;&lt;br /&gt; &amp;lt;td&gt;&lt;br /&gt;     &amp;lt;asp:Button ID="btnAdd" runat="server" Text="+" &lt;br /&gt;CssClass="buttonstyle" OnClick="Operator_Click"/&gt;&amp;lt;/td&gt;   &lt;br /&gt; &amp;lt;/tr&gt;&lt;br /&gt;&lt;br /&gt; &amp;lt;tr&gt;&lt;br /&gt; &amp;lt;td&gt;&lt;br /&gt;     &amp;lt;asp:Button ID="Button5" runat="server" Text="4" &lt;br /&gt;CssClass="buttonstyle" OnClick="InputNumber_Click"/&gt;&amp;lt;/td&gt;&lt;br /&gt; &amp;lt;td&gt;&lt;br /&gt;     &amp;lt;asp:Button ID="Button6" runat="server" Text="5" &lt;br /&gt;CssClass="buttonstyle" OnClick="InputNumber_Click"/&gt;&amp;lt;/td&gt;&lt;br /&gt; &amp;lt;td&gt;&lt;br /&gt;     &amp;lt;asp:Button ID="Button7" runat="server" Text="6"&lt;br /&gt; CssClass="buttonstyle" OnClick="InputNumber_Click"/&gt;&amp;lt;/td&gt;&lt;br /&gt; &amp;lt;td&gt;&lt;br /&gt;     &amp;lt;asp:Button ID="btnSubtract" runat="server" Text="-" &lt;br /&gt;CssClass="buttonstyle" OnClick="Operator_Click"/&gt;&amp;lt;/td&gt;   &lt;br /&gt; &amp;lt;/tr&gt;&lt;br /&gt;&lt;br /&gt; &amp;lt;tr&gt;&lt;br /&gt; &amp;lt;td&gt;&lt;br /&gt;     &amp;lt;asp:Button ID="Button9" runat="server" Text="1" &lt;br /&gt;CssClass="buttonstyle" OnClick="InputNumber_Click"/&gt;&amp;lt;/td&gt;&lt;br /&gt; &amp;lt;td&gt;&lt;br /&gt;     &amp;lt;asp:Button ID="Button10" runat="server" Text="2" &lt;br /&gt;CssClass="buttonstyle" OnClick="InputNumber_Click"/&gt;&amp;lt;/td&gt;&lt;br /&gt; &amp;lt;td&gt;&lt;br /&gt;     &amp;lt;asp:Button ID="Button11" runat="server" Text="3" &lt;br /&gt;CssClass="buttonstyle" OnClick="InputNumber_Click"/&gt;&amp;lt;/td&gt;&lt;br /&gt; &amp;lt;td&gt;&lt;br /&gt;     &amp;lt;asp:Button ID="btnMult" runat="server" Text="*" &lt;br /&gt;CssClass="buttonstyle" OnClick="Operator_Click"/&gt;&amp;lt;/td&gt;  &lt;br /&gt; &amp;lt;/tr&gt;&lt;br /&gt;&lt;br /&gt; &amp;lt;tr&gt;&lt;br /&gt; &amp;lt;td&gt;&lt;br /&gt;     &amp;lt;asp:Button ID="btnDel" runat="server" Text="Del" ToolTip="Use the &amp;lt;Del&gt; button to clear the textbox in order to correct a value before clicking one of the operator buttons. The intermediate result and last operator are still kept in memory." CssClass="buttonstyle"&lt;br /&gt;         onclick="btnDel_Click"/&gt;&amp;lt;/td&gt;&lt;br /&gt; &amp;lt;td&gt;&lt;br /&gt;     &amp;lt;asp:Button ID="Button14" runat="server" Text="0" &lt;br /&gt;CssClass="buttonstyle" OnClick="InputNumber_Click"/&gt;&amp;lt;/td&gt;&lt;br /&gt; &amp;lt;td&gt;&lt;br /&gt;     &amp;lt;asp:Button ID="Button15" runat="server" Text="." &lt;br /&gt;CssClass="buttonstyle" OnClick="InputNumber_Click"/&gt;&amp;lt;/td&gt;&lt;br /&gt; &amp;lt;td&gt;&lt;br /&gt;     &amp;lt;asp:Button ID="btnDiv" runat="server" Text="/" &lt;br /&gt;CssClass="buttonstyle" OnClick="Operator_Click"/&gt;&amp;lt;/td&gt;    &lt;br /&gt; &amp;lt;/tr&gt;&lt;br /&gt;&lt;br /&gt; &amp;lt;tr&gt;&lt;br /&gt; &amp;lt;td&gt;&lt;br /&gt;     &amp;lt;asp:Button ID="btnClear" runat="server" Text="CL" ToolTip="Use the &amp;lt;CL&gt; button to reset the calculator to its original state. Any prior values or operators are lost." CssClass="buttonstyle" OnClick="btnCl_Click"/&gt;&amp;lt;/td&gt;  &lt;br /&gt; &amp;lt;td colspan="3"&gt;&lt;br /&gt;     &amp;lt;asp:Button ID="btnEqual" runat="server" Text="="  CssClass="buttonstyle" OnClick="Operator_Click"/&gt;&amp;lt;/td&gt;    &lt;br /&gt; &amp;lt;/tr&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt; &amp;lt;/tbody&gt;&lt;br /&gt;    &lt;br /&gt; &amp;lt;/table&gt;&lt;br /&gt; &amp;lt;/div&gt;&lt;br /&gt; &amp;lt;/form&gt;&lt;br /&gt;&amp;lt;/body&gt;&lt;br /&gt;&amp;lt;/html&gt;&lt;br /&gt;&lt;br /&gt;======================== default.aspx.cs&lt;br /&gt;using System;&lt;br /&gt;using System.Diagnostics; // needed for "Debug" class&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Web;&lt;br /&gt;using System.Web.UI;&lt;br /&gt;using System.Web.UI.WebControls;&lt;br /&gt;&lt;br /&gt;public partial class _Default : System.Web.UI.Page&lt;br /&gt;{&lt;br /&gt; // define unique integers to identify one of&lt;br /&gt; // {+,-,*,/,=}&lt;br /&gt; protected enum OperatorTypes&lt;br /&gt; {&lt;br /&gt;     UNKNOWN=0,&lt;br /&gt;     ADD = 1,&lt;br /&gt;     SUBTRACT = 2,&lt;br /&gt;     MULT = 3,&lt;br /&gt;     DIVIDE = 4,&lt;br /&gt;     EQUALS = 5&lt;br /&gt; };&lt;br /&gt; protected const double m_initialValue = 0.0;&lt;br /&gt; protected void Page_Load(object sender, EventArgs e)&lt;br /&gt; {&lt;br /&gt;     if (!IsPostBack) // wonna do it when page loads but not every time when we push a button&lt;br /&gt;     {&lt;br /&gt;         InitializeCalculator();&lt;br /&gt;     }&lt;br /&gt; }&lt;br /&gt; protected void InitializeCalculator()&lt;br /&gt; {&lt;br /&gt;     // START: define the session variables&lt;br /&gt;     //&lt;br /&gt;     // Here is why the operator is initially "+".&lt;br /&gt;     // When the user clicks any operator&lt;br /&gt;     // op_new = one of {+,-,*,/,=}&lt;br /&gt;     // then the evaluation of the&lt;br /&gt;     // _previous_ operator (op_prev ) happens and _not_ the one that was just clicked (op_new).&lt;br /&gt;     // Thus, if we want everything to work the same and if we want to save ourselves&lt;br /&gt;     // too much extra specialized initialization-specific code, we can just assume that&lt;br /&gt;     // the very first op_prev was "+" and that the previous result (result_prev) was 0.0.&lt;br /&gt;     // Then , when op_new is clicked, we evaluate&lt;br /&gt;     // result_new = execute(result_prev, op_prev, number);&lt;br /&gt;     // Where "number" is the number the user typed in prior to pressing op_new. "number"&lt;br /&gt;     // got parsed right when we clicked op_new.&lt;br /&gt;     // We could just as well have selected Session["result"] = 1.0 and Session["operator"] = "*"&lt;br /&gt;     // but "+" is simpler and somehow cleaner, avoiding possible rounding errors.&lt;br /&gt;     //&lt;br /&gt;     // In any future discussion, i will call the session variables&lt;br /&gt;     // the "stack", since that is what we kind of do when we&lt;br /&gt;     // store the value on the server side and update it or retrieve it.&lt;br /&gt;     Session["result"] = m_initialValue; // this writes it to the server and gives it a value of 0.0&lt;br /&gt;     Session["operator"] = OperatorTypes.ADD;&lt;br /&gt;&lt;br /&gt;     // END: define the session variables&lt;br /&gt;&lt;br /&gt;     // in order to facilitate the very first parsing of a number&lt;br /&gt;     // down the line, let's put a "0" into the text field.&lt;br /&gt;     // That is how most calculators work and it also&lt;br /&gt;     // puts it in sync with what is in our initial session "result" value.&lt;br /&gt;     InitializeTextDisplay();&lt;br /&gt; }&lt;br /&gt; protected void InitializeTextDisplay()&lt;br /&gt; {&lt;br /&gt;     txtDisplay.Text = m_initialValue.ToString();&lt;br /&gt; }&lt;br /&gt; protected void EmptyTextDisplayIfContainsInitialValue()&lt;br /&gt; {&lt;br /&gt;     if (txtDisplay.Text == m_initialValue.ToString())&lt;br /&gt;     {&lt;br /&gt;         txtDisplay.Text = "";&lt;br /&gt;     }&lt;br /&gt; }&lt;br /&gt; protected void InputNumber_Click(object sender, EventArgs e)&lt;br /&gt; {&lt;br /&gt;     // avoid this scenario from happening:&lt;br /&gt;     // after entering a number, get something like 06, 0555, 000, 0024&lt;br /&gt;     // We dont want such numbers since they may not be parsable, or even if&lt;br /&gt;     // they are, they dont look pretty.&lt;br /&gt;     EmptyTextDisplayIfContainsInitialValue();&lt;br /&gt;&lt;br /&gt;     // the button that is sending the message&lt;br /&gt;     Button b = (Button)sender;&lt;br /&gt;     txtDisplay.Text += b.Text;&lt;br /&gt;&lt;br /&gt; }&lt;br /&gt; protected void Operator_Click(object sender, EventArgs e)&lt;br /&gt; {&lt;br /&gt;     // the button that is sending the message&lt;br /&gt;     Button b = (Button)sender;&lt;br /&gt;     // we could use the ID or we could use the text&lt;br /&gt;&lt;br /&gt;     // START: determine which operator was clicked&lt;br /&gt;     //&lt;br /&gt;     // FYI: Equals() operator more optimized to work with strings, but could have done '==' too&lt;br /&gt;     //&lt;br /&gt;     OperatorTypes op_new = OperatorTypes.UNKNOWN;&lt;br /&gt;     if (b.ID.Equals("btnAdd"))&lt;br /&gt;     {&lt;br /&gt;         op_new = OperatorTypes.ADD;&lt;br /&gt;     }&lt;br /&gt;     else if (b.ID.Equals("btnSubtract"))&lt;br /&gt;     {&lt;br /&gt;         op_new = OperatorTypes.SUBTRACT;&lt;br /&gt;     }&lt;br /&gt;     else if (b.ID.Equals("btnMult"))&lt;br /&gt;     {&lt;br /&gt;         op_new = OperatorTypes.MULT;&lt;br /&gt;     }&lt;br /&gt;     else if (b.ID.Equals("btnDiv"))&lt;br /&gt;     {&lt;br /&gt;         op_new = OperatorTypes.DIVIDE;&lt;br /&gt;     }&lt;br /&gt;     else if (b.ID.Equals("btnEqual"))&lt;br /&gt;     {&lt;br /&gt;         op_new = OperatorTypes.EQUALS;&lt;br /&gt;     }&lt;br /&gt;     else&lt;br /&gt;     {&lt;br /&gt;         // this should not happen anyways if we wrote&lt;br /&gt;         // the code correctly.&lt;br /&gt;         op_new = OperatorTypes.UNKNOWN;&lt;br /&gt;     }&lt;br /&gt;&lt;br /&gt;     // for debugging only&lt;br /&gt;     Debug.Write(String.Format("op_new={0}\n", (int)op_new));&lt;br /&gt;&lt;br /&gt;     if (op_new == OperatorTypes.UNKNOWN)&lt;br /&gt;     {&lt;br /&gt;         Exception ex = new Exception("Invalid operator");&lt;br /&gt;         throw ex;&lt;br /&gt;     }&lt;br /&gt;&lt;br /&gt;     // END: determine which operator was clicked&lt;br /&gt;&lt;br /&gt;     // 1. Parse the number which user had entered up to&lt;br /&gt;     // the point of clicking one of the operator buttons.&lt;br /&gt;     double operandNumber = GetNumber();&lt;br /&gt;&lt;br /&gt;     // 2. Get the last result from the stack.&lt;br /&gt;     double result_prev = (double)Session["result"];&lt;br /&gt;&lt;br /&gt;     // 3. Get the operator from the stack.&lt;br /&gt;     // This operator is _not_ the one we just got, but the one&lt;br /&gt;     // entered before user entered &amp;lt;operandNumber&gt;&lt;br /&gt;     OperatorTypes op_prev = (OperatorTypes)Session["operator"];&lt;br /&gt;     Debug.WriteLine("op_prev={0}\n", (int)op_prev);&lt;br /&gt;&lt;br /&gt;     // 4. evaluate the new result based&lt;br /&gt;     // on &amp;lt;result_prev&gt;, &amp;lt;op_prev&gt;, &amp;lt;operandNumber&gt;&lt;br /&gt;     // For instance, if op_prev is "*" (multiplication), then&lt;br /&gt;     //&lt;br /&gt;     // result_new = result_prev * operandNumber&lt;br /&gt;     double result_new = ExecuteOperator(result_prev, op_prev, operandNumber);&lt;br /&gt;     Debug.WriteLine("result_new={0}\n", result_new);&lt;br /&gt;&lt;br /&gt;     // test if the number is wellformed. That can be for one of the following reasons&lt;br /&gt;     // a) divide-by-zero&lt;br /&gt;     // b) overflow (two very large numbers multiplied or a very small one in the denominator)&lt;br /&gt;     // c) perhaps some other reason&lt;br /&gt;     if (double.IsInfinity(result_new) || double.IsNaN(result_new))&lt;br /&gt;     {&lt;br /&gt;         // first reset the calculator since you cannot utilize the result for any future operation&lt;br /&gt;         InitializeCalculator();&lt;br /&gt;&lt;br /&gt;         // throw an exception&lt;br /&gt;         string numberString = string.Format("resulting number = {0} .", result_new);&lt;br /&gt;         Exception ex = new Exception(numberString+ "You either divided by zero or the operands resulted in an out-of-range number");&lt;br /&gt;         throw ex;&lt;br /&gt;     }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;     // 5. put new result on the stack&lt;br /&gt;     Session["result"] = result_new;&lt;br /&gt;&lt;br /&gt;     // 6. put new operator on the stack&lt;br /&gt;     Session["operator"] = op_new;&lt;br /&gt;&lt;br /&gt;     // 7. display the new result&lt;br /&gt;     if (op_new == OperatorTypes.EQUALS)&lt;br /&gt;     {&lt;br /&gt;         // return result to text box&lt;br /&gt;         txtDisplay.Text = result_new.ToString();&lt;br /&gt;     }&lt;br /&gt;     else&lt;br /&gt;     {&lt;br /&gt;         // as shown in the programming assignment specification,&lt;br /&gt;         // ("and clear it to make it ready for the next entry")&lt;br /&gt;         // clear the text (even though that is not the typical&lt;br /&gt;         // calculator behavior i think. the typical calculator&lt;br /&gt;         // shows the intermittent result and only clears after&lt;br /&gt;         // you press the first digit of&lt;br /&gt;         // the new number you are about to enter)&lt;br /&gt;         InitializeTextDisplay();&lt;br /&gt;     }&lt;br /&gt; }&lt;br /&gt; protected double GetNumber()&lt;br /&gt; {&lt;br /&gt;     // double number = double.Parse(txtDisplay.Text);&lt;br /&gt;     double number = 0;&lt;br /&gt;     bool isDouble = double.TryParse(txtDisplay.Text, out number);&lt;br /&gt;     if (isDouble == false)&lt;br /&gt;     {&lt;br /&gt;         txtDisplay.Text = "";&lt;br /&gt;         Exception ex = new Exception("Only enter valid numbers");&lt;br /&gt;         throw ex;&lt;br /&gt;     }&lt;br /&gt;     return number;&lt;br /&gt; }&lt;br /&gt; // Perform the operation&lt;br /&gt; // returnvalue = result_old op num&lt;br /&gt; // e.g. if op=OperatorTypes.ADD&lt;br /&gt; // you will get&lt;br /&gt; // returnvalue = result_old + num&lt;br /&gt; protected double ExecuteOperator(&lt;br /&gt;     double result_old,&lt;br /&gt;     OperatorTypes op,&lt;br /&gt;     double num&lt;br /&gt;     )&lt;br /&gt; {&lt;br /&gt;     double result = result_old; // default in case of an invalid operator&lt;br /&gt;     switch (op)&lt;br /&gt;     {&lt;br /&gt;         case OperatorTypes.ADD:&lt;br /&gt;             result = result_old + num;&lt;br /&gt;             break;&lt;br /&gt;         case OperatorTypes.SUBTRACT:&lt;br /&gt;             result = result_old - num;&lt;br /&gt;             break;&lt;br /&gt;         case OperatorTypes.MULT:&lt;br /&gt;             result = result_old * num;&lt;br /&gt;             break;&lt;br /&gt;         case OperatorTypes.DIVIDE:&lt;br /&gt;             result = result_old / num;&lt;br /&gt;             break;&lt;br /&gt;         case OperatorTypes.EQUALS:&lt;br /&gt;             result = result_old;&lt;br /&gt;             break;&lt;br /&gt;         default:&lt;br /&gt;             result = result_old;&lt;br /&gt;             break;&lt;br /&gt;     }&lt;br /&gt;     return result;&lt;br /&gt; }&lt;br /&gt; protected void btnDel_Click(object sender, EventArgs e)&lt;br /&gt; {&lt;br /&gt;     // as specified in the assignment&lt;br /&gt;     // have a "clear" button to clear the textbox.&lt;br /&gt;     InitializeTextDisplay();&lt;br /&gt; }&lt;br /&gt; protected void btnCl_Click(object sender, EventArgs e)&lt;br /&gt; {&lt;br /&gt;     // if we dont have a CLEAR button to reset everything,&lt;br /&gt;     // I found that funky things happen where the operators&lt;br /&gt;     // stop doing the right things after clicking a certain&lt;br /&gt;     // combination of equal sign and operators etc.&lt;br /&gt;     // Thus we must have a way to clear all memory and reset&lt;br /&gt;     // the stack to the beginning of what it was when the calculator&lt;br /&gt;     // first started.&lt;br /&gt;     InitializeCalculator();&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-63971361878668903?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/63971361878668903/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2012/01/calculator-examplses.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/63971361878668903'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/63971361878668903'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2012/01/calculator-examplses.html' title='Calculator Examples'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-1347334523192617181</id><published>2012-01-25T11:16:00.001-08:00</published><updated>2012-01-25T11:16:34.207-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC222'/><title type='text'>Joins</title><content type='html'>&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;use CommunityAssist&lt;br /&gt;&lt;br /&gt;Select LastName, Firstname, Street, [State], City, Zip&lt;br /&gt;From Person&lt;br /&gt;Inner Join PersonAddress&lt;br /&gt;ON Person.PersonKey=PersonAddress.PersonKey&lt;br /&gt;&lt;br /&gt;--&lt;br /&gt;Select LastName, Firstname, Street, [State], City, Zip, ContactInfo&lt;br /&gt;From Person, PersonAddress, personContact&lt;br /&gt;WHERE Person.PersonKey=PersonAddress.PersonKey&lt;br /&gt;AND Person.PersonKey=PersonContact.PersonKey&lt;br /&gt;&lt;br /&gt;Select p.PersonKey, LastName, Firstname, Street, [State], City, Zip&lt;br /&gt;From Person p&lt;br /&gt;Inner Join PersonAddress pa&lt;br /&gt;ON p.PersonKey=pa.PersonKey&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Select LastName, Firstname, Hiredate, Dependents, Street, City,&lt;br /&gt;[State], Zip&lt;br /&gt;From Person p&lt;br /&gt;inner join Employee e&lt;br /&gt;on p.PersonKey=e.PersonKey&lt;br /&gt;inner join PersonAddress pa&lt;br /&gt;on p.PersonKey=pa.PersonKey&lt;br /&gt;&lt;br /&gt;select LastName, City&lt;br /&gt;From Person&lt;br /&gt;Cross join PersonAddress&lt;br /&gt;&lt;br /&gt;Select ServiceName, GrantKey&lt;br /&gt;From [Service] s&lt;br /&gt;left outer join ServiceGrant sg&lt;br /&gt;On s.ServiceKey=sg.ServiceKey&lt;br /&gt;Where GrantKey is Null&lt;br /&gt;&lt;br /&gt;Select ServiceName, GrantKey&lt;br /&gt;From [Service] s&lt;br /&gt;inner join ServiceGrant sg&lt;br /&gt;on sg.GrantKey &gt; s.ServiceKey&lt;br /&gt;&lt;br /&gt;--a self join joins a table with itself&lt;br /&gt;--here is a little script to show &lt;br /&gt;--an example&lt;br /&gt;&lt;br /&gt;Create Database sample&lt;br /&gt;GO&lt;br /&gt;Use sample&lt;br /&gt;Go&lt;br /&gt;Create table Employee&lt;br /&gt;(&lt;br /&gt;EmployeeID int Primary key,&lt;br /&gt;lastName varchar(30) not null,&lt;br /&gt;Supervisior int&lt;br /&gt;)&lt;br /&gt;GO&lt;br /&gt;Insert into Employee&lt;br /&gt;Values(1,'Smith', 3)&lt;br /&gt;Insert into Employee&lt;br /&gt;Values(2,'Rogers', 3)&lt;br /&gt;Insert into Employee&lt;br /&gt;Values(3,'Johnson', null)&lt;br /&gt;Insert into Employee&lt;br /&gt;Values(4,'Larson', 2)&lt;br /&gt;Insert into Employee&lt;br /&gt;Values(5,'Standish', 3)&lt;br /&gt;&lt;br /&gt;Select * from Employee&lt;br /&gt;--the self join&lt;br /&gt;Select e.LastName as employee, s.Lastname as supervisor&lt;br /&gt;From employee e&lt;br /&gt;Inner join employee s&lt;br /&gt;on s.employeeid=e.supervisior &lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-1347334523192617181?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/1347334523192617181/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2012/01/joins.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/1347334523192617181'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/1347334523192617181'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2012/01/joins.html' title='Joins'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-1263534704999839661</id><published>2012-01-24T12:08:00.000-08:00</published><updated>2012-01-26T14:54:06.196-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC172'/><title type='text'>ADO</title><content type='html'>&lt;p&gt;The database scripts can be found on the syllabus. Here is a description of how to run the scripts with SQL Server Express through visual Studio&lt;/p&gt;&lt;p&gt;&lt;a href="http://congeritc.blogspot.com/2011/02/running-sql-scripts-in-visual-studio.html"&gt;Running SQL scripts through Visual Studio&lt;/a&gt;&lt;/p&gt;&lt;b&gt;Default.Aspx&lt;/b&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;%@ Page Language="C#" AutoEventWireup="true" &lt;br /&gt;CodeFile="Default.aspx.cs" Inherits="_Default" %&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 &lt;br /&gt;Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;&lt;br /&gt;&amp;lt;head runat="server"&gt;&lt;br /&gt;    &amp;lt;title&gt;&amp;lt;/title&gt;&lt;br /&gt;&amp;lt;/head&gt;&lt;br /&gt;&amp;lt;body&gt;&lt;br /&gt;    &amp;lt;form id="form1" runat="server"&gt;&lt;br /&gt;    &amp;lt;div&gt;&lt;br /&gt;        &amp;lt;asp:DropDownList ID="DropDownList1" runat="server"&gt;&lt;br /&gt;        &amp;lt;/asp:DropDownList&gt;&lt;br /&gt;&lt;br /&gt;        &amp;lt;asp:GridView ID="GridView1" runat="server"&gt;&lt;br /&gt;        &amp;lt;/asp:GridView&gt;&lt;br /&gt;    &amp;lt;/div&gt;&lt;br /&gt;    &amp;lt;asp:Button ID="Button1" runat="server" onclick="Button1_Click" &lt;br /&gt;        Text="Get Donations" /&gt;&lt;br /&gt;    &amp;lt;/form&gt;&lt;br /&gt;&amp;lt;/body&gt;&lt;br /&gt;&amp;lt;/html&gt;&lt;br /&gt;&lt;/pre&gt;&lt;b&gt;Default.aspx.cs&lt;/b&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Web;&lt;br /&gt;using System.Web.UI;&lt;br /&gt;using System.Web.UI.WebControls;&lt;br /&gt;using System.Data;&lt;br /&gt;using System.Data.SqlClient;&lt;br /&gt;&lt;br /&gt;public partial class _Default : System.Web.UI.Page&lt;br /&gt;{&lt;br /&gt;    protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;    {&lt;br /&gt;        if (!IsPostBack)&lt;br /&gt;        {&lt;br /&gt;            SqlConnection connect = new SqlConnection &lt;br /&gt;("Data Source=localhost;initial catalog=communityassist;integrated security=true");&lt;br /&gt;&lt;br /&gt;            //SqlConnection connect = new SqlConnection &lt;br /&gt;("Data Source=localhost;initial catalog=communityassist;user=manager;password=p@ssw0rd1");&lt;br /&gt;&lt;br /&gt;            //SqlConnection connect2 = new SqlConnection();&lt;br /&gt;            //SqlConnectionStringBuilder builder=new SqlConnectionStringBuilder();&lt;br /&gt;            //builder.DataSource = "localhost";&lt;br /&gt;            //builder.InitialCatalog = "community assist";&lt;br /&gt;&lt;br /&gt;            string sql = "Select Distinct DonationDate from donation";&lt;br /&gt;&lt;br /&gt;            SqlCommand cmd = new SqlCommand(sql, connect);&lt;br /&gt;&lt;br /&gt;            DataSet ds = new DataSet();&lt;br /&gt;&lt;br /&gt;            SqlDataAdapter da = new SqlDataAdapter(cmd);&lt;br /&gt;&lt;br /&gt;            da.Fill(ds, "Donations");&lt;br /&gt;&lt;br /&gt;            DropDownList1.DataSource = ds.Tables["Donations"];&lt;br /&gt;            DropDownList1.DataTextField= "DonationDate";&lt;br /&gt;            DropDownList1.DataBind();&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;    }&lt;br /&gt;    protected void Button1_Click(object sender, EventArgs e)&lt;br /&gt;    {&lt;br /&gt;         //ado objects&lt;br /&gt;&lt;br /&gt;        SqlConnection connect = new SqlConnection&lt;br /&gt;("Data Source=localhost;initial catalog=communityassist;integrated security=true");&lt;br /&gt;&lt;br /&gt;        //SqlConnection connect2 = new SqlConnection();&lt;br /&gt;        //SqlConnectionStringBuilder builder=new SqlConnectionStringBuilder();&lt;br /&gt;        //builder.DataSource = "localhost";&lt;br /&gt;        //builder.InitialCatalog = "community assist";&lt;br /&gt;&lt;br /&gt;        string sql = "Select DonationDate, DonationAmount from donation Where DonationDate=@date";&lt;br /&gt;&lt;br /&gt;        SqlCommand cmd = new SqlCommand(sql, connect);&lt;br /&gt;        cmd.Parameters.AddWithValue("@date", DateTime.Parse(DropDownList1.SelectedItem.ToString()));&lt;br /&gt;&lt;br /&gt;        DataSet ds = new DataSet();&lt;br /&gt;&lt;br /&gt;        SqlDataAdapter da = new SqlDataAdapter(cmd);&lt;br /&gt;&lt;br /&gt;        da.Fill(ds,"Donations");&lt;br /&gt;&lt;br /&gt;        GridView1.DataSource = ds.Tables["Donations"];&lt;br /&gt;        GridView1.DataBind();&lt;br /&gt;&lt;br /&gt;         &lt;br /&gt;       &lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-1263534704999839661?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/1263534704999839661/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2012/01/default.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/1263534704999839661'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/1263534704999839661'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2012/01/default.html' title='ADO'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-8669997546337146140</id><published>2012-01-23T10:46:00.001-08:00</published><updated>2012-01-23T11:34:50.214-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC222'/><title type='text'>Aggregate Functions</title><content type='html'>Here is the in-class code for Aggregate Functions&lt;pre&gt;&lt;br /&gt;Use CommunityAssist &lt;br /&gt;&lt;br /&gt;--aggregate function&lt;br /&gt;&lt;br /&gt;Select COUNT(PersonKey) "Number of Donations"&lt;br /&gt;From Donation&lt;br /&gt;&lt;br /&gt;--DISTINCT will return only unique values -- in the following&lt;br /&gt;--it returns only unique persons for donors&lt;br /&gt;Select COUNT(Distinct PersonKey) [Number of Donors]&lt;br /&gt;From Donation&lt;br /&gt;&lt;br /&gt;Select SUM(donationAmount) [total donations]&lt;br /&gt;From Donation&lt;br /&gt;&lt;br /&gt;Select Avg(donationAmount) "Average"&lt;br /&gt;From Donation&lt;br /&gt;&lt;br /&gt;Select MAX(donationAmount) "Highest"&lt;br /&gt;From Donation&lt;br /&gt;&lt;br /&gt;Select MiN(donationAmount) "Highest"&lt;br /&gt;From Donation&lt;br /&gt;&lt;br /&gt;--if you have an aggregate function in the SELECT&lt;br /&gt;--any other column in the SELECT not a part of an &lt;br /&gt;--aggregate function must be contained in a&lt;br /&gt;--GROUP BY clause&lt;br /&gt;Select EmployeeKey, COUNT(DonationKey) "Count",&lt;br /&gt;sum(DonationAmount) as Total&lt;br /&gt;From Donation&lt;br /&gt;Group by EmployeeKey&lt;br /&gt;&lt;br /&gt;--this does several things:&lt;br /&gt;--MONTH and YEAR are scalar functions&lt;br /&gt;--that means they operate on one row at a time&lt;br /&gt;--SUM is an aggreagate function operating on &lt;br /&gt;--multiple rows--so the MONTH and YEARfunctions&lt;br /&gt;--must be contained in a group by clause&lt;br /&gt;--the aliases don't work, you must do the functions&lt;br /&gt;--themselves&lt;br /&gt;--if you have an aggergate function in your &lt;br /&gt;--criteria you must use HAVING instead of WHERE&lt;br /&gt;--you can use both in a query as in the example below&lt;br /&gt;--the WHERE comes after the FROM&lt;br /&gt;--the HAVING comes after the GROUP BY&lt;br /&gt;&lt;br /&gt;Select MONTH(DonationDate) [Month], Year(DonationDate) [Year],SUM(donationAmount) total&lt;br /&gt;From Donation&lt;br /&gt;Where YEAR(DonationDate)=2010&lt;br /&gt;Group by Year(donationDate), Month(DonationDate)&lt;br /&gt;having SUM(donationAmount) &gt; 3000&lt;br /&gt;&lt;/pre&gt;&lt;hr/&gt;Here is a solution to the substring problem where it wouldn't return single worded entries. The problem was it was looking for a space and none existed. The solution, if inelegant is to concatenate  in a space within the charIndex function so that every column has a trailing space.&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;Select SUBSTRING(VehicleMake, 1, CHARINDEX(' ', VehicleMake+' ', 1))&lt;br /&gt;From Customer.Vehicle&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-8669997546337146140?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/8669997546337146140/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2012/01/aggregate-functions.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/8669997546337146140'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/8669997546337146140'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2012/01/aggregate-functions.html' title='Aggregate Functions'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-870799082355705183</id><published>2012-01-12T12:15:00.000-08:00</published><updated>2012-01-12T15:06:32.281-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC172'/><title type='text'>Calculator with Addition</title><content type='html'>&lt;p&gt;Here is the calculator. I want to mention that when you do multiplication and division you will have to use a somewhat different pattern. There is only a zero in the session variable when you click the operator. That results in the final answer also equaling zero or infinity. Try to figure out how to do these, if you can and we will look at it again on Tuesday.&lt;/p&gt;&lt;strong&gt;Default.aspx&lt;/strong&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;%@ Page Language="C#" AutoEventWireup="true" &lt;br /&gt;CodeFile="Default.aspx.cs" Inherits="_Default" %&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 &lt;br /&gt;Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;&lt;br /&gt;&amp;lt;head runat="server"&gt;&lt;br /&gt;    &amp;lt;title&gt;Calculator&amp;lt;/title&gt;&lt;br /&gt;    &amp;lt;link href="calculator.css" rel="stylesheet" type="text/css" /&gt;&lt;br /&gt;&amp;lt;/head&gt;&lt;br /&gt;&amp;lt;body&gt;&lt;br /&gt;    &amp;lt;form id="form1" runat="server"&gt;&lt;br /&gt;    &amp;lt;div&gt;&lt;br /&gt;    &amp;lt;table&gt;&lt;br /&gt;    &amp;lt;tbody&gt;&lt;br /&gt;    &amp;lt;tr&gt;&lt;br /&gt;    &amp;lt;td colspan="4"&gt;&lt;br /&gt;        &amp;lt;asp:TextBox ID="txtDisplay" runat="server"&gt;&amp;lt;/asp:TextBox&gt;&amp;lt;/td&gt;&lt;br /&gt;    &lt;br /&gt;    &amp;lt;/tr&gt;&lt;br /&gt;    &amp;lt;tr&gt;&lt;br /&gt;    &amp;lt;td&gt;&lt;br /&gt;        &amp;lt;asp:Button ID="Button1" runat="server" Text="7" &lt;br /&gt;CssClass="buttonstyle" OnClick="InputNumber_Click" /&gt;&amp;lt;/td&gt;&lt;br /&gt;    &amp;lt;td&gt;&lt;br /&gt;        &amp;lt;asp:Button ID="Button2" runat="server" Text="8" &lt;br /&gt;CssClass="buttonstyle" OnClick="InputNumber_Click"/&gt;&amp;lt;/td&gt;&lt;br /&gt;    &amp;lt;td&gt;&lt;br /&gt;        &amp;lt;asp:Button ID="Button3" runat="server" Text="9" &lt;br /&gt;CssClass="buttonstyle" OnClick="InputNumber_Click"/&gt;&amp;lt;/td&gt;&lt;br /&gt;    &amp;lt;td&gt;&lt;br /&gt;        &amp;lt;asp:Button ID="btnAdd" runat="server" Text="+" &lt;br /&gt;CssClass="buttonstyle" OnClick="Operator_Click"/&gt;&amp;lt;/td&gt;&lt;br /&gt;    &amp;lt;/tr&gt;&lt;br /&gt;    &amp;lt;tr&gt;&lt;br /&gt;    &amp;lt;td&gt;&lt;br /&gt;        &amp;lt;asp:Button ID="Button5" runat="server" Text="4" &lt;br /&gt;CssClass="buttonstyle" OnClick="InputNumber_Click"/&gt;&amp;lt;/td&gt;&lt;br /&gt;    &amp;lt;td&gt;&lt;br /&gt;        &amp;lt;asp:Button ID="Button6" runat="server" Text="5" &lt;br /&gt;CssClass="buttonstyle" OnClick="InputNumber_Click"/&gt;&amp;lt;/td&gt;&lt;br /&gt;    &amp;lt;td&gt;&lt;br /&gt;        &amp;lt;asp:Button ID="Button7" runat="server" Text="6" &lt;br /&gt;CssClass="buttonstyle" OnClick="InputNumber_Click"/&gt;&amp;lt;/td&gt;&lt;br /&gt;    &amp;lt;td&gt;&lt;br /&gt;        &amp;lt;asp:Button ID="btnSubtract" runat="server" Text="-" &lt;br /&gt;CssClass="buttonstyle" OnClick="Operator_Click" /&gt;&amp;lt;/td&gt;&lt;br /&gt;    &amp;lt;/tr&gt;&lt;br /&gt;    &amp;lt;tr&gt;&lt;br /&gt;    &amp;lt;td&gt;&lt;br /&gt;        &amp;lt;asp:Button ID="Button9" runat="server" Text="1" &lt;br /&gt;CssClass="buttonstyle" OnClick="InputNumber_Click"/&gt;&amp;lt;/td&gt;&lt;br /&gt;    &amp;lt;td&gt;&lt;br /&gt;        &amp;lt;asp:Button ID="Button10" runat="server" Text="2" &lt;br /&gt;CssClass="buttonstyle" OnClick="InputNumber_Click"/&gt;&amp;lt;/td&gt;&lt;br /&gt;    &amp;lt;td&gt;&lt;br /&gt;        &amp;lt;asp:Button ID="Button11" runat="server" Text="3" &lt;br /&gt;CssClass="buttonstyle" OnClick="InputNumber_Click"/&gt;&amp;lt;/td&gt;&lt;br /&gt;    &amp;lt;td&gt;&lt;br /&gt;        &amp;lt;asp:Button ID="btnMult" runat="server" Text="*" &lt;br /&gt;CssClass="buttonstyle" OnClick="Operator_Click"/&gt;&amp;lt;/td&gt;&lt;br /&gt;    &amp;lt;/tr&gt;&lt;br /&gt;    &amp;lt;tr&gt;&lt;br /&gt;    &amp;lt;td&gt;&lt;br /&gt;        &amp;lt;asp:Button ID="btnDel" runat="server" Text="Del" &lt;br /&gt;CssClass="buttonstyle"/&gt;&amp;lt;/td&gt;&lt;br /&gt;    &amp;lt;td&gt;&lt;br /&gt;        &amp;lt;asp:Button ID="Button14" runat="server" Text="0" &lt;br /&gt;CssClass="buttonstyle" OnClick="InputNumber_Click"/&gt;&amp;lt;/td&gt;&lt;br /&gt;    &amp;lt;td&gt;&lt;br /&gt;        &amp;lt;asp:Button ID="Button15" runat="server" Text="." &lt;br /&gt;CssClass="buttonstyle" OnClick="InputNumber_Click"/&gt;&amp;lt;/td&gt;&lt;br /&gt;    &amp;lt;td&gt;&lt;br /&gt;        &amp;lt;asp:Button ID="btnDiv" runat="server" Text="/" &lt;br /&gt;CssClass="buttonstyle" OnClick="Operator_Click"/&gt;&amp;lt;/td&gt;&lt;br /&gt;    &amp;lt;/tr&gt;&lt;br /&gt;    &amp;lt;tr&gt;&lt;br /&gt;   &lt;br /&gt;    &amp;lt;td colspan="4"&gt;&lt;br /&gt;        &amp;lt;asp:Button ID="btnEqual" runat="server" Text="=" &lt;br /&gt;CssClass="buttonstyle" OnClick="Operator_Click"/&gt;&amp;lt;/td&gt;&lt;br /&gt;    &amp;lt;/tr&gt;&lt;br /&gt;    &amp;lt;/tbody&gt;&lt;br /&gt;    &amp;lt;/table&gt;&lt;br /&gt;    &amp;lt;/div&gt;&lt;br /&gt;    &amp;lt;/form&gt;&lt;br /&gt;&amp;lt;/body&gt;&lt;br /&gt;&amp;lt;/html&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;hr/&gt;&lt;strong&gt;Default.aspx.cs&lt;/strong&gt;&lt;pre&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Web;&lt;br /&gt;using System.Web.UI;&lt;br /&gt;using System.Web.UI.WebControls;&lt;br /&gt;&lt;br /&gt;public partial class _Default : System.Web.UI.Page&lt;br /&gt;{&lt;br /&gt;    protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;    {&lt;br /&gt;        if (!IsPostBack)&lt;br /&gt;        {&lt;br /&gt;            Session["result"] = 0.0;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;    }&lt;br /&gt;    protected void InputNumber_Click(object sender, EventArgs e)&lt;br /&gt;    {&lt;br /&gt;        Button b = (Button)sender;&lt;br /&gt;        txtDisplay.Text += b.Text;&lt;br /&gt;    }&lt;br /&gt;    protected void Operator_Click(object sender, EventArgs e)&lt;br /&gt;    {&lt;br /&gt;        Button b = (Button)sender;&lt;br /&gt;&lt;br /&gt;        if (b.ID.Equals("btnAdd"))&lt;br /&gt;        {&lt;br /&gt;            Addition();&lt;br /&gt;            Session["operator"] = "+";&lt;br /&gt;        }&lt;br /&gt;        if(b.ID.Equals("btnEqual"))&lt;br /&gt;        {&lt;br /&gt;            Calculate();&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    protected void Addition()&lt;br /&gt;    {&lt;br /&gt;       &lt;br /&gt;        try&lt;br /&gt;        {&lt;br /&gt;            double num = GetNumber();&lt;br /&gt;            double numResult = (double)Session["result"];&lt;br /&gt;            Session["result"] = num + numResult;&lt;br /&gt;            txtDisplay.Text = "";&lt;br /&gt;        }&lt;br /&gt;        catch(Exception ex)&lt;br /&gt;        {&lt;br /&gt;            Response.Write(ex.Message);&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    protected double GetNumber()&lt;br /&gt;    {&lt;br /&gt;       &lt;br /&gt;        double number =0;&lt;br /&gt;        bool isDouble = double.TryParse(txtDisplay.Text, out number);&lt;br /&gt;        if (isDouble == false)&lt;br /&gt;        {&lt;br /&gt;            txtDisplay.Text = "";&lt;br /&gt;            Exception ex = new Exception("Only enter valid numbers");&lt;br /&gt;            throw ex;&lt;br /&gt;        }&lt;br /&gt;        return number;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    protected void Calculate()&lt;br /&gt;    {&lt;br /&gt;        double number = (double)Session["result"];&lt;br /&gt;        double number2 = GetNumber();&lt;br /&gt;        if (Session["operator"].ToString().Equals("+"))&lt;br /&gt;        {&lt;br /&gt;            txtDisplay.Text = (number + number2).ToString();&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;hr/&gt;&lt;strong&gt;Calculator.css&lt;/strong&gt;&lt;pre&gt;&lt;br /&gt;body {&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;.buttonstyle&lt;br /&gt;{&lt;br /&gt;    width:50px;&lt;br /&gt;    &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;#txtDisplay&lt;br /&gt;{&lt;br /&gt;    text-align:right;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-870799082355705183?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/870799082355705183/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2012/01/claculator-with-addition.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/870799082355705183'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/870799082355705183'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2012/01/claculator-with-addition.html' title='Calculator with Addition'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-5261736523286797081</id><published>2012-01-11T11:54:00.001-08:00</published><updated>2012-01-11T11:55:01.060-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC222'/><title type='text'>SQL Functions</title><content type='html'>&lt;pre&gt;&lt;br /&gt;--concatination&lt;br /&gt;&lt;br /&gt;Select (Lastname + ', ' + firstname) as [Person Name]&lt;br /&gt;From Person&lt;br /&gt;&lt;br /&gt;-- Operators&lt;br /&gt;Select DonationAmount, DonationAmount * .85 as [Charity]&lt;br /&gt;From Donation&lt;br /&gt;&lt;br /&gt;Select * From Donation&lt;br /&gt;Select YEAR(DonationDate) as [Year] From Donation&lt;br /&gt;Select MONTH(DonationDate) as [Month] from Donation&lt;br /&gt;Select  Distinct Day(DonationDate) as [Day] from Donation&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Select DATEPART(MM,DonationDate) From Donation&lt;br /&gt;Select DatePart(hh,DonationDate) as [Month] from Donation&lt;br /&gt;&lt;br /&gt;Select DATEDIFF(DD,'12/31/2011', GETDATE())&lt;br /&gt;Select DateAdd(YY, 5, GETDATE())&lt;br /&gt;&lt;br /&gt;Select * from PersonAddress&lt;br /&gt;&lt;br /&gt;Select CHARINDEX(Street, ' ') From PersonAddress&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Select SUBSTRING(Street, 1, 10) &lt;br /&gt;From PersonAddress&lt;br /&gt;&lt;br /&gt;Select SUBSTRING(Street, 1, charindex(' ', Street)) &lt;br /&gt;From PersonAddress&lt;br /&gt;&lt;br /&gt;Select * From Donation&lt;br /&gt;Select '$' +CAST( DonationAmount as Varchar) as Amount from Donation&lt;br /&gt;&lt;br /&gt;Select '(' + SUBSTRING(ContactInfo, 1,3) + ')' &lt;br /&gt;From PersonContact &lt;br /&gt;Where ContactTypeKey !=6&lt;br /&gt;&lt;br /&gt;Select '$' +CAST(( DonationAmount * .85) as Varchar) as CharityAmount from Donation&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-5261736523286797081?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/5261736523286797081/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2012/01/sql-functions.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/5261736523286797081'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/5261736523286797081'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2012/01/sql-functions.html' title='SQL Functions'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-1588972953838596240</id><published>2012-01-09T11:57:00.000-08:00</published><updated>2012-01-09T11:57:58.703-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC222'/><title type='text'>SQL SELECT</title><content type='html'>&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;Use CommunityAssist&lt;br /&gt;&lt;br /&gt;Select Lastname, Firstname &lt;br /&gt;From Person;&lt;br /&gt;&lt;br /&gt;Select * From Person&lt;br /&gt;&lt;br /&gt;Select lastname as [Last Name], &lt;br /&gt;Firstname as [First Name]&lt;br /&gt;From Person&lt;br /&gt;&lt;br /&gt;--if there are no special characters or spaces&lt;br /&gt;--you don't need brackets&lt;br /&gt;Select lastname Surname, &lt;br /&gt;Firstname Name&lt;br /&gt;From Person&lt;br /&gt;&lt;br /&gt;/*this is a multi line&lt;br /&gt;comment */&lt;br /&gt;&lt;br /&gt;Select Distinct PersonKey from Donation&lt;br /&gt;Order by PersonKey Desc&lt;br /&gt;&lt;br /&gt;Select * from Donation&lt;br /&gt;Order by donationAmount Desc&lt;br /&gt;&lt;br /&gt;Select * from Donation&lt;br /&gt;Order by 3 Desc&lt;br /&gt;&lt;br /&gt;Select Top 10 DonationKey, DonationAmount&lt;br /&gt;From Donation&lt;br /&gt;Order by DonationAmount Desc&lt;br /&gt;&lt;br /&gt;Select DonationKey, donationAmount&lt;br /&gt;From Donation&lt;br /&gt;Where DonationAmount &gt; 1000&lt;br /&gt;&lt;br /&gt;-- &gt; &lt; &gt;= &lt;= != &lt;&gt;&lt;br /&gt;&lt;br /&gt;Select * From PersonAddress&lt;br /&gt;Where City='Seattle'&lt;br /&gt;&lt;br /&gt;Select * From PersonAddress&lt;br /&gt;Where not City='Seattle'&lt;br /&gt;&lt;br /&gt;Select * from Donation&lt;br /&gt;Where DonationDate='2/2/2010'&lt;br /&gt;&lt;br /&gt;Select * from Donation&lt;br /&gt;Where DonationDate between '2/2/2010' And '2/6/2010'&lt;br /&gt;&lt;br /&gt;Select * From PersonAddress&lt;br /&gt;Where City='Kent' or City='Bellevue'&lt;br /&gt;&lt;br /&gt;Select * From PersonContact&lt;br /&gt;Where ContactInfo LIKE '306%'&lt;br /&gt;-- _ for a single character ITC22_ 220 222 224 226&lt;br /&gt;&lt;br /&gt;Select * From Donation&lt;br /&gt;Where EmployeeKey in (3, 4, 5)&lt;br /&gt;&lt;br /&gt;Select * from PersonAddress&lt;br /&gt;Where Apartment is Not Null&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-1588972953838596240?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/1588972953838596240/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2012/01/sql-select.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/1588972953838596240'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/1588972953838596240'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2012/01/sql-select.html' title='SQL SELECT'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-204079843257040180</id><published>2012-01-08T14:18:00.001-08:00</published><updated>2012-02-08T10:03:07.055-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC222'/><title type='text'>ITC 222 assignment six</title><content type='html'>&lt;p class='bloggerplus_text_section' align='left' style='clear:both;'&gt;&lt;h2&gt;Insert, Update, Delete&lt;/h2&gt;&lt;br&gt;&lt;h3&gt;Problems&lt;/h3&gt;&lt;br&gt;1-5 Insert the following new customer, his vehicle, and the services provided. He is not going to become a registered customer at this time. (This will require multiple insert statements. You will also need to look up the automatically generate keys to use as foreign keys.)&lt;br&gt;&lt;br&gt;Jay Russell, license BFM349, Ford Fusion, 2011, at the new Tacoma shop. He got an oil change and new windshield wipers.&lt;br&gt;&lt;br&gt;6. Registered customer 7 has a new email address. Change it to "laura26@yahoo.com" change the password to "moonshine"&lt;br&gt;&lt;br&gt;7. Change the price of auto service 12 to $110.90&lt;br&gt;&lt;br&gt;8. Delete AutoserviceDetailID 80 from vehicle service detail.&lt;br&gt;&lt;br&gt;&lt;hr/&gt;&lt;br&gt;&lt;h3&gt;What I am Looking for&lt;/h3&gt;&lt;br&gt;The insert requires some effort. Not only do you have to do multiple insert statements, you also have to look up vales, and the inserts must be done in the correct order. 1through 5 are wort 7 points. The others are worth 1 point each, though they are not without their dangers&lt;br&gt;&lt;hr/&gt;&lt;br&gt;&lt;h3&gt;To Turn In&lt;/h3&gt;&lt;br&gt;Copy the SQL code to a Google doc and share it with spconger@gmail.com&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-204079843257040180?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/204079843257040180/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2012/01/itc-222-assignment-six.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/204079843257040180'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/204079843257040180'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2012/01/itc-222-assignment-six.html' title='ITC 222 assignment six'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-3760567944334526474</id><published>2012-01-07T15:28:00.001-08:00</published><updated>2012-01-07T15:28:49.771-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC222'/><title type='text'>ITC 222 Assignment Five</title><content type='html'> &lt;p class='bloggerplus_text_section' align='left' style='clear:both;'&gt;&lt;h2&gt;Sub Queries&lt;/h2&gt;&lt;br&gt;&lt;hr/&gt;&lt;br&gt;&lt;h3&gt;Problems&lt;/h3&gt;&lt;br&gt;For each of these problems use subqueries for all parts of the problem, even though joins may make more sense to you.&lt;br&gt;&lt;br&gt;1. List the name and price of the service with the maximum price.&lt;br&gt;&lt;br&gt;2. Get a list of the first and last names of every person who is an employee.&lt;br&gt;&lt;br&gt;3. Get a list of all the employee supervisors.&lt;br&gt;&lt;br&gt;4. List the name of every person who is not a registered customer.&lt;br&gt;&lt;br&gt;5. Get the license make and year of every vehicle that has been served. Some may appear more than once. You can use DISTINCT to not show duplicates.&lt;br&gt;&lt;br&gt;6. Get the same information as in number five but only for those vehicles that have had service 12 completed on them.&lt;br&gt;&lt;br&gt;7. Now repeat the query above, but include the service name in the select clause. (Remember, no inner joins).&lt;br&gt;&lt;br&gt;8. Get the service price, the average service price and the difference between the two for every service. Sort them in descending order by service price. (This is one that can only be done with subqueries).&lt;br&gt;&lt;br&gt;&lt;hr/&gt;&lt;br&gt;&lt;h3&gt;What I am looking for&lt;/h3&gt;&lt;br&gt;I want only sub queries. 1 through 6 are worth 1 point each. 7 and 8 are worth 2 points each.&lt;br&gt;&lt;hr/&gt;&lt;br&gt;&lt;h3&gt;To Turn in&lt;/h3&gt;&lt;br&gt;Post the SQL in a Google doc. Share it with spconger@gmail.com&lt;br&gt;&lt;br&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-3760567944334526474?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/3760567944334526474/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2012/01/itc-222-assignment-five.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/3760567944334526474'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/3760567944334526474'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2012/01/itc-222-assignment-five.html' title='ITC 222 Assignment Five'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-4379567095411167251</id><published>2012-01-07T14:05:00.000-08:00</published><updated>2012-01-07T14:05:48.043-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC222'/><title type='text'>ITC 222 Assignment 4</title><content type='html'>&lt;h2&gt;Joins&lt;/h2&gt;&lt;hr/&gt;&lt;h3&gt;Inner Joins&lt;/h3&gt;&lt;p&gt;1. Return the names (first and last) and emails of every registered user.&lt;/p&gt;&lt;p&gt;2. Do the same query based on the old style "where" based syntax.&lt;/p&gt;&lt;p&gt;3. List the customer names, the license plate, the vehicle make and year of every registered customer.&lt;/p&gt;&lt;p&gt;4. List the customer name, the license plate, the vehicle make and year and the services provided for the Vehicle service with the ID of 12.&lt;/p&gt;&lt;p&gt;5. List the location names and the names of all the employees that work at those locations.&lt;/p&gt;&lt;h3&gt;Cross Joins&lt;/h3&gt;&lt;p&gt;6. Do a cross join between Person and registered customer. Use the cross Join syntax.&lt;/p&gt;&lt;p&gt;7. Do a cross join using the older syntax&lt;/p&gt;&lt;h3&gt;Outer Joins&lt;/h3&gt;&lt;p&gt;8. List the customers people that do not have a registered customer account.&lt;/p&gt;&lt;p&gt;9. List any location names that has never provided a service for any car&lt;/p&gt;&lt;hr/&gt;&lt;h2&gt;What I am looking for&lt;/h2&gt;&lt;p&gt;I want to see the SQL that would provide the data to the query. Each one is worth 1 pt. with one point for free for a total of 10 points.&lt;/p&gt;&lt;hr/&gt;&lt;h2&gt;To Turn in&lt;/h2&gt;&lt;p&gt;Copy the SQL into a Google doc. Share it with spconger@gmail.com&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-4379567095411167251?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/4379567095411167251/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2012/01/itc-222-assignment-4.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/4379567095411167251'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/4379567095411167251'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2012/01/itc-222-assignment-4.html' title='ITC 222 Assignment 4'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-897528943799808755</id><published>2012-01-05T12:28:00.000-08:00</published><updated>2012-01-05T12:28:22.540-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC172'/><title type='text'>Stuf for the first Assignment</title><content type='html'>&lt;b&gt;Default.aspx&lt;/b&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" &lt;br /&gt;Inherits="_Default"  Trace="false" ViewStateMode="Enabled"%&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 &lt;br /&gt;Transitional//EN" &lt;br /&gt;"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;&lt;br /&gt;&amp;lt;head runat="server"&gt;&lt;br /&gt;    &amp;lt;title&gt;&amp;lt;/title&gt;&lt;br /&gt;&amp;lt;/head&gt;&lt;br /&gt;&amp;lt;body&gt;&lt;br /&gt;    &amp;lt;form id="form1" runat="server"&gt;&lt;br /&gt;    &amp;lt;div&gt;&lt;br /&gt;    &amp;lt;h1&gt;Stuff&amp;lt;/h1&gt;&lt;br /&gt;    &amp;lt;asp:DropDownList ID="DropDownList1" runat="server"&gt;&lt;br /&gt;        &lt;br /&gt;        &amp;lt;/asp:DropDownList&gt;&lt;br /&gt;        &amp;lt;p&gt;&amp;lt;asp:Label ID="Label1" runat="server" Text="Enter Name"&gt;&amp;lt;/asp:Label&gt;&lt;br /&gt;        &amp;lt;asp:TextBox ID="txtName" runat="server"&gt;&amp;lt;/asp:TextBox&gt;&amp;lt;/p&gt;&lt;br /&gt;        &amp;lt;asp:Calendar ID="Calendar1" runat="server"&gt;&amp;lt;/asp:Calendar&gt;&lt;br /&gt;        &lt;br /&gt;    &lt;br /&gt;        &amp;lt;asp:Button ID="btnConfirm" runat="server" Text="Confirm" &lt;br /&gt;            onclick="btnConfirm_Click" /&gt;&lt;br /&gt;        &lt;br /&gt;    &lt;br /&gt;    &amp;lt;/div&gt;&lt;br /&gt;    &amp;lt;/form&gt;&lt;br /&gt;&amp;lt;/body&gt;&lt;br /&gt;&amp;lt;/html&gt;&lt;br /&gt;&lt;/pre&gt;&lt;hr/&gt;&lt;b&gt;Default.aspx.cs&lt;/b&gt;&lt;pre&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Web;&lt;br /&gt;using System.Web.UI;&lt;br /&gt;using System.Web.UI.WebControls;&lt;br /&gt;&lt;br /&gt;public partial class _Default : System.Web.UI.Page&lt;br /&gt;{&lt;br /&gt;    protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;    {&lt;br /&gt;        string[] colors = new string[5];&lt;br /&gt;        colors[0] = "Blue";&lt;br /&gt;        colors[1] = "Green";&lt;br /&gt;        colors[2] = "Red";&lt;br /&gt;        colors[3] = "Yellow";&lt;br /&gt;        colors[4] = "Teal";&lt;br /&gt;&lt;br /&gt;        if (!IsPostBack)&lt;br /&gt;        {&lt;br /&gt;            DropDownList1.DataSource = colors;&lt;br /&gt;            DropDownList1.DataBind();&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        //DropDownList1.Items.Add("Red");&lt;br /&gt;        //DropDownList1.Items.Add("Green");&lt;br /&gt;    }&lt;br /&gt;    protected void btnConfirm_Click(object sender, EventArgs e)&lt;br /&gt;    {&lt;br /&gt;        string name = txtName.Text;&lt;br /&gt;        string date = Calendar1.SelectedDate.ToShortDateString();&lt;br /&gt;        string chosenColor = DropDownList1.SelectedItem.ToString();&lt;br /&gt;&lt;br /&gt;        //Response.Redirect("Confirmation.aspx?name=" &lt;br /&gt;        //    + name+"&amp;date="&lt;br /&gt;        //    +date+"&amp;color="+chosenColor);&lt;br /&gt;&lt;br /&gt;        Session["name"] = name;&lt;br /&gt;        Session["color"]=chosenColor;&lt;br /&gt;        Session["date"] = date;&lt;br /&gt;&lt;br /&gt;        Response.Redirect("Confirmation.aspx");&lt;br /&gt;    }&lt;br /&gt;   &lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;hr/&gt;&lt;b&gt;Confirmation.aspx&lt;/b&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;%@ Page Language="C#" AutoEventWireup="true" CodeFile="Confirmation.aspx.cs" Inherits="Confirmation" %&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;&lt;br /&gt;&amp;lt;head runat="server"&gt;&lt;br /&gt;    &amp;lt;title&gt;&amp;lt;/title&gt;&lt;br /&gt;&amp;lt;/head&gt;&lt;br /&gt;&amp;lt;body&gt;&lt;br /&gt;    &amp;lt;form id="form1" runat="server"&gt;&lt;br /&gt;    &amp;lt;div&gt;&lt;br /&gt;    &amp;lt;h1&gt;Confirmation Page&amp;lt;/h1&gt;&lt;br /&gt;    &amp;lt;/div&gt;&lt;br /&gt;    &amp;lt;asp:Label ID="lblName" runat="server" Text="Label"&gt;&amp;lt;/asp:Label&gt;&amp;lt;br /&gt;&lt;br /&gt;    &amp;lt;asp:Label ID="lblColor" runat="server" Text="Label"&gt;&amp;lt;/asp:Label&gt;&amp;lt;br /&gt;&lt;br /&gt;    &amp;lt;asp:Label ID="lblDate" runat="server" Text="Label"&gt;&amp;lt;/asp:Label&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;/form&gt;&lt;br /&gt;&amp;lt;/body&gt;&lt;br /&gt;&amp;lt;/html&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;hr/&gt;&lt;b&gt;Confirmation.aspx.cs&lt;/b&gt;&lt;pre&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Web;&lt;br /&gt;using System.Web.UI;&lt;br /&gt;using System.Web.UI.WebControls;&lt;br /&gt;&lt;br /&gt;public partial class Confirmation : System.Web.UI.Page&lt;br /&gt;{&lt;br /&gt;    protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;    {&lt;br /&gt;        //lblColor.Text = Request.QueryString["color"];&lt;br /&gt;        //lblName.Text = Request.QueryString["name"];&lt;br /&gt;        //lblDate.Text = Request.QueryString["date"];&lt;br /&gt;        if (Session["color"] != null)&lt;br /&gt;        {&lt;br /&gt;            lblColor.Text = Session["color"].ToString();&lt;br /&gt;            lblDate.Text = Session["date"].ToString();&lt;br /&gt;            lblName.Text = Session["name"].ToString();&lt;br /&gt;        }&lt;br /&gt;        else&lt;br /&gt;        {&lt;br /&gt;            Response.Redirect("Default.aspx");&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        &lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-897528943799808755?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/897528943799808755/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2012/01/stuf-for-first-assignment.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/897528943799808755'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/897528943799808755'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2012/01/stuf-for-first-assignment.html' title='Stuf for the first Assignment'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-1377965877708204005</id><published>2011-12-13T11:40:00.000-08:00</published><updated>2011-12-13T11:40:19.709-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC222'/><title type='text'>ITC 222 Assignment 3</title><content type='html'>&lt;h2&gt;Aggregate Functions&lt;/h2&gt;&lt;h3&gt;Outcomes&lt;/h3&gt;&lt;p&gt;Use SQL to retrieve database information&lt;/p&gt;&lt;hr&gt;&lt;h3&gt;Problems&lt;/h3&gt;&lt;p&gt;1. How many Ford vehicles are there? (Remember the LIKE operator)&lt;/p&gt;&lt;p&gt;2. What is the highest price for a service?&lt;/p&gt;&lt;p&gt;3. What is the lowest price for a service?&lt;/p&gt;&lt;p&gt;4. What is the average price for a service?&lt;/p&gt;&lt;p&gt;5. Although it doesn't make much sense, what it the total of all the service prices?&lt;/p&gt;&lt;p&gt;6. What is the count of cars served in each location?&lt;/p&gt;&lt;p&gt;7. list only the locations and counts of those locations that have served more than 15 customers&lt;/p&gt;&lt;p&gt;8. How many employees does each supervisor supervise?&lt;/p&gt;&lt;p&gt;9. What is the count of vehicles served on the first of March 2010?&lt;/p&gt;&lt;p&gt;10. What is the total number of vehicles served per month?&lt;/p&gt;&lt;hr/&gt;&lt;h3&gt;What I am looking for&lt;/h3&gt;&lt;p&gt;I want to see the SQL that would answer each problem. I do not need to see the actual answers, though you can include them if you wish&lt;/p&gt;&lt;p&gt;Each problem is worth 1 point for a total of 10 points&lt;/p&gt;&lt;hr/&gt;&lt;h3&gt;What to turn in&lt;/h3&gt;&lt;p&gt;Paste your answers into a Google doc and share it with spconger@gmail.com&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-1377965877708204005?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/1377965877708204005/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2011/12/itc-222-assignment-3.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/1377965877708204005'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/1377965877708204005'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2011/12/itc-222-assignment-3.html' title='ITC 222 Assignment 3'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-2463154510558281587</id><published>2011-12-13T11:15:00.000-08:00</published><updated>2011-12-13T11:15:55.591-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC222'/><title type='text'>ITC 222 Assignment 2</title><content type='html'>&lt;h2&gt;Scalar Functions&lt;/h2&gt;&lt;h3&gt;Outcomes&lt;/h3&gt;&lt;p&gt;Use SQL to retrieve database information&lt;/p&gt;&lt;hr/&gt;&lt;h3&gt;The Problems&lt;/h3&gt;&lt;p&gt;1. Select the distinct years in which employees were hired. Sort them so that the newest are on top&lt;/p&gt;&lt;p&gt;2. Display the names in person as (Last name, first name)&lt;/p&gt;&lt;p&gt;3. Return only the first word of each vehicle make&lt;/p&gt;&lt;p&gt;4. How many years difference is there between the newest and oldest hire date. (Just enter the dates manually. don't try to get them from the rows)&lt;/p&gt;&lt;p&gt;5. How many months are between the newest and oldest hires?&lt;/p&gt;&lt;p&gt;6. Format the phone numbers of the locations so they look like (206)555-1000&lt;/p&gt;&lt;p&gt;7. Format the prices of the auto services so that they have a $ sign&lt;/p&gt;&lt;p&gt;8.. Display the discount and tax percents in service detail as percents with a % sign. (You will have to multiply them by 100)&lt;/p&gt;&lt;hr/&gt;&lt;h3&gt;What I am looking for&lt;/h3&gt;&lt;p&gt;I want to see the SQL for each problem&lt;/p&gt;&lt;p&gt;Each problem is worth 1 point except for 6 and 8 which are worth 2 points each for a total of 10 points&lt;/p&gt;&lt;hr&gt;&lt;p&gt;deally, copy and paste the code into a Google doc and share it with spconger@gmail.com. I will comment on the document&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-2463154510558281587?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/2463154510558281587/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2011/12/itc-222-assignment-2.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/2463154510558281587'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/2463154510558281587'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2011/12/itc-222-assignment-2.html' title='ITC 222 Assignment 2'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-1802639704189477164</id><published>2011-12-13T10:48:00.000-08:00</published><updated>2011-12-13T10:48:11.809-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC222'/><title type='text'>ITC 222 Assignment 1</title><content type='html'>&lt;h2&gt;Simple Select Statements&lt;/h2&gt;&lt;h3&gt;Outcomes&lt;/h3&gt;&lt;p&gt;Use SQL to retrieve database information&lt;/p&gt;&lt;hr/&gt;&lt;h3&gt;The problems&lt;/h3&gt;&lt;p&gt;1. List all the people in the person table.&lt;/p&gt;&lt;p&gt;2. List all the people in the person table in alphabetical order by last name &lt;/p&gt;&lt;p&gt;3. List all the people in reverse order. Alias each field.&lt;/p&gt;&lt;p&gt;4. List all the locations in Seattle.&lt;/p&gt;&lt;p&gt;5. List all the services with a price of over $100.&lt;/p&gt;&lt;p&gt;6. List all the last names of persons with the letters 'tan' in them.&lt;/p&gt;&lt;p&gt;7. List all the services provided between 3/1/2010 and 3/15/2010.&lt;/p&gt;&lt;p&gt;8. List all the employees who don't have supervisors &lt;/p&gt;&lt;p&gt;9. List all the employees who do have supervisors.&lt;/p&gt;&lt;p&gt;10. List all the employees who have supervisors and were hired in 2007 (between 1/1 and 12/31/2007)&lt;/p&gt;&lt;hr/&gt;&lt;h3&gt;What I am looking for&lt;/h3&gt;&lt;p&gt;I want just the SQL statement. I don't need the results. None of the questions involve joins or other more advanced SQL.&lt;/p&gt;&lt;p&gt;Each question is worth 1 point for a total of 10 pts&lt;/p&gt;&lt;hr/&gt;&lt;h3&gt;What to turn in&lt;/h3&gt;&lt;p&gt;Ideally, copy and paste the code into a Google doc and share it with spconger@gmail.com. I will comment on the document&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-1802639704189477164?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/1802639704189477164/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2011/12/itc-222-assignment-1.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/1802639704189477164'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/1802639704189477164'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2011/12/itc-222-assignment-1.html' title='ITC 222 Assignment 1'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-2533453839064453593</id><published>2011-12-07T08:57:00.001-08:00</published><updated>2011-12-07T09:00:27.999-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC220'/><title type='text'>ITC 220 Presentation</title><content type='html'>&lt;p&gt;Here are the guidelines for the presentation:&lt;/p&gt;&lt;p&gt;1. Introduce the group members&lt;br/&gt;2. Show your Entity Diagram of the database and explain briefly what tables you have developed and how the work&lt;br/&gt;3. Explain what part of the project was the most challenging for the group and why&lt;br/&gt;4. Explain what part of the project you are most proud of or excited about&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-2533453839064453593?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/2533453839064453593/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2011/12/itc-220-presentation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/2533453839064453593'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/2533453839064453593'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2011/12/itc-220-presentation.html' title='ITC 220 Presentation'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-7094706189385507374</id><published>2011-12-06T13:27:00.001-08:00</published><updated>2011-12-06T13:38:42.058-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC110'/><title type='text'>Math Game Class</title><content type='html'>&lt;p&gt;Here is one possibility for a Math Game class. It generates the random numbers and performs all the math functions. You would call it from the Form's code behind by instantiating it and then accessing its properties and public methods. For example: (This would be in the Start Game button click event)&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;MathGame game = New MathGame(RadioButtonList.SelectedItem.Text);&lt;br /&gt;lblNumber1.Text=game.Number1.ToString();&lt;br /&gt;lblNumber2.Text=game.Number2.toString();&lt;br /&gt;&lt;/pre&gt;&lt;hr/&gt;&lt;p&gt;Remember, also, a web page has no state. That means that between clicking the start button and clicking the check answer button the class loses all its values. To prevent this you need to save the class to a session variable at the end of the start button code and recall it at the beginning of the Check answer code. First an example of saving the class to a Session variable:&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;Session["myGame"]=game;&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;Here is an example of recalling the class from the session variable:&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;MathGame game = (MathGame)Session["myGame"];&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;Sessions store everything as generic objects, so it is necessary to cast it back to the specific kind of object that it is, in this case (MathGame).&lt;/p&gt;&lt;p&gt;Here is the code for the class itself:&lt;/p&gt;&lt;hr/&gt;&lt;p&gt;&lt;strong&gt;MathGame.cs&lt;/strong&gt;&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Data;&lt;br /&gt;using System.Configuration;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Web;&lt;br /&gt;using System.Web.Security;&lt;br /&gt;using System.Web.UI;&lt;br /&gt;using System.Web.UI.HtmlControls;&lt;br /&gt;using System.Web.UI.WebControls;&lt;br /&gt;using System.Web.UI.WebControls.WebParts;&lt;br /&gt;using System.Xml.Linq;&lt;br /&gt;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;///This is one verson of a class to handle&lt;br /&gt;///the math game. It takes the operation &lt;br /&gt;///(Addition, multiplication, Subtraction, Division)&lt;br /&gt;///in with the constructor. Assigns the random&lt;br /&gt;///numbers and then calls the ChooseOperation()&lt;br /&gt;///method. The ChooseOperation() method calls the&lt;br /&gt;///appropriate math method. In the Subtract() &lt;br /&gt;///and Division() methods the method checks to make&lt;br /&gt;///sure that first number is larger than the &lt;br /&gt;///second number. If not, it sends it tot the Reverse()&lt;br /&gt;///method which reverses the values.&lt;br /&gt;///The CheckAnswer method takes in an integer guess&lt;br /&gt;///and compares it to the answer. It treats division&lt;br /&gt;///as a special case and also compares the remainder.&lt;br /&gt;///For problems not using the remainder it is passed&lt;br /&gt;///as a default zero --not the best solution, but &lt;br /&gt;///easier than some of the alternatives. The Check&lt;br /&gt;///answer method returns a string&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;public class MathGame&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;    //private fields&lt;br /&gt;    int number1;&lt;br /&gt;    int number2;&lt;br /&gt;    int answer;&lt;br /&gt;    string op;&lt;br /&gt;    int remainder;&lt;br /&gt;&lt;br /&gt;    &lt;br /&gt;&lt;br /&gt;    //constructor&lt;br /&gt; public MathGame(string operation)&lt;br /&gt; {&lt;br /&gt;  op=operation; //get the operation&lt;br /&gt;        //get the random numbers&lt;br /&gt;        number1 = GetRandom(); &lt;br /&gt;        number2 = GetRandom();&lt;br /&gt;        //call the ChooseOperation() method&lt;br /&gt;        ChooseOperation();&lt;br /&gt; }&lt;br /&gt;    //public read only properties&lt;br /&gt;    public int Number1&lt;br /&gt;    {&lt;br /&gt;        get { return number1; }&lt;br /&gt;        &lt;br /&gt;    }&lt;br /&gt;    public int Number2&lt;br /&gt;    {&lt;br /&gt;        get { return number2; }&lt;br /&gt;     &lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public int Answer&lt;br /&gt;    {&lt;br /&gt;        get { return answer; }&lt;br /&gt;      &lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public int Remainder&lt;br /&gt;    {&lt;br /&gt;        get { return remainder; }&lt;br /&gt;     &lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    //private methods&lt;br /&gt;    private int GetRandom()&lt;br /&gt;    {&lt;br /&gt;        //generate a random number&lt;br /&gt;        Random r = new Random();&lt;br /&gt;        return r.Next(1, 10);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    private void ChooseOperation()&lt;br /&gt;    {&lt;br /&gt;        //choose an operation&lt;br /&gt;        if (op.Equals("Add"))&lt;br /&gt;            Add();&lt;br /&gt;        if (op.Equals("Subtract"))&lt;br /&gt;            Subtract();&lt;br /&gt;        if (op.Equals("Multiply"))&lt;br /&gt;            Multiply();&lt;br /&gt;        if (op.Equals("Divide"))&lt;br /&gt;            Division();&lt;br /&gt;    }&lt;br /&gt;    private void Add()&lt;br /&gt;    {&lt;br /&gt;        answer = number1 + number2;&lt;br /&gt;    }&lt;br /&gt;    private void Substract()&lt;br /&gt;    {&lt;br /&gt;        if (number1 &lt; number2)&lt;br /&gt;            Reverse();&lt;br /&gt;&lt;br /&gt;        answer= number1 - number2;&lt;br /&gt;    }&lt;br /&gt;    private void Multiply()&lt;br /&gt;    {&lt;br /&gt;       answer= number1 * number2;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    private void Division()&lt;br /&gt;    {&lt;br /&gt;        if (number1 &gt; number2)&lt;br /&gt;            Reverse();&lt;br /&gt;&lt;br /&gt;       answer= number1 / number2;&lt;br /&gt;       GetRemainder();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    private void GetRemainder()&lt;br /&gt;    {&lt;br /&gt;        remainder= number1 % number2;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    private void Reverse()&lt;br /&gt;    {&lt;br /&gt;        //this method reverses the numbers&lt;br /&gt;        //if number1 is smaller than number2&lt;br /&gt;        int number3;&lt;br /&gt;        number3 = number1;&lt;br /&gt;        number1 = number2;&lt;br /&gt;        number2 = number3;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    //public methods&lt;br /&gt;    public string CheckGuess(int guess, int remain)&lt;br /&gt;    {&lt;br /&gt;        string reply = null;&lt;br /&gt;&lt;br /&gt;        if (op.Equals("Divide"))&lt;br /&gt;        {&lt;br /&gt;            if (guess == answer &amp;&amp; remain == remainder)&lt;br /&gt;                reply = "Congratulations";&lt;br /&gt;            else&lt;br /&gt;                reply = "try again";&lt;br /&gt;        }&lt;br /&gt;        else&lt;br /&gt;        {&lt;br /&gt;            if (guess == answer)&lt;br /&gt;                reply = "Congratulations";&lt;br /&gt;            else&lt;br /&gt;                reply = "try again";&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        return reply;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-7094706189385507374?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/7094706189385507374/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2011/12/math-game-class.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/7094706189385507374'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/7094706189385507374'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2011/12/math-game-class.html' title='Math Game Class'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-246683064939668897</id><published>2011-12-05T11:37:00.001-08:00</published><updated>2011-12-05T11:43:42.112-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC110'/><title type='text'>ITC 110 course Evaluations</title><content type='html'>&lt;p&gt;The class evaluation for the evening class will be Wednesday 12/7/2011&lt;/p&gt;&lt;p&gt;The URL is &lt;a href="http://seattlecolleges.com/facultyevaluations"&gt;http://www.seattlecolleges.com/facultyevaluations &lt;/a&gt;&lt;/p&gt;&lt;p&gt;The Course Number is &lt;strong&gt;3191&lt;/strong&gt;&lt;p&gt;&lt;p&gt;The evaluation will be available 7:30 to 8:30 PM&lt;/p&gt;&lt;p&gt;For the morning class the evaluation will be on Thursday 12/8/2011&lt;/p&gt;&lt;p&gt;The Course Item number is &lt;strong&gt;3190&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;The evaluation will be available 10:30 to 11:30 AM&lt;/p&gt;&lt;p&gt;For both evaluations the password is &lt;strong&gt;database&lt;/strong&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-246683064939668897?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/246683064939668897/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2011/12/itc-110-course-evaluations.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/246683064939668897'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/246683064939668897'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2011/12/itc-110-course-evaluations.html' title='ITC 110 course Evaluations'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-6589567026574141138</id><published>2011-12-05T11:35:00.001-08:00</published><updated>2011-12-05T11:37:02.059-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC220'/><title type='text'>ITC 220 Evaluation</title><content type='html'>&lt;p&gt;The class evaluation will be Wednesday 12/7/2011&lt;/p&gt;&lt;p&gt;The URL is &lt;a href="http://seattlecolleges.com/facultyevaluations"&gt;http://www.seattlecolleges.com/facultyevaluations &lt;/a&gt;&lt;/p&gt;&lt;p&gt;The course number is &lt;strong&gt;3206&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;The password is "database" (no quotes)&lt;/p&gt;&lt;p&gt;The evaluation will be available between 10:30 AM and 11:30 AM.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-6589567026574141138?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/6589567026574141138/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2011/12/itc-220-evaluation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/6589567026574141138'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/6589567026574141138'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2011/12/itc-220-evaluation.html' title='ITC 220 Evaluation'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-5797859978142195122</id><published>2011-12-05T11:20:00.001-08:00</published><updated>2011-12-05T11:25:05.636-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC220'/><title type='text'>View, Stored Procedures, Triggers</title><content type='html'>&lt;p&gt;Here is the code for the Views, Stored Procedures and Triggers&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;Use CommunityAssist&lt;br /&gt;Go&lt;br /&gt;--this is a view. A view is used to provide&lt;br /&gt;--a particular "view" of the data&lt;br /&gt;--usually taylored to a particular set of users&lt;br /&gt;--views are behave like tables&lt;br /&gt;--they are really filtered queries. No&lt;br /&gt;--data is actually stored in the view itself&lt;br /&gt;Alter view vw_Employees&lt;br /&gt;As&lt;br /&gt;Select LastName [Last Name],&lt;br /&gt;FirstName [First Name],&lt;br /&gt;Street,&lt;br /&gt;City,&lt;br /&gt;[State],&lt;br /&gt;Zip [zip code]&lt;br /&gt;From Person p&lt;br /&gt;inner join PersonAddress pa&lt;br /&gt;on p.PersonKey=pa.PersonKey&lt;br /&gt;Inner join Employee e&lt;br /&gt;on e.PersonKey=p.PersonKey&lt;br /&gt;&lt;br /&gt;--using the view like a table&lt;br /&gt;Select * from vw_Employees&lt;br /&gt;&lt;br /&gt;--the aliases in a view become the &lt;br /&gt;--actual column names&lt;br /&gt;Select [Last Name], [First Name], Street&lt;br /&gt;From vw_Employees&lt;br /&gt;&lt;br /&gt;go&lt;br /&gt;--a store procedure is an executable&lt;br /&gt;--that consist of one or more sql statements&lt;br /&gt;--they can be used to make dangerous&lt;br /&gt;--commands like updates safe&lt;br /&gt;Create proc usp_UpdateAddress&lt;br /&gt;--parameters provided by the user&lt;br /&gt;--probablly through a form&lt;br /&gt;@PersonAddressKey int ,&lt;br /&gt;@street nvarchar(255) ,&lt;br /&gt;@City nvarchar(255),&lt;br /&gt;@Zip nvarchar(10) &lt;br /&gt;AS --beginning of the procedure proper&lt;br /&gt;--check to see the the address exists&lt;br /&gt;if exists&lt;br /&gt; (Select PersonAddressKey &lt;br /&gt; from PersonAddress&lt;br /&gt; Where PersonAddressKey = @PersonAddressKey)&lt;br /&gt;Begin --if it does&lt;br /&gt;--update the address with the new values&lt;br /&gt;Update PersonAddress&lt;br /&gt;Set Street = @Street,&lt;br /&gt;City=@City,&lt;br /&gt;Zip = @Zip&lt;br /&gt;Where PersonAddressKey=@PersonAddressKey&lt;br /&gt;End --end if true&lt;br /&gt;Else --if false&lt;br /&gt;--print a message&lt;br /&gt;print 'Address doesnt exist'&lt;br /&gt;&lt;br /&gt;Select * From Personaddress&lt;br /&gt;&lt;br /&gt;--calling the stored procedure and &lt;br /&gt;--providing the parameter values&lt;br /&gt;--the keyword exec is optional&lt;br /&gt;exec usp_UpdateAddress&lt;br /&gt;@PersonAddressKey = 70,&lt;br /&gt;@Street='10 South Mann Street',&lt;br /&gt;@City='Tacoma',&lt;br /&gt;@Zip='98000'&lt;br /&gt;&lt;br /&gt;Go&lt;br /&gt;--triggers are procedures that execute &lt;br /&gt;--on an event&lt;br /&gt;--the following executes on inserts into&lt;br /&gt;--the Donation table&lt;br /&gt;Alter trigger tr_DonationAmount on Donation&lt;br /&gt;for Insert &lt;br /&gt;As&lt;br /&gt;--check to see if the receipt table exists&lt;br /&gt;--if not create it&lt;br /&gt;If not exists&lt;br /&gt;(Select name from sys.tables &lt;br /&gt; where name='receipt')&lt;br /&gt;Begin&lt;br /&gt;Create Table receipt&lt;br /&gt;(&lt;br /&gt;&lt;br /&gt;DonationDate DateTime, &lt;br /&gt;DonationAmount money, &lt;br /&gt;PersonKey int, &lt;br /&gt;EmployeeKey int&lt;br /&gt;)&lt;br /&gt;End&lt;br /&gt;--declare a variable&lt;br /&gt;Declare @DonationAmt money&lt;br /&gt;--assign a value to the variable from the inserted&lt;br /&gt;--table. the Inserted table is a temporary table&lt;br /&gt;--created to store insertions for the length of&lt;br /&gt;--the transaction&lt;br /&gt;Select @DonationAmt = DonationAmount from inserted&lt;br /&gt;--check on the size of the new donation&lt;br /&gt;if (@DonationAmt &gt;=200)&lt;br /&gt;Begin --if greater than 199&lt;br /&gt;--insert it into the receipt table&lt;br /&gt;Insert into receipt(&lt;br /&gt;DonationDate, &lt;br /&gt;DonationAmount, &lt;br /&gt;PersonKey, &lt;br /&gt;EmployeeKey)&lt;br /&gt;--the values to be inserted are selected&lt;br /&gt;--from the inserted table&lt;br /&gt;Select &lt;br /&gt;DonationDate, &lt;br /&gt;DonationAmount, &lt;br /&gt;PersonKey, &lt;br /&gt;EmployeeKey&lt;br /&gt;From Inserted&lt;br /&gt;End&lt;br /&gt;&lt;br /&gt;--using the key&lt;br /&gt;Insert into Donation(DonationDate, DonationAmount, &lt;br /&gt;PersonKey, EmployeeKey)&lt;br /&gt;Values(GETDATE(),250,1, 1)&lt;br /&gt;&lt;br /&gt;Select * From Receipt&lt;br /&gt;Select * From Donation&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-5797859978142195122?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/5797859978142195122/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2011/12/view-stored-procedures-triggers.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/5797859978142195122'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/5797859978142195122'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2011/12/view-stored-procedures-triggers.html' title='View, Stored Procedures, Triggers'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-453457746916751524</id><published>2011-11-30T14:37:00.001-08:00</published><updated>2011-11-30T15:01:37.094-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC110'/><title type='text'>Guessing Game ASP.Net</title><content type='html'>&lt;p&gt;This example has much of what you need for the last assignment. It shows how to use a class with ASP.Net. It shows how to preserve values in Session variables and how to dynamically assign the cssClass property. It also uses the Random object.&lt;/p&gt;&lt;p&gt;Here is a picture of the program running&lt;/p&gt;&lt;div class="separator" style="clear: both;"&gt;&lt;a href="http://1.bp.blogspot.com/-zSc61o9bqxM/TtayswuRXcI/AAAAAAAAAXE/hDwKAuFykVk/s1600/GuessGame.JPG" imageanchor="1" style=""&gt;&lt;img border="0" height="320" width="313" src="http://1.bp.blogspot.com/-zSc61o9bqxM/TtayswuRXcI/AAAAAAAAAXE/hDwKAuFykVk/s320/GuessGame.JPG" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;hr/&gt;&lt;p&gt;Here is the Source markup code&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Default.aspx&lt;/strong&gt;&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;%@ Page Language="C#" AutoEventWireup="true"  &lt;br /&gt;CodeFile="Default.aspx.cs" Inherits="_Default" %&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;&lt;br /&gt;&amp;lt;head runat="server"&gt;&lt;br /&gt;    &amp;lt;title&gt;Untitled Page&amp;lt;/title&gt;&lt;br /&gt;    &amp;lt;link href="GuessGame.css" rel="stylesheet" &lt;br /&gt;type="text/css" /&gt;&lt;br /&gt;&amp;lt;/head&gt;&lt;br /&gt;&amp;lt;body&gt;&lt;br /&gt;&amp;lt;h1&gt;Guessing Game&amp;lt;/h1&gt;&lt;br /&gt;    &amp;lt;form id="form1" runat="server"&gt;&lt;br /&gt;    &amp;lt;div&gt;&lt;br /&gt;    &amp;lt;p&gt;For this game you get ten chances to Guess &lt;br /&gt;a random number. Choose the difficulty of the game&lt;br /&gt;    from the following selections. &lt;br /&gt;Then click the Start Game button.&amp;lt;/p&gt;&lt;br /&gt;    &amp;lt;p&gt;&amp;lt;strong&gt;Choose Difficulty&amp;lt;/strong&gt;&amp;lt;/p&gt;&lt;br /&gt;        &amp;lt;asp:RadioButtonList ID="RadioButtonList1" runat="server"&gt;&lt;br /&gt;        &amp;lt;asp:ListItem Value="1"&gt;1 to 10&amp;lt;/asp:ListItem&gt;&lt;br /&gt;        &amp;lt;asp:ListItem Value="2"&gt;1 to 100&amp;lt;/asp:ListItem&gt;&lt;br /&gt;        &amp;lt;asp:ListItem Value="3" Selected="True"&gt;1 to 1000&amp;lt;/asp:ListItem&gt;&lt;br /&gt;        &amp;lt;/asp:RadioButtonList&gt;&lt;br /&gt;        &amp;lt;asp:Button ID="btnStart" runat="server" Text="StartGame" &lt;br /&gt;                onclick="btnStart_Click" /&gt;&lt;br /&gt;            &amp;lt;asp:Label ID="lblStart" runat="server" Text="Label"&gt;&lt;br /&gt;&amp;lt;/asp:Label&gt;&lt;br /&gt;        &amp;lt;p&gt;Enter your Guess &lt;br /&gt;            &amp;lt;asp:TextBox ID="txtGuess" runat="server"&gt;&lt;br /&gt;&amp;lt;/asp:TextBox&gt;&amp;lt;/p&gt;&lt;br /&gt;        &amp;lt;asp:Button ID="btnGuess" runat="server" Text="Guess" onclick="btnGuess_Click" /&gt;&lt;br /&gt;        &amp;lt;p&gt;   &amp;lt;asp:Label ID="lblResult" runat="server" Text="Result"&gt;&amp;lt;/asp:Label&gt;&amp;lt;/p&gt;&lt;br /&gt;        &amp;lt;p&gt;&lt;br /&gt;            &amp;lt;asp:Button ID="btnGameScore" runat="server"&lt;br /&gt; Text="GetGameScore" &lt;br /&gt;                onclick="btnGameScore_Click" /&gt;&lt;br /&gt;            &amp;lt;asp:Label ID="lblScore" runat="server" Text="Label"&gt;&amp;lt;/asp:Label&gt;&amp;lt;/p&gt;&lt;br /&gt;    &amp;lt;/div&gt;&lt;br /&gt; &lt;br /&gt;    &amp;lt;/form&gt;&lt;br /&gt;&amp;lt;/body&gt;&lt;br /&gt;&amp;lt;/html&gt;&lt;br /&gt;&lt;/pre&gt;&lt;hr/&gt;&lt;p&gt;Here is the code for the Class Guessing Game&lt;/p&gt;&lt;p&gt;&lt;strong&gt;GuessingGame.cs&lt;/strong&gt;&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Data;&lt;br /&gt;using System.Configuration;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Web;&lt;br /&gt;using System.Web.Security;&lt;br /&gt;using System.Web.UI;&lt;br /&gt;using System.Web.UI.HtmlControls;&lt;br /&gt;using System.Web.UI.WebControls;&lt;br /&gt;using System.Web.UI.WebControls.WebParts;&lt;br /&gt;using System.Xml.Linq;&lt;br /&gt;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// This class controls the guessing game&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;public class GuessingGame&lt;br /&gt;{&lt;br /&gt;    &lt;br /&gt;    //class fields--they are private by default&lt;br /&gt;    int max;&lt;br /&gt;    int min;&lt;br /&gt;    int number;&lt;br /&gt;    int count;&lt;br /&gt;   &lt;br /&gt;    &lt;br /&gt;&lt;br /&gt;       &lt;br /&gt; public GuessingGame(int minimum, int maximum)&lt;br /&gt; {&lt;br /&gt;        //constructor, gets the max and min&lt;br /&gt;        //values from the form&lt;br /&gt;        max=maximum;&lt;br /&gt;        min=minimum;&lt;br /&gt;        GetRandom();//generate the random number&lt;br /&gt;        count=10;&lt;br /&gt;      &lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;    //public properties&lt;br /&gt;    public int Max&lt;br /&gt;    {&lt;br /&gt;        get { return max; }&lt;br /&gt;        set { max = value; }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public int Min&lt;br /&gt;    {&lt;br /&gt;        get { return min; }&lt;br /&gt;        set { min = value; }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public int Number&lt;br /&gt;    {&lt;br /&gt;        //the random number is a see only&lt;br /&gt;        //value--the user cannot change it&lt;br /&gt;        get { return number; }&lt;br /&gt;       &lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    private void GetRandom()&lt;br /&gt;    {&lt;br /&gt;        //initiate the random number&lt;br /&gt;        Random r = new Random();&lt;br /&gt;        number = r.Next(Min, Max);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public string CheckGuess(int guess)&lt;br /&gt;    {&lt;br /&gt;        //the default reply&lt;br /&gt;        string reply = &lt;br /&gt;"sorry you have used all your guesses the number was"&lt;br /&gt;+ Number;&lt;br /&gt;&lt;br /&gt;        //as long as the count is bigger than 0&lt;br /&gt;        //keep playing the game&lt;br /&gt;        if (count &gt; 0)&lt;br /&gt;        {&lt;br /&gt;            if (guess &gt; number)&lt;br /&gt;                reply = "Your guess is too high";&lt;br /&gt;            else if (guess &amp;lt; number)&lt;br /&gt;                reply = "Your guess is too low";&lt;br /&gt;            else&lt;br /&gt;                reply = "Congratulations you got it!";&lt;br /&gt;        }&lt;br /&gt;        count--; //decrement the count&lt;br /&gt;        return reply;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public int GetGameScore()&lt;br /&gt;    {&lt;br /&gt;        return count;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;hr/&gt;&lt;p&gt;And here is the code for the Web Page C#&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Default.aspx.cs&lt;/strong&gt;&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Configuration;&lt;br /&gt;using System.Data;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Web;&lt;br /&gt;using System.Web.Security;&lt;br /&gt;using System.Web.UI;&lt;br /&gt;using System.Web.UI.HtmlControls;&lt;br /&gt;using System.Web.UI.WebControls;&lt;br /&gt;using System.Web.UI.WebControls.WebParts;&lt;br /&gt;using System.Xml.Linq;&lt;br /&gt;&lt;br /&gt;public partial class _Default : System.Web.UI.Page &lt;br /&gt;{&lt;br /&gt;    //give the gameClass variable class scope&lt;br /&gt;    GuessingGame game;&lt;br /&gt;   &lt;br /&gt;    protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;    {&lt;br /&gt;&lt;br /&gt;    }&lt;br /&gt;    protected void btnStart_Click(object sender, EventArgs e)&lt;br /&gt;    {&lt;br /&gt;        //Determine the range by getting &lt;br /&gt;        //the radio button values&lt;br /&gt;        int max=0, min=0;&lt;br /&gt;        if (RadioButtonList1.SelectedValue=="1")&lt;br /&gt;        {&lt;br /&gt;            max=10;&lt;br /&gt;            min=1;&lt;br /&gt;        }&lt;br /&gt;        else if(RadioButtonList1.SelectedValue=="2")&lt;br /&gt;        {&lt;br /&gt;            max=100;&lt;br /&gt;            min=1;&lt;br /&gt;        }&lt;br /&gt;        else{&lt;br /&gt;            max=1000;&lt;br /&gt;            min=1;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        //instantiate the game&lt;br /&gt;        //every time you click the start game you&lt;br /&gt;        //get a new instance of the game class&lt;br /&gt;        game = new GuessingGame(min, max);&lt;br /&gt;        &lt;br /&gt;        //save it to a session variable so it can keep&lt;br /&gt;        //state ie its settings&lt;br /&gt;        Session["gameSession"] = game;&lt;br /&gt;        &lt;br /&gt;        //change the text &lt;br /&gt;        lblStart.Text = "Ready to Play";&lt;br /&gt;        //apply a style sheet style dynamically&lt;br /&gt;        lblStart.CssClass = "winner";&lt;br /&gt;        //set the focus in the guess text box&lt;br /&gt;        txtGuess.Focus();&lt;br /&gt;    }&lt;br /&gt;    protected void btnGuess_Click(object sender, EventArgs e)&lt;br /&gt;    {&lt;br /&gt;        //make sure the session exists&lt;br /&gt;        //ie that they pushed the start game button&lt;br /&gt;        //if not warn them&lt;br /&gt;        if (Session["gameSession"]==null)&lt;br /&gt;        {&lt;br /&gt;            lblStart.Text = "Press Start Button";&lt;br /&gt;            lblStart.CssClass = "warning";&lt;br /&gt;            return;&lt;br /&gt;        }&lt;br /&gt;        //recall the session and cast it to the class type&lt;br /&gt;        GuessingGame game = (GuessingGame)Session["gameSession"];&lt;br /&gt;&lt;br /&gt;        //make sure the guess is a good integer&lt;br /&gt;        int guess;&lt;br /&gt;        bool isGood = int.TryParse(txtGuess.Text, out guess);&lt;br /&gt;&lt;br /&gt;        //if good, pass the guess to the class&lt;br /&gt;        //the method returns the prompt too high&lt;br /&gt;        //too low, etc.&lt;br /&gt;        if (isGood)&lt;br /&gt;        {&lt;br /&gt;            lblResult.Text = game.CheckGuess(guess);&lt;br /&gt;            lblResult.CssClass = "normal";&lt;br /&gt;        }&lt;br /&gt;        else&lt;br /&gt;        {&lt;br /&gt;            lblResult.Text = "Enter a valid number as a guess";&lt;br /&gt;            lblResult.CssClass = "warning";&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        //if a winner change font using the css Style&lt;br /&gt;        if(lblResult.Text.Equals("Congratulations you got it!"))&lt;br /&gt;        {&lt;br /&gt;            lblResult.CssClass="winner";&lt;br /&gt;        }&lt;br /&gt;       &lt;br /&gt;&lt;br /&gt;       &lt;br /&gt;       &lt;br /&gt;    }&lt;br /&gt;    protected void btnGameScore_Click(object sender, EventArgs e)&lt;br /&gt;    {&lt;br /&gt;&lt;br /&gt;        //call the session&lt;br /&gt;        GuessingGame game = (GuessingGame)Session["gameSession"];&lt;br /&gt;&lt;br /&gt;        //display the score&lt;br /&gt;        lblScore.Text = "Your score for this game is "&lt;br /&gt;            + game.GetGameScore().ToString();&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;hr/&gt;&lt;p&gt;Here is the CSS I used for the class. Very Minimal&lt;/p&gt;&lt;p&gt;&lt;strong&gt;GuessingGame.css&lt;/strong&gt;&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;body &lt;br /&gt;{&lt;br /&gt; font-family:Verdana Sans-Serif;&lt;br /&gt; font-size:large;&lt;br /&gt;}&lt;br /&gt;h1&lt;br /&gt;{&lt;br /&gt; background-color:Navy;&lt;br /&gt; color:White;&lt;br /&gt; font-weight:bold;&lt;br /&gt; height:100px;&lt;br /&gt; font-size:200%;&lt;br /&gt; vertical-align:middle;&lt;br /&gt; text-align:center;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/**********************&lt;br /&gt;these are css classes used &lt;br /&gt;dynamically in the code&lt;br /&gt;***************************/&lt;br /&gt;.winner&lt;br /&gt;{&lt;br /&gt; color:Green;&lt;br /&gt; font-weight:bold;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;.warning&lt;br /&gt;{&lt;br /&gt; color:Red;&lt;br /&gt; font-weight:bold;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;.normal&lt;br /&gt;{&lt;br /&gt; color:Black;&lt;br /&gt; font-weight:normal;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;hr/&gt;&lt;p&gt; Here is a sequence diagram of how the two classes communicate.&lt;/p&gt;&lt;div class="separator" style="clear: both;"&gt;&lt;a href="http://4.bp.blogspot.com/-nzNoFtz_OCU/Tta05jMZRYI/AAAAAAAAAXQ/IFbcn4kuKM4/s1600/gameSequence.JPG" imageanchor="1" style=""&gt;&lt;img border="0" height="320" width="290" src="http://4.bp.blogspot.com/-nzNoFtz_OCU/Tta05jMZRYI/AAAAAAAAAXQ/IFbcn4kuKM4/s320/gameSequence.JPG" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-453457746916751524?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/453457746916751524/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2011/11/guessing-game-aspnet.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/453457746916751524'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/453457746916751524'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2011/11/guessing-game-aspnet.html' title='Guessing Game ASP.Net'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-zSc61o9bqxM/TtayswuRXcI/AAAAAAAAAXE/hDwKAuFykVk/s72-c/GuessGame.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-5137235680490043533</id><published>2011-11-29T13:44:00.001-08:00</published><updated>2011-11-29T13:46:57.511-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC172'/><title type='text'>ITC 172 Assignment 7 MVC</title><content type='html'>&lt;p&gt;There are no practices with this assignment, just the MVC. It may seem overwhelming but  is really much simpler than it looks.&lt;/p&gt;&lt;hr/&gt;&lt;h2&gt;Programming&lt;/h2&gt;&lt;p&gt;Start a new ASP MVC2 web project&lt;/p&gt;&lt;p&gt;Add a model that uses LINQ to return a list of registered customers including their names (that means you will have to drag the Person table as well as the Registered Customer table onto the designer.)&lt;/p&gt;&lt;p&gt;Add a controller Named RegisteredCustomerController&lt;/p&gt;&lt;p&gt;Write the LINQ code to retrieve registered Customers&lt;/p&gt;&lt;p&gt;Add a View that displays the registered customers in a table&lt;/p&gt;&lt;p&gt;Add a tab to the menu in the Master page&lt;/p&gt;&lt;hr/&gt;&lt;h2&gt;What I am looking for&lt;/h2&gt;&lt;p&gt;The model is worth 5 pts&lt;br/&gt;The controller is worth 5 pts&lt;br/&gt;The view is worth 5 pts&lt;br/&gt;Modifying the Master and displaying the customers in a new tab 5 pts&lt;/p&gt;&lt;p&gt;The total is worth 20 points&lt;/p&gt;&lt;hr/&gt;&lt;h2&gt;To Turn in&lt;/h2&gt;&lt;p&gt;Turn in all the code and markup you have done. (You don't need to post all the auto generated code and markup. Include a screenshot of the application running with the customers displayed. Put it all in a Google doc and share it with spconger@gmail.com&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-5137235680490043533?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/5137235680490043533/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2011/11/itc-172-assignment-7-mvc.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/5137235680490043533'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/5137235680490043533'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2011/11/itc-172-assignment-7-mvc.html' title='ITC 172 Assignment 7 MVC'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-2425045236725424018</id><published>2011-11-29T11:56:00.001-08:00</published><updated>2011-11-29T11:57:27.905-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC110'/><title type='text'>Morning ASP Examples</title><content type='html'>&lt;p&gt;Here is the ASP source code&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;%@ Page Language="C#" AutoEventWireup="true" &lt;br /&gt;CodeFile="Default.aspx.cs" Inherits="_Default" %&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" &lt;br /&gt;"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;&lt;br /&gt;&amp;lt;head runat="server"&gt;&lt;br /&gt;    &amp;lt;title&gt;&amp;lt;/title&gt;&lt;br /&gt;    &amp;lt;link href="FinalProject.css" rel="stylesheet" type="text/css" /&gt;&lt;br /&gt;&amp;lt;/head&gt;&lt;br /&gt;&amp;lt;body&gt;&lt;br /&gt;    &amp;lt;form id="form1" runat="server"&gt;&lt;br /&gt;    &amp;lt;div&gt;&lt;br /&gt;    &lt;br /&gt;      &amp;lt;p&gt; Enter your Name &amp;lt;asp:TextBox &lt;br /&gt;ID="txtName" runat="server"&gt;&amp;lt;/asp:TextBox&gt;&amp;lt;/p&gt;&lt;br /&gt;        &amp;lt;asp:Button ID="btnName" runat="server" Text="Click Me" &lt;br /&gt;            onclick="btnName_Click" /&gt;&lt;br /&gt;        &amp;lt;asp:Label ID="lblResult" runat="server" Text="Label"&gt;&amp;lt;/asp:Label&gt;&lt;br /&gt;        &amp;lt;asp:CheckBoxList ID="CheckBoxList1" runat="server"&gt;&lt;br /&gt;            &amp;lt;asp:ListItem Value="3.25"&gt;Bread&amp;lt;/asp:ListItem&gt;&lt;br /&gt;            &amp;lt;asp:ListItem Value="1.95"&gt;Eggs&amp;lt;/asp:ListItem&gt;&lt;br /&gt;            &amp;lt;asp:ListItem Value="3"&gt;Milk&amp;lt;/asp:ListItem&gt;&lt;br /&gt;            &amp;lt;asp:ListItem Value="1.59"&gt;Chili&amp;lt;/asp:ListItem&gt;&lt;br /&gt;            &amp;lt;asp:ListItem Value="7.99"&gt;Beer&amp;lt;/asp:ListItem&gt;&lt;br /&gt;        &amp;lt;/asp:CheckBoxList&gt;&lt;br /&gt;        &lt;br /&gt;        &amp;lt;asp:Button ID="Button1" runat="server" &lt;br /&gt;onclick="Button1_Click" Text="GetTotal" /&gt;&lt;br /&gt;        &lt;br /&gt;        &amp;lt;asp:Label ID="lblTotal" runat="server" &lt;br /&gt;Text="Label"&gt;&amp;lt;/asp:Label&gt;&lt;br /&gt;        &lt;br /&gt;    &amp;lt;/div&gt;&lt;br /&gt;    &amp;lt;/form&gt;&lt;br /&gt;&amp;lt;/body&gt;&lt;br /&gt;&amp;lt;/html&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;Here is the code behind&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Web;&lt;br /&gt;using System.Web.UI;&lt;br /&gt;using System.Web.UI.WebControls;&lt;br /&gt;&lt;br /&gt;public partial class _Default : System.Web.UI.Page&lt;br /&gt;{&lt;br /&gt;    protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;    {&lt;br /&gt;        //if (!IsPostBack)&lt;br /&gt;        //{&lt;br /&gt;        //    CheckBoxList1.Items.Add("Red");&lt;br /&gt;        //    CheckBoxList1.Items.Add("Green");&lt;br /&gt;        //    CheckBoxList1.Items.Add("Blue");&lt;br /&gt;        //}&lt;br /&gt;    }&lt;br /&gt;    protected void btnName_Click(object sender, EventArgs e)&lt;br /&gt;    {&lt;br /&gt;        lblResult.Text = "Hello " + txtName.Text;&lt;br /&gt;    }&lt;br /&gt;    protected void Button1_Click(object sender, EventArgs e)&lt;br /&gt;    {&lt;br /&gt;        double total = 0;&lt;br /&gt;        foreach (ListItem item in CheckBoxList1.Items)&lt;br /&gt;        {&lt;br /&gt;            if (item.Selected)&lt;br /&gt;            {&lt;br /&gt;                total += double.Parse(item.Value.ToString());&lt;br /&gt;               &lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            lblTotal.Text = "Your total is " + total.ToString("c"); &lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-2425045236725424018?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/2425045236725424018/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2011/11/morning-asp-examples.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/2425045236725424018'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/2425045236725424018'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2011/11/morning-asp-examples.html' title='Morning ASP Examples'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-5226335840053798199</id><published>2011-11-28T19:07:00.001-08:00</published><updated>2011-11-28T19:12:29.812-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC110'/><title type='text'>ASP Overview (a mess of sorts)</title><content type='html'>&lt;p&gt;here is the ASP and HTML source&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;%@ Page Language="C#" AutoEventWireup="true"&lt;br /&gt; CodeFile="Default.aspx.cs" Inherits="_Default" %&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;!DOCTYPE html PUBLIC &lt;br /&gt;"-//W3C//DTD XHTML 1.0 Transitional//EN" &lt;br /&gt;"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;&lt;br /&gt;&amp;lt;head runat="server"&gt;&lt;br /&gt;    &amp;lt;title&gt;&amp;lt;/title&gt;&lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;    &lt;br /&gt;    &amp;lt;link href="ClassFun.css" rel="stylesheet" type="text/css" /&gt;&lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;    &lt;br /&gt;&amp;lt;/head&gt;&lt;br /&gt;&amp;lt;body&gt;&lt;br /&gt;    &amp;lt;form id="form1" runat="server"&gt;&lt;br /&gt;    &amp;lt;div&gt;&lt;br /&gt;    &amp;lt;h2&gt;My Dates&lt;br /&gt;        &amp;lt;/h2&gt;&lt;br /&gt;        &amp;lt;asp:DropDownList ID="DropDownList1" runat="server"&gt;&lt;br /&gt;        &amp;lt;/asp:DropDownList&gt;&lt;br /&gt;        &amp;lt;asp:Calendar ID="Calendar1" runat="server"&gt;&amp;lt;/asp:Calendar&gt;&lt;br /&gt;        &amp;lt;asp:Button ID="btnGetDate" runat="server" Text="Get Date" &lt;br /&gt;            onclick="btnGetDate_Click" /&gt;&lt;br /&gt;        &amp;lt;asp:TextBox ID="TextBox1" runat="server"&gt;&amp;lt;/asp:TextBox&gt;&lt;br /&gt;        &amp;lt;br /&gt;&lt;br /&gt;        &amp;lt;p&gt;Enter Quantity&amp;lt;asp:TextBox ID="txtQuantity" &lt;br /&gt;runat="server"&gt;&amp;lt;/asp:TextBox&gt;&amp;lt;/p&gt;&lt;br /&gt;        &amp;lt;br /&gt;&lt;br /&gt;        &amp;lt;br /&gt;&lt;br /&gt;        &amp;lt;asp:RadioButtonList ID="RadioButtonList1" &lt;br /&gt;runat="server" AutoPostBack="True" &lt;br /&gt;            onselectedindexchanged="RadioButtonList1_SelectedIndexChanged"&gt;&lt;br /&gt;            &amp;lt;asp:ListItem Value="1.19"&gt;Apples&amp;lt;/asp:ListItem&gt;&lt;br /&gt;            &amp;lt;asp:ListItem Value="4.99"&gt;Strawberries&amp;lt;/asp:ListItem&gt;&lt;br /&gt;            &amp;lt;asp:ListItem Value=".59"&gt;Bananas&amp;lt;/asp:ListItem&gt;&lt;br /&gt;            &amp;lt;asp:ListItem Value=".5"&gt;Kiwis&amp;lt;/asp:ListItem&gt;&lt;br /&gt;            &amp;lt;asp:ListItem Value="1.50"&gt;Oranges&amp;lt;/asp:ListItem&gt;&lt;br /&gt;        &amp;lt;/asp:RadioButtonList&gt;&lt;br /&gt;        &amp;lt;asp:Label ID="lblResults" runat="server" Text="Label"&gt;&amp;lt;/asp:Label&gt;&lt;br /&gt;        &amp;lt;br /&gt;&lt;br /&gt;    &lt;br /&gt;    &amp;lt;/div&gt;&lt;br /&gt;    &amp;lt;/form&gt;&lt;br /&gt;&amp;lt;/body&gt;&lt;br /&gt;&amp;lt;/html&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;Here is the Code behind&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Web;&lt;br /&gt;using System.Web.UI;&lt;br /&gt;using System.Web.UI.WebControls;&lt;br /&gt;&lt;br /&gt;public partial class _Default : System.Web.UI.Page&lt;br /&gt;{&lt;br /&gt;    protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;    {&lt;br /&gt;        if (!IsPostBack)&lt;br /&gt;        {&lt;br /&gt;            Calendar1.SelectedDate = Calendar1.TodaysDate;&lt;br /&gt;            DropDownList1.Items.Add("One");&lt;br /&gt;            DropDownList1.Items.Add("Two");&lt;br /&gt;            DropDownList1.Items.Add("Three");&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;      &lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    protected void btnGetDate_Click(object sender, EventArgs e)&lt;br /&gt;    {&lt;br /&gt;       &lt;br /&gt;            &lt;br /&gt;            TextBox1.Text = Calendar1.SelectedDate.ToShortDateString();&lt;br /&gt;        &lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    protected void RadioButtonList1_SelectedIndexChanged(object sender, EventArgs e)&lt;br /&gt;    {&lt;br /&gt;        int quantity = int.Parse(txtQuantity.Text);&lt;br /&gt;        double price = double.Parse(RadioButtonList1.SelectedValue.ToString());&lt;br /&gt;        double total=price * quantity;&lt;br /&gt;&lt;br /&gt;        lblResults.Text = "It will cost " + &lt;br /&gt;           total.ToString("c") + " for " + &lt;br /&gt;           quantity.ToString() + " " +&lt;br /&gt;           RadioButtonList1.SelectedItem.ToString();&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;And finally, here is the minimal CSS&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;body&lt;br /&gt;{&lt;br /&gt;    &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;h2&lt;br /&gt;{&lt;br /&gt;    color:Navy;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;th&lt;br /&gt;{&lt;br /&gt;    color:White;&lt;br /&gt;    background-color:Navy;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-5226335840053798199?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/5226335840053798199/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2011/11/asp-overview-mess-of-sorts.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/5226335840053798199'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/5226335840053798199'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2011/11/asp-overview-mess-of-sorts.html' title='ASP Overview (a mess of sorts)'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-8000911519803547340</id><published>2011-11-28T14:43:00.001-08:00</published><updated>2011-11-29T13:32:11.913-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC172'/><title type='text'>ITC 172 Assignment 6</title><content type='html'>&lt;h2&gt;Practices&lt;/h2&gt; &lt;p&gt;1. Add a textbox and a validation control that makes it a required field. Change the default message and show the ASP markup&lt;/p&gt; &lt;p&gt;2. Add a textbox and a regular expressions validation that validates that the textbox contains a valid email address&lt;/p&gt; &lt;p&gt;3. Assume you have a form with fields for last name and first name. Write the LINQ code to add them to the Person table in the AutoMart database&lt;/p&gt;&lt;hr/&gt; &lt;h2&gt;Programming&lt;/h2&gt;&lt;p&gt;Start a new Empty Web Site and add a Web Form.&lt;/p&gt;&lt;p&gt;We are going to write a new customer and new vehicle to the Automart Database using LINQ.  We are going to make the customer a registered customer. That means you will need to add the customer to the Person table, then to the RegisteredCustomer table and then add the Vehicle to the Vehicle table. All three tables  are linked by the PersonKey.&lt;/p&gt;&lt;p&gt;Create the form with all the necessary fields. Validate the fields. Make Last name required. Make email required and also validate that it is a well formed email address. License plate and vehicle type and vehicle year should also be required.&lt;/p&gt;&lt;p&gt;Write the LINQ code to insert the new registered customer and vehicle. Use error trapping and add an error page to the project&lt;/p&gt;&lt;p&gt;Use CSS to style the web site&lt;/p&gt;&lt;hr/&gt;&lt;h2&gt;What I am looking for&lt;/h2&gt;&lt;p&gt;The practices are worth 2 point each&lt;br/&gt;The form textboxes and validation are worth 6 pts&lt;br/&gt;The LINQ code is worth 5 points&lt;br/&gt;The error trapping is worth 2 pts&lt;br/&gt;The Css is worth 1&lt;/p&gt;&lt;hr/&gt;&lt;h2&gt;What to Turn in&lt;/h2&gt;&lt;p&gt;Turn in all the ASP markup and the c# code in a Google Doc and share with spconger@gmail.com&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-8000911519803547340?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/8000911519803547340/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2011/11/itc-172-assignment-6.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/8000911519803547340'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/8000911519803547340'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2011/11/itc-172-assignment-6.html' title='ITC 172 Assignment 6'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-7805657370146613718</id><published>2011-11-28T14:19:00.001-08:00</published><updated>2011-11-28T14:22:04.981-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC172'/><title type='text'>ITC 172 Assignment Five</title><content type='html'>&lt;h2&gt;Practices&lt;/h2&gt; &lt;p&gt;1. Create a LINQ query that returns all the last names and first names in the people table &lt;/p&gt; &lt;p&gt;2. Bind the results the query in one to a DropDownList&lt;/p&gt; &lt;p&gt;3. Write a LINQ query that takes the city from a drop down list and returns the locations for that city&lt;/p&gt; &lt;p&gt;4. Add A try catch to number 3&lt;/p&gt; &lt;p&gt;5. Write the code to redirect an error message to an error page&lt;/p&gt; &lt;p&gt;6. Write the code to display the error message on the error page&lt;/p&gt; &lt;p&gt;7. Write the ASP markup to display a location Name, Address and City in a ListView control&lt;/p&gt;&lt;hr/&gt;  &lt;h2&gt;Programming&lt;/h2&gt;&lt;p&gt;Create a new Empty web site. Add a Web Form. Add a DropDownList and a ListView control. The drop down list will contain a distinct list of vehicle types. When a user chooses one of the vehicle types the ListView will display all the vehicles of that type. Use a LINQ query to fill the DropDownList, and another to fill the ListView. Add error checking to the code. Make a separate error page to display any errors. Use CSS to style the pages.&lt;/p&gt;&lt;hr/&gt; &lt;h2&gt;What I am looking for&lt;/h2&gt;&lt;p&gt;Practices are worth 1 point each.&lt;br/&gt;Filling the DropDownList is worth 2 pts&lt;br/&gt;Filling the View List is worth 5 points&lt;br/&gt;Error checking and error page is worth 4 pts&lt;br/&gt;The CSS is worth 1 point&lt;/p&gt;&lt;p&gt;The total is worth 20 pts&lt;/p&gt;&lt;hr/&gt;&lt;h2&gt;To Turn in&lt;/h2&gt;&lt;p&gt;Paste your code into a Google doc and share it with spconger@gmail.com&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-7805657370146613718?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/7805657370146613718/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2011/11/itc-172-assignment-five.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/7805657370146613718'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/7805657370146613718'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2011/11/itc-172-assignment-five.html' title='ITC 172 Assignment Five'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-8410897721129222131</id><published>2011-11-23T14:11:00.001-08:00</published><updated>2011-11-23T14:24:20.663-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC172'/><title type='text'>ITC 172 Final Project</title><content type='html'>&lt;h2&gt;Outcomes&lt;/h2&gt;&lt;p&gt;Create basic programming structures&lt;/p&gt;&lt;p&gt;Create interactive web pages with data bound controls&lt;/p&gt;&lt;p&gt;Connect to databases with ADO&lt;/p&gt;&lt;p&gt;Understand and implement secure coding techniques&lt;/p&gt;&lt;p&gt;Research relevant programming techniques&lt;/p&gt;&lt;p&gt;Work Effectively in groups&lt;/p&gt;&lt;hr/&gt;&lt;h2&gt;The Project&lt;/h2&gt;&lt;p&gt;This is best done in groups of 3 or 4&lt;/p&gt;&lt;p&gt;Create a web application for Automart Customers.&lt;/p&gt;&lt;p&gt;The main page should have a banner for automart, and should show all the locations and their addresses. It should also advertise all the services available.Registered customers should be able to log in, choose a vehicle and see all the services that have been provided for that vehicle. If a customer is not registered, it should allow them to register  themselves and their vehicle.&lt;/p&gt;&lt;p&gt;You can use any of the tools and techniques we have used in the assignments. The project should contain at least one control or technique we haven't looked at in class. Research it through books or the web and note where you got your information (in a comment in the code)&lt;/p&gt;&lt;p&gt;Use CSS to Style the application. I will not judge on the quality of the styling--only that you have attached a style sheet and used some of the styles.&lt;/p&gt;&lt;p&gt;Keep minutes for your group that list who contributes what to the project&lt;/p&gt;&lt;hr/&gt;&lt;h2&gt;What I am looking For&lt;/h2&gt;&lt;p&gt;Presenting locations and addresses from Database 5pts&lt;br/&gt;Presenting Automart Services offered from Database 5pts&lt;br/&gt;Customer login 5 pts&lt;br/&gt;Returning  Vehicle services 5pts&lt;br/&gt;Registering new Customer and vehicle 10 pts&lt;br/&gt;New control or technique 10 pts&lt;br/&gt;Css Stylsheet and styling  5 pts&lt;br/&gt;Participation in group 5 pts&lt;/p&gt;&lt;p&gt;The total project is worth 50 points&lt;p&gt;&lt;h2&gt;What to turn in.&lt;/h2&gt;&lt;p&gt;Paste the markup, CSS, and C# into a Google doc and share with spconger@gmail.com. I will also sit with each group and review the completed project&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-8410897721129222131?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/8410897721129222131/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2011/11/itc-172-final-project.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/8410897721129222131'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/8410897721129222131'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2011/11/itc-172-final-project.html' title='ITC 172 Final Project'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-3627052745533176885</id><published>2011-11-23T13:10:00.001-08:00</published><updated>2012-02-01T12:13:28.714-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC172'/><title type='text'>ITC 172 Assignment Four</title><content type='html'>&lt;h2&gt;Outcomes&lt;/h2&gt;&lt;p&gt;Make interactive Web pages with Data bound controls&lt;/p&gt;&lt;p&gt;Understand and implement secure coding techniques&lt;/p&gt;&lt;p&gt;Research relevant programming techniques&lt;/p&gt;&lt;hr/&gt;&lt;h2&gt;Practices&lt;/h2&gt; &lt;p&gt;1. Given a DataSet named ds. Write the code that would bind it to a DataViewGrid control.&lt;/p&gt; &lt;p&gt;2. You have made a web reference to a service that provides the capital of any state. You have named it StateCapitalService.  It has a method GetCapital(string state). Write the code that would invoke this method and display its results.&lt;/p&gt;&lt;hr/&gt;&lt;h2&gt;Programming&lt;/h2&gt;&lt;p&gt;Open a new ASP.Net Web Application.&lt;/p&gt;&lt;p&gt;Go to &lt;a href="http://www.webservicex.net/WS/wscatlist.aspx"&gt;http://www.webservicex.net/WS/wscatlist.aspx&lt;/a&gt; Click on the link for "Standards and Lookup Data", then scroll down to "USA Zip Code Information." Add a Web Reference to this Service. Use the Method "Get Info By City." This returns a DataSet of all the zip codes in a given city. You will need a text box to get the name of the city. Invoke the method and bind the DataSet to a ViewGrid&lt;/p&gt;&lt;p&gt;Add a second web service of your choice and display the results&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Take a &lt;a href="http://congeritc.blogspot.com/2012/02/assignment-4-notes.html"&gt;look at this modification&lt;/a&gt; of the assignment. You must load the results of the zip code web service into an XML file before you can load it into the DataSet. &lt;/strong&gt;&lt;/p&gt;&lt;hr&gt;&lt;h2&gt;What I am looking for&lt;/h2&gt;&lt;p&gt;The first practice is worth 2 points&lt;br/&gt;The second practice is worth 3 points&lt;br/&gt;In the programming assignment adding the web service  3 pts&lt;br/&gt;Creating the form for input and output 2 pts&lt;br/&gt;Calling the method 2 pts&lt;br/&gt;Binding the resulting DataSet to the View Grid 3 pts&lt;br/&gt;Adding, invoking and displaying a second web service 5 pts&lt;/p&gt;&lt;p&gt;The whole is worth 20 pts&lt;/p&gt;&lt;h2&gt;To turn in&lt;/h2&gt;&lt;p&gt;Copy the c# code into a Google Doc and share with spconger@gmail.com&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-3627052745533176885?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/3627052745533176885/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2011/11/itc-172-assignment-four.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/3627052745533176885'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/3627052745533176885'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2011/11/itc-172-assignment-four.html' title='ITC 172 Assignment Four'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-11898782439744174</id><published>2011-11-23T12:55:00.001-08:00</published><updated>2011-11-23T13:04:22.801-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC172'/><title type='text'>ITC 172 Assignment Three</title><content type='html'>&lt;h2&gt;Outcomes&lt;/h2&gt;&lt;p&gt;Connect to databases with ADO&lt;/p&gt;&lt;p&gt;Make interactive Web pages with Data bound controls&lt;/p&gt;&lt;p&gt;Understand and implement secure coding techniques&lt;/p&gt;&lt;hr/&gt;&lt;h2&gt;Practices&lt;/h2&gt; &lt;p&gt;1. Show the code to create and instantiate a new ADO connection object that connects to a database named MagazineTracker  using integrated security.&lt;/p&gt; &lt;p&gt;2. Show the code to create and instantiate a New ADO connection that connects to a database named MagazineTracker using SQL authentication with a username of "salesperson" and a password of "P@ssw0rd1"&lt;/p&gt; &lt;p&gt;3. Create a new SQL command object that gets all the data from the table Magazine.&lt;/p&gt; &lt;p&gt;4. Create the code to retrieve the data from the Magazine table and store it in a dataset. Bind the dataset to a ViewGrid &lt;/p&gt;  &lt;p&gt;5. Use Css to Style a ViewGrid&lt;/p&gt;&lt;hr/&gt; &lt;h2&gt;Programming&lt;/h2&gt;&lt;p&gt;Create a new empty  web site. Add A Web Form and a Style Sheet.Use ADO programming objects  to connect to the Automart Database and return a list of locations with their addresses. &lt;/p&gt;&lt;p&gt;Use Css to Style the ViewGrid.&lt;/p&gt;&lt;hr/&gt;&lt;h2&gt;What I am looking for&lt;/h2&gt;&lt;p&gt;Practices are worth 1 point each&lt;br/&gt;Using the ADO programming Objects to connect to the database 5 pts&lt;br/&gt;Using the ADO programming objects to return data 5pts&lt;br/&gt;Binding the data to the View Grid 3 pts&lt;br/&gt;Using the CSS to style the ViewGrid 2 pts&lt;/p&gt;&lt;p&gt;The total is worth 20 points&lt;/p&gt;&lt;hr/&gt;&lt;h2&gt;To turn in&lt;/h2&gt;&lt;p&gt;copy all the markup code, C# and CSS into a Google doc and share it with spconger@gmail.com&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-11898782439744174?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/11898782439744174/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2011/11/connecting-to-database-with-ado.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/11898782439744174'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/11898782439744174'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2011/11/connecting-to-database-with-ado.html' title='ITC 172 Assignment Three'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-5333583456390936629</id><published>2011-11-21T17:23:00.001-08:00</published><updated>2011-11-21T17:25:37.975-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC110'/><title type='text'>Color Change Code</title><content type='html'>&lt;p&gt;Here is the code for changing color&lt;/p&gt;&lt;pre&gt;&lt;br /&gt; private void button1_Click(object sender, RoutedEventArgs e)&lt;br /&gt;  {&lt;br /&gt;        &lt;br /&gt;     label1.Background = new LinearGradientBrush(Colors.DarkSlateBlue, &lt;br /&gt;Colors.SkyBlue, 45);&lt;br /&gt;     label1.Foreground = new SolidColorBrush(Colors.White);&lt;br /&gt;     this.Background = new LinearGradientBrush(Colors.Gold, &lt;br /&gt;Colors.Silver, 30);&lt;br /&gt;  }&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-5333583456390936629?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/5333583456390936629/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2011/11/olor-change-code.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/5333583456390936629'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/5333583456390936629'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2011/11/olor-change-code.html' title='Color Change Code'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-85395140213793732</id><published>2011-11-21T14:19:00.001-08:00</published><updated>2011-11-21T14:37:26.369-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC172'/><title type='text'>Styling ASP.Net with CSS</title><content type='html'>&lt;p&gt;With ASP.Net you can set control properties to get colors and effects you want, but it is generally a better idea to use CSS to style your pages.&lt;/&gt;&lt;p&gt;Setting the properties results in an inline style in the rendered HTML. This works and it is legal, but it it makes for a very hard to maintain web site. When you use in-line styles, it means if you want to change your sites look, you have to go to every single page and modify its controls separately. On the other hand, if you use CSS, you can change the whole look of a web site by editing just the one CSS file.&lt;/p&gt;&lt;p&gt;All web Controls render into xhtml before being displayed in the browser. So you can write CSS for the resulting xhtml objects rather than the ASP control itself. A GridView control, for instance, renders into a perfectly normal xhtml table. You can style it by styling the table elements. Below is an example of some CSS for styling a table that will apply to the DataGrid output. Note, it is not particularly sophisticated. It just shows the basics:&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;th&lt;br /&gt;{&lt;br /&gt; font-weight:bold;&lt;br /&gt; color:White;&lt;br /&gt; background-color:Navy;&lt;br /&gt; border:solid,2px,White;&lt;br /&gt; padding-left:5px;&lt;br /&gt; padding-right:5px;&lt;br /&gt; &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;td&lt;br /&gt;{&lt;br /&gt; border:solid,2px,Black;&lt;br /&gt; padding-left:5px;&lt;br /&gt; padding-right:5px;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;Here is a picture of the styled table&lt;/p&gt;&lt;div class="separator" style="clear: both;"&gt;&lt;a href="http://3.bp.blogspot.com/-kGeMJe8pGYU/TsrRAZCFx9I/AAAAAAAAAWw/2zxs4eS00Qs/s1600/tablestyle.JPG" imageanchor="1" style=""&gt;&lt;img border="0" height="109" width="320" src="http://3.bp.blogspot.com/-kGeMJe8pGYU/TsrRAZCFx9I/AAAAAAAAAWw/2zxs4eS00Qs/s320/tablestyle.JPG" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;You can also assign a CSS class to the cssStyle attribute of any ASP.Net control. Here is a simple Css class&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;.textback&lt;br /&gt;{&lt;br /&gt; background-color:Teal;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;Here is the ASP markup for applying the style&lt;/p&gt;&lt;pre&gt;&lt;br /&gt; &amp;lt;asp:TextBox ID="TextBox1" runat="server" CssClass="textback"&gt;&amp;lt;/asp:TextBox&gt;&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;Here is what it looks like when running&lt;/p&gt;&lt;div class="separator" style="clear: both;"&gt;&lt;a href="http://1.bp.blogspot.com/-WZ6YPnvkwOE/TsrSjx4tcOI/AAAAAAAAAW4/h7gSlZm9XJY/s1600/tealtext.JPG" imageanchor="1" style=""&gt;&lt;img border="0" height="35" width="160" src="http://1.bp.blogspot.com/-WZ6YPnvkwOE/TsrSjx4tcOI/AAAAAAAAAW4/h7gSlZm9XJY/s320/tealtext.JPG" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-85395140213793732?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/85395140213793732/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2011/11/styling-aspnet-with-css.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/85395140213793732'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/85395140213793732'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2011/11/styling-aspnet-with-css.html' title='Styling ASP.Net with CSS'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-kGeMJe8pGYU/TsrRAZCFx9I/AAAAAAAAAWw/2zxs4eS00Qs/s72-c/tablestyle.JPG' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-6870042132578352826</id><published>2011-11-21T12:07:00.001-08:00</published><updated>2011-11-21T12:10:05.425-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC220'/><title type='text'>ITC 220 SQL</title><content type='html'>&lt;p&gt;Here is the SQL we did in class&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;Use CommunityAssist&lt;br /&gt;&lt;br /&gt;--basic Select statement&lt;br /&gt;&lt;br /&gt;Select FirstName, LastName&lt;br /&gt;From Person&lt;br /&gt;&lt;br /&gt;/*This is a quick way but&lt;br /&gt;your can't choose the&lt;br /&gt;order the columns*/&lt;br /&gt;&lt;br /&gt; Select * From Person&lt;br /&gt;&lt;br /&gt;--aliasing field names&lt;br /&gt;Select FirstName as [First Name], lastName as [Last Name]&lt;br /&gt;From Person &lt;br /&gt;&lt;br /&gt;--returns only unique instances&lt;br /&gt;Select Distinct EmployeeKey from Donation&lt;br /&gt;&lt;br /&gt;--Calulations&lt;br /&gt;Select DonationKey, DonationDate, DonationAmount, &lt;br /&gt;DonationAmount *.9  as Charity, DonationAmount * .1 as maintainance&lt;br /&gt;From Donation&lt;br /&gt;&lt;br /&gt;--ordering the output&lt;br /&gt;Select DonationKey, DonationDate, DonationAmount, &lt;br /&gt;DonationAmount *.9  as Charity, DonationAmount * .1 as maintainance&lt;br /&gt;From Donation&lt;br /&gt;Order by DonationDate, DonationAmount Desc&lt;br /&gt;&lt;br /&gt;--where Clause&lt;br /&gt;Select * From PersonAddress&lt;br /&gt;Where City='Kent'&lt;br /&gt;&lt;br /&gt;Select DonationKey, donationDate, donationAmount&lt;br /&gt;From Donation&lt;br /&gt;Where DonationAmount &gt; 500&lt;br /&gt;&lt;br /&gt;-- &gt;, &amp;lt;, &gt;=, &amp;lt;=, !=&lt;br /&gt;&lt;br /&gt;--like searches for patterns &lt;br /&gt;--% any number of characters&lt;br /&gt;--_one character&lt;br /&gt;Select * From Person where LastName Like 'Tan%'&lt;br /&gt;&lt;br /&gt;Select * From Donation &lt;br /&gt;Where DonationDate between '3/15/2010' and '4/15/2010'&lt;br /&gt;&lt;br /&gt;--use is with nulls&lt;br /&gt;Select * From PersonAddress Where Apartment is Not Null&lt;br /&gt;&lt;br /&gt;Select * from PersonAddress where City ='Bellevue' or City = 'Kent'&lt;br /&gt;&lt;br /&gt;Select * From PersonAddress Where Apartment &lt;br /&gt;is not null and  not City  = 'Seattle'&lt;br /&gt;&lt;br /&gt;--scalar functions are in line functions&lt;br /&gt;&lt;br /&gt;Select Distinct MONTH(DonationDate) From Donation&lt;br /&gt;Select DAY(DonationDate) From Donation&lt;br /&gt;Select YEAR(DonationDate) from Donation&lt;br /&gt;&lt;br /&gt;Select DATEDIFF(dd, '11/21/2011','5/1/2012')&lt;br /&gt;&lt;br /&gt;--aggregate functions work accross multiple rows&lt;br /&gt;&lt;br /&gt;Select COUNT(Personkey) from Person&lt;br /&gt;Where LastName Like 'B%'&lt;br /&gt;&lt;br /&gt;Select MAX(DonationAmount) From Donation&lt;br /&gt;&lt;br /&gt;Select MIN(DonationAmount) From Donation&lt;br /&gt;&lt;br /&gt;Select SUM(DonationAmount) From Donation&lt;br /&gt;&lt;br /&gt;Select AVG(donationAmount) from Donation&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Select Month(DonationDate) as Month,&lt;br /&gt;SUM(DonationAmount) as total&lt;br /&gt;From Donation&lt;br /&gt;Group by MONTH(donationDate)&lt;br /&gt;&lt;br /&gt;Select EmployeeKey, &lt;br /&gt;SUM(DonationAmount) as total&lt;br /&gt;From Donation&lt;br /&gt;Group by EmployeeKey&lt;br /&gt;&lt;br /&gt;Select EmployeeKey, &lt;br /&gt;SUM(DonationAmount) as total&lt;br /&gt;From Donation&lt;br /&gt;Group by EmployeeKey&lt;br /&gt;Having SUM(donationAmount) &gt; 2000&lt;br /&gt;&lt;br /&gt;--Join&lt;br /&gt;&lt;br /&gt;Select lastName, firstname, Street, City, [State],Zip&lt;br /&gt;From Person &lt;br /&gt;Inner Join PersonAddress&lt;br /&gt;On Person.PersonKey=PersonAddress.PersonKey&lt;br /&gt;&lt;br /&gt;--tables aliased&lt;br /&gt;Select lastName, firstname, Street, City, [State],Zip&lt;br /&gt;From Person p&lt;br /&gt;Inner Join PersonAddress pa&lt;br /&gt;On p.PersonKey=pa.PersonKey&lt;br /&gt;&lt;br /&gt;Select lastName, firstname, Street, City, [State],Zip, ContactInfo as HomePhone&lt;br /&gt;From Person p&lt;br /&gt;Inner Join PersonAddress pa&lt;br /&gt;On p.PersonKey=pa.PersonKey&lt;br /&gt;Inner Join PersonContact pc&lt;br /&gt;on p.PersonKey=pc.PersonKey&lt;br /&gt;Where ContactTypeKey=1&lt;br /&gt;&lt;br /&gt;--Insert update Delete&lt;br /&gt;&lt;br /&gt;Insert into Person(LastName, FirstName)&lt;br /&gt;Values('Blackmore','John'),&lt;br /&gt;('More', 'Black')&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Select * From Person&lt;br /&gt;&lt;br /&gt;Update Person&lt;br /&gt;Set LastName='BlueBeard',&lt;br /&gt;FirstName='Jake'&lt;br /&gt;Where PersonKey=53&lt;br /&gt;&lt;br /&gt;Begin tran&lt;br /&gt;&lt;br /&gt;Update Person&lt;br /&gt;Set FirstName='Jason'&lt;br /&gt;Where PersonKey=1&lt;br /&gt;&lt;br /&gt;rollback tran&lt;br /&gt;commit Tran&lt;br /&gt;&lt;br /&gt;Delete from Person&lt;br /&gt;Where PersonKey=52&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-6870042132578352826?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/6870042132578352826/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2011/11/here-is-sql-we-did-in-class-2000.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/6870042132578352826'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/6870042132578352826'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2011/11/here-is-sql-we-did-in-class-2000.html' title='ITC 220 SQL'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-7822183741003586300</id><published>2011-11-17T12:21:00.001-08:00</published><updated>2011-11-17T12:21:22.952-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC110'/><title type='text'>Morning Mileage WPF (2)</title><content type='html'>&lt;p&gt;Here is the &lt;strong&gt;Windows.Xaml.cs&lt;/strong&gt; file&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Text;&lt;br /&gt;using System.Windows;&lt;br /&gt;using System.Windows.Controls;&lt;br /&gt;using System.Windows.Data;&lt;br /&gt;using System.Windows.Documents;&lt;br /&gt;using System.Windows.Input;&lt;br /&gt;using System.Windows.Media;&lt;br /&gt;using System.Windows.Media.Imaging;&lt;br /&gt;using System.Windows.Navigation;&lt;br /&gt;using System.Windows.Shapes;&lt;br /&gt;&lt;br /&gt;namespace MileageMorningWpf&lt;br /&gt;{&lt;br /&gt;    /// &lt;summary&gt;&lt;br /&gt;    /// Interaction logic for MainWindow.xaml&lt;br /&gt;    /// &lt;/summary&gt;&lt;br /&gt;    public partial class MainWindow : Window&lt;br /&gt;    {&lt;br /&gt;        public MainWindow()&lt;br /&gt;        {&lt;br /&gt;            InitializeComponent();&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        private void btnCalculate_Click(object sender, RoutedEventArgs e)&lt;br /&gt;        {&lt;br /&gt;            GetMileage();&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        private void GetMileage()&lt;br /&gt;        {&lt;br /&gt;            Mileage m;&lt;br /&gt;            double begMiles;&lt;br /&gt;            double endMiles;&lt;br /&gt;            double gals;&lt;br /&gt;            double price;&lt;br /&gt;&lt;br /&gt;            bool x = double.TryParse(txtBeginningMiles.Text, out begMiles);&lt;br /&gt;            bool y = double.TryParse(txtEndingMiles.Text, out endMiles);&lt;br /&gt;            bool z = double.TryParse(txtGallons.Text, out gals);&lt;br /&gt;            bool a = double.TryParse(txtPricePerGallon.Text, out price);&lt;br /&gt;&lt;br /&gt;            if (x == false || y == false)&lt;br /&gt;            {&lt;br /&gt;                MessageBox.Show("Mileage must be a real number");&lt;br /&gt;                txtBeginningMiles.Clear();&lt;br /&gt;                txtEndingMiles.Clear();&lt;br /&gt;                txtBeginningMiles.Focus();&lt;br /&gt;                return;&lt;br /&gt;&lt;br /&gt;            }&lt;br /&gt;            if (z == false)&lt;br /&gt;            {&lt;br /&gt;                MessageBox.Show("Gallons must be a real number");&lt;br /&gt;                txtGallons.Clear();&lt;br /&gt;                txtGallons.Focus();&lt;br /&gt;                return;&lt;br /&gt;&lt;br /&gt;            }&lt;br /&gt;            if (a == false)&lt;br /&gt;            {&lt;br /&gt;                MessageBox.Show("Price must be in numbers. No $ signs");&lt;br /&gt;                txtPricePerGallon.Clear();&lt;br /&gt;                txtPricePerGallon.Focus();&lt;br /&gt;                return;&lt;br /&gt;&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            try&lt;br /&gt;            {&lt;br /&gt;                m = new Mileage(begMiles, endMiles, gals, price);&lt;br /&gt;&lt;br /&gt;                lblMilesPerGallon.Content = "Your Mileage is: " + m.CalculateMilesPerGallon().ToString("F2");&lt;br /&gt;&lt;br /&gt;                if (m.CalculateMilesPerGallon() &gt; 50)&lt;br /&gt;                    lblMilesPerGallon.Background = new SolidColorBrush(Colors.Green);&lt;br /&gt;                else if (m.CalculateMilesPerGallon() &gt; 30)&lt;br /&gt;                    lblMilesPerGallon.Background = new SolidColorBrush(Colors.Yellow);&lt;br /&gt;                else&lt;br /&gt;                    lblMilesPerGallon.Background = new SolidColorBrush(Colors.Red);&lt;br /&gt;&lt;br /&gt;                lblTotalPrice.Content = "The cost for the gallons is " + m.TotalCost().ToString("c");&lt;br /&gt;            }//end try&lt;br /&gt;            catch (Exception ex)&lt;br /&gt;            {&lt;br /&gt;                MessageBox.Show(ex.Message);&lt;br /&gt;            }//end catch&lt;br /&gt;            &lt;br /&gt;        }//end GetMileage&lt;br /&gt;    } //end class&lt;br /&gt;}//end namespace&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;Here is the &lt;strong&gt;Mileage.cs &lt;/strong&gt;class&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-7822183741003586300?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/7822183741003586300/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2011/11/morning-mileage-wpf-2.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/7822183741003586300'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/7822183741003586300'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2011/11/morning-mileage-wpf-2.html' title='Morning Mileage WPF (2)'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-7401808430479729018</id><published>2011-11-17T09:21:00.001-08:00</published><updated>2011-11-23T08:55:43.883-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC172'/><title type='text'>ITC 172 Assignment Two</title><content type='html'>&lt;h2&gt;Practices&lt;/h2&gt; &lt;p&gt;1. Write a method that gets an integer from a text box and returns the cube of that number&lt;/p&gt; &lt;p&gt;2. Have three buttons share the same click event. In the event get the text of the button and display it on a label. (Just give me the code for the event)&lt;/p&gt; &lt;p&gt;3. Write the code to store a the value of a variable of type double in a Session.&lt;/p&gt; &lt;p&gt;4. Write the code to retrieve the variable in 3 from the session.&lt;/p&gt; &lt;p&gt;5. Write a method to clear a text box.&lt;/p&gt;&lt;p&gt;6. Create a simple HTML table with two columns and 3 rows&lt;/p&gt;&lt;hr/&gt; &lt;h2&gt;Programming Assignment&lt;/h2&gt;&lt;p&gt;One of my students was asked to write a calculator in ASP.Net for a job interview. She was unsure how to do it. I want to make sure you will know how.&lt;/p&gt;&lt;p&gt;Create a calculator that has the 10 number keys (make each number key a button. All 10 keys should share the same event.) &lt;/p&gt;&lt;p&gt;The calculator should have 4 functions: Addition, Subtraction, Multiplication, and Division. When you click one of the four operators above, the program should store the number that was in the text box and clear it to make it ready for the next entry.  It will also need to store the operator.&lt;/p&gt;&lt;p&gt;There should be a calculate or "=" button that  does the operation whether add, subtract, multiply or divide and returns the result to the textbox.  The calculator should also have a clear button to clear the textbox.&lt;/p&gt;&lt;p&gt;I would suggest using an html table to arrange the calculator.&lt;/p&gt;&lt;p&gt;You can add a style sheet to refine the display. &lt;/p&gt;&lt;hr/&gt;&lt;h2&gt;What I am looking for&lt;/h2&gt;&lt;p&gt;Each practice is worth 1 pt&lt;br/&gt;in the Programming Assignment Form layout 3pts&lt;br/&gt;using one method to handle all the numeric buttons 2 pts &lt;br/&gt;Saving temporary variables in session states 2pts &lt;/br&gt;Addition multiplication and subtraction 3 pts (1 pt each)&lt;br/&gt;Division, with division by zero handling 2 pts &lt;br/&gt;Clear button 1 pt&lt;/p&gt;&lt;p&gt;the total is worth 20 points&lt;/p&gt;&lt;hr/&gt;&lt;h2&gt;What to turn in&lt;/h2&gt;&lt;p&gt;Post all the html asp and c# code in a Google doc and share it with spconger@gmail.com&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-7401808430479729018?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/7401808430479729018/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2011/11/itc-172-assignment-two.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/7401808430479729018'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/7401808430479729018'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2011/11/itc-172-assignment-two.html' title='ITC 172 Assignment Two'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-3843146989351206500</id><published>2011-11-17T09:17:00.001-08:00</published><updated>2011-11-22T14:00:02.029-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC172'/><title type='text'>ITC 172 Assignment One</title><content type='html'>&lt;h2&gt;Outcomes&lt;/h2&gt;&lt;p&gt;Create basic programming structures&lt;/p&gt;&lt;p&gt;Create interactive web pages with data bound controls&lt;/p&gt;&lt;h2&gt;Practices&lt;/h2&gt;&lt;p&gt;In each of these, provide the code snippet requested by the question. You do not have to provide the whole project and surrounding code.&lt;p&gt; &lt;p&gt;1. Define an array that has the values "red, green, blue, yellow, white, black and brown"&lt;/p&gt; &lt;p&gt;2. Write the code that binds the array in one to a DropDownList.&lt;/p&gt; &lt;p&gt;3. Write the code to retrieve the text of the selected item from the DropDownlist&lt;/p&gt; &lt;p&gt;4. Add a calendar control to a web page, a button, and a label. Write the code so that when you click the button the current date shows in the label.&lt;/p&gt; &lt;p&gt;5. Write the code that would redirect the user to a second web page if they click a button.&lt;/p&gt; &lt;p&gt;6. Make an external style sheet that sets the color of the h2 element to Green. Attach the style sheet to the Web Form. (show the style sheet entry for h2, and the html for attaching the style sheet).&lt;/p&gt; &lt;p&gt;7. Write the code to pass the variables in a http Get&lt;/p&gt; &lt;p&gt;8. Write the coed to retrieve variables from an http Get string&lt;/p&gt;&lt;hr/&gt;&lt;h2&gt;Programing Assignment&lt;/h2&gt;&lt;p&gt;Create a web form for Students to sign up for counseling appointments.  It should have a calendar control. It should also  have a drop down list that  is bound to an array with the following elements : Class Selection, Degree audit, Initial interview, personal issues. The user should enter their name, choose the   reason for the visit from the DropDownList and select a date from the Calendar. When they click the button to make an appointment, you should check to makes sure all three elements are there, then pass them to a second page which shows their name, the Date, the type of appointment requested and confirms the appointment. &lt;/p&gt;&lt;hr/&gt;&lt;h2&gt;What I am looking for&lt;/h2&gt;&lt;p&gt;The practices are worth 1 point each&lt;/p&gt;&lt;p&gt;In the assignment:&lt;br/&gt;the array----2pts &lt;br/&gt;binding the array to the drop down list control---2pts&lt;br/&gt;Getting the selected date from the calendar--1pt&lt;br/&gt;Passing the information to the second page---2pts&lt;br/&gt;Displaying the information on the second page--2pts &lt;br/&gt;A working web app--3pts&lt;/p&gt;&lt;p&gt;The whole thing is worth 20 points&lt;/p&gt;&lt;hr/&gt;&lt;h2&gt;What to turn in&lt;/h2&gt;&lt;p&gt;Use your school google docs account or a personal google docs account and copy all the code, the html/asp markup and the C# into a document. Share it with spconger@gmail.com. I will write comments and grades on the document.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-3843146989351206500?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/3843146989351206500/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2011/11/itc-172-assignment-one.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/3843146989351206500'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/3843146989351206500'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2011/11/itc-172-assignment-one.html' title='ITC 172 Assignment One'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-7561618893260756579</id><published>2011-11-16T19:12:00.001-08:00</published><updated>2011-11-16T19:17:24.142-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC110'/><title type='text'>Mileage Class with form and validation</title><content type='html'>&lt;p&gt;Here is the Code for the form&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Text;&lt;br /&gt;using System.Windows;&lt;br /&gt;using System.Windows.Controls;&lt;br /&gt;using System.Windows.Data;&lt;br /&gt;using System.Windows.Documents;&lt;br /&gt;using System.Windows.Input;&lt;br /&gt;using System.Windows.Media;&lt;br /&gt;using System.Windows.Media.Imaging;&lt;br /&gt;using System.Windows.Navigation;&lt;br /&gt;using System.Windows.Shapes;&lt;br /&gt;&lt;br /&gt;namespace MileageWPF&lt;br /&gt;{&lt;br /&gt;    /// &lt;summary&gt;&lt;br /&gt;    /// Interaction logic for MainWindow.xaml&lt;br /&gt;    /// &lt;/summary&gt;&lt;br /&gt;    public partial class MainWindow : Window&lt;br /&gt;    {&lt;br /&gt;        public MainWindow()&lt;br /&gt;        {&lt;br /&gt;            InitializeComponent();&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        private void btnCalculate_Click(object sender, RoutedEventArgs e)&lt;br /&gt;        {&lt;br /&gt;            //call the method to process the mileage&lt;br /&gt;            ProcessMileage();&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        private void ProcessMileage()&lt;br /&gt;        {&lt;br /&gt;            &lt;br /&gt;&lt;br /&gt;            Mileage m;&lt;br /&gt;            double begMiles;&lt;br /&gt;            double endMiles;&lt;br /&gt;            double gals;&lt;br /&gt;            double price;&lt;br /&gt;            //we switched to try catches to stop mis-entry from crashing t\&lt;br /&gt;            //the progam&lt;br /&gt;            bool x = double.TryParse(txtBeginningMiles.Text, out begMiles);&lt;br /&gt;            bool y = double.TryParse(txtEndingMiles.Text, out endMiles);&lt;br /&gt;            bool z= double.TryParse(txtGallons.Text, out gals);&lt;br /&gt;            bool a = double.TryParse(txtPricePerGallon.Text, out price);&lt;br /&gt;            // this also checks to see if the value of gallons is 0&lt;br /&gt;            if (z == true &amp;&amp; gals &amp;lt;= 0)&lt;br /&gt;            {&lt;br /&gt;                MessageBox.Show("I am sure you used more than" + gals.ToString() + " gallons");&lt;br /&gt;                return;&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            if (x &amp;&amp; y &amp;&amp; z &amp;&amp; a)&lt;br /&gt;            {&lt;br /&gt;                //if they are all valid numbers&lt;br /&gt;                try&lt;br /&gt;                {&lt;br /&gt;                    //try this code&lt;br /&gt;                    m = new Mileage(begMiles, endMiles, gals, price);&lt;br /&gt;                }&lt;br /&gt;                catch (Exception ex)&lt;br /&gt;                {&lt;br /&gt;                    //if there are any errors catch them and display&lt;br /&gt;                    //the error message&lt;br /&gt;                    MessageBox.Show(ex.Message);&lt;br /&gt;                    return;&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;            else&lt;br /&gt;            {&lt;br /&gt;                //this is the message if the fields are left&lt;br /&gt;                //empty or don't contain real numbers&lt;br /&gt;                MessageBox.Show("You must use real numbers");&lt;br /&gt;                return;&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            lblMilesPerGallon.Content = "Your MPG is " + m.CalculateMilesPerGallon().ToString("F2");&lt;br /&gt;            lblCostOfGas.Content = "Your Cost is " + m.TotalCost().ToString("c");&lt;br /&gt;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        private void btnClear_Click(object sender, RoutedEventArgs e)&lt;br /&gt;        {&lt;br /&gt;            //call clear when the clear button is clicked&lt;br /&gt;            Clear();&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        private void Clear()&lt;br /&gt;        {&lt;br /&gt;            //this method clears the form&lt;br /&gt;            txtBeginningMiles.Clear();&lt;br /&gt;            txtEndingMiles.Clear();&lt;br /&gt;            txtGallons.Clear();&lt;br /&gt;            txtPricePerGallon.Clear();&lt;br /&gt;            lblCostOfGas.Content = "";&lt;br /&gt;            lblMilesPerGallon.Content = "";&lt;br /&gt;            txtBeginningMiles.Focus();&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;Here is the Modified Mileage Class&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Text;&lt;br /&gt;&lt;br /&gt;namespace MileageWPF&lt;br /&gt;{&lt;br /&gt;    public class Mileage&lt;br /&gt;    {&lt;br /&gt;        //this class calculates &lt;br /&gt;        //Gas mileage and cost&lt;br /&gt;        //fields&lt;br /&gt;        private double beginningMiles;&lt;br /&gt;        private double endingMiles;&lt;br /&gt;        private double gallons;&lt;br /&gt;        private double pricePerGallon;&lt;br /&gt;&lt;br /&gt;        //we have 3 constructors&lt;br /&gt;        public Mileage()&lt;br /&gt;        {&lt;br /&gt;            BeginningMiles=0;&lt;br /&gt;            EndingMiles=0;&lt;br /&gt;            Gallons=1;&lt;br /&gt;            PricePerGallon=0;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public Mileage(double begMiles, double endMiles, double gals)&lt;br /&gt;        {&lt;br /&gt;            BeginningMiles = begMiles;&lt;br /&gt;            EndingMiles = endMiles;&lt;br /&gt;            Gallons = gals;&lt;br /&gt;            PricePerGallon = 0;&lt;br /&gt;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public Mileage(double begMiles, double endMiles, double gals, double price)&lt;br /&gt;        {&lt;br /&gt;            //it is important to call the Properties&lt;br /&gt;            //not the underlying fields&lt;br /&gt;            BeginningMiles = begMiles;&lt;br /&gt;            EndingMiles = endMiles;&lt;br /&gt;            Gallons = gals;&lt;br /&gt;            PricePerGallon =price;&lt;br /&gt;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        #region Properties&lt;br /&gt;&lt;br /&gt;        public double BeginningMiles&lt;br /&gt;        {&lt;br /&gt;            get { return beginningMiles; }&lt;br /&gt;            set { beginningMiles = value; }&lt;br /&gt;        }&lt;br /&gt;               &lt;br /&gt;&lt;br /&gt;        public double EndingMiles&lt;br /&gt;        {&lt;br /&gt;            get { return endingMiles; }&lt;br /&gt;            set { endingMiles = value; }&lt;br /&gt;        }&lt;br /&gt;        &lt;br /&gt;        public double Gallons&lt;br /&gt;        {&lt;br /&gt;            get { return gallons; }&lt;br /&gt;            set {&lt;br /&gt;                if (value &lt;= 0)&lt;br /&gt;                {&lt;br /&gt;                    //we added some evaluation, we &lt;br /&gt;                    //created a Exception to handle&lt;br /&gt;                    //gallon values of 0 or less&lt;br /&gt;                    //we throw the exception back to the&lt;br /&gt;                    //form to be handled&lt;br /&gt;                    Exception ex = new Exception("You must have more than 0 Gallons");&lt;br /&gt;                    throw ex;&lt;br /&gt;                }&lt;br /&gt;        &lt;br /&gt;                gallons = value; &lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;       &lt;br /&gt;         public double PricePerGallon&lt;br /&gt;        {&lt;br /&gt;            get { return pricePerGallon; }&lt;br /&gt;            set { pricePerGallon = value; }&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;#endregion&lt;br /&gt;&lt;br /&gt;         private double TotalMiles()&lt;br /&gt;         {&lt;br /&gt;             return EndingMiles - BeginningMiles;&lt;br /&gt;         }&lt;br /&gt;&lt;br /&gt;         public double CalculateMilesPerGallon()&lt;br /&gt;         {&lt;br /&gt;             return TotalMiles() / Gallons;&lt;br /&gt;         }&lt;br /&gt;&lt;br /&gt;         public double TotalCost()&lt;br /&gt;         {&lt;br /&gt;             return Gallons * PricePerGallon;&lt;br /&gt;         }&lt;br /&gt;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-7561618893260756579?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/7561618893260756579/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2011/11/mileage-class-with-form-and-validation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/7561618893260756579'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/7561618893260756579'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2011/11/mileage-class-with-form-and-validation.html' title='Mileage Class with form and validation'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-4014790131516440681</id><published>2011-11-14T19:16:00.001-08:00</published><updated>2011-11-14T19:23:32.991-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC110'/><title type='text'>Mileage with Forms Evening</title><content type='html'>&lt;p&gt;We imported the mileage class and created a wpf form to get the inputs and display the outputs&lt;/p&gt;&lt;p&gt;Here is a picture of the form running&lt;/p&gt;&lt;div class="separator" style="clear: both;"&gt;&lt;a href="http://1.bp.blogspot.com/-l-PQ4P6kWng/TsHas4LqT_I/AAAAAAAAAWU/hByQsCAC_rs/s1600/MileageForm.JPG" imageanchor="1" style=""&gt;&lt;img border="0" height="218" width="320" src="http://1.bp.blogspot.com/-l-PQ4P6kWng/TsHas4LqT_I/AAAAAAAAAWU/hByQsCAC_rs/s320/MileageForm.JPG" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;Here is the XAMl for the windows form&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;Window x:Class="MileageWindowsForm.MainWindow"&lt;br /&gt;        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"&lt;br /&gt;        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"&lt;br /&gt;        Title="MainWindow" Height="350" Width="525"&gt;&lt;br /&gt;    &amp;lt;Grid&gt;&lt;br /&gt;        &amp;lt;Label Content="Enter the Beginning Mileage" &lt;br /&gt;Height="28" HorizontalAlignment="Left" Margin="43,33,0,0" &lt;br /&gt;Name="label1" VerticalAlignment="Top" /&gt;&lt;br /&gt;        &amp;lt;TextBox Height="23" HorizontalAlignment="Right" &lt;br /&gt;Margin="0,33,161,0" Name="txtBeginningMileage" &lt;br /&gt;VerticalAlignment="Top" Width="120" /&gt;&lt;br /&gt;        &amp;lt;Label Content="Enter Ending Mileage" &lt;br /&gt;Height="28" HorizontalAlignment="Left" Margin="43,71,0,0" &lt;br /&gt;Name="label2" VerticalAlignment="Top" /&gt;&lt;br /&gt;        &amp;lt;TextBox Height="23" HorizontalAlignment="Right" &lt;br /&gt;Margin="0,70,161,0" Name="txtEndingMileage" &lt;br /&gt;VerticalAlignment="Top" Width="120" /&gt;&lt;br /&gt;        &amp;lt;Label Content="Enter Number of Gallons" Height="28" &lt;br /&gt;HorizontalAlignment="Left" Margin="43,110,0,0" &lt;br /&gt;Name="label3" VerticalAlignment="Top" /&gt;&lt;br /&gt;        &amp;lt;TextBox Height="23" HorizontalAlignment="Right" &lt;br /&gt;Margin="0,110,161,0" Name="txtGallons" &lt;br /&gt;VerticalAlignment="Top" Width="120" /&gt;&lt;br /&gt;        &amp;lt;Label Content="Enter the Price Per Gallon" Height="28" &lt;br /&gt;HorizontalAlignment="Left" Margin="43,153,0,0" Name="label4" &lt;br /&gt;VerticalAlignment="Top" /&gt;&lt;br /&gt;        &amp;lt;TextBox Height="23" HorizontalAlignment="Right" &lt;br /&gt;Margin="0,153,161,0" Name="txtPricePerGallon" &lt;br /&gt;VerticalAlignment="Top" Width="120" /&gt;&lt;br /&gt;        &amp;lt;Button Content="Calculate" Height="23" &lt;br /&gt;HorizontalAlignment="Left" Margin="50,193,0,0" &lt;br /&gt;Name="btnCalculateMileage" VerticalAlignment="Top" Width="75" &lt;br /&gt;Click="btnCalculateMileage_Click" /&gt;&lt;br /&gt;        &amp;lt;Label Content="label for miles" Height="28" &lt;br /&gt;HorizontalAlignment="Left" Margin="174,189,0,0" Name="lblMilesPerGallon" &lt;br /&gt;VerticalAlignment="Top" Width="205" /&gt;&lt;br /&gt;        &amp;lt;Label Content="Label for Price" Height="28" &lt;br /&gt;HorizontalAlignment="Left" Margin="174,223,0,0" Name="lblPrice" &lt;br /&gt;VerticalAlignment="Top" Width="210" /&gt;&lt;br /&gt;    &amp;lt;/Grid&gt;&lt;br /&gt;&amp;lt;/Window&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;Here is the code for Mainwindow.xaml.cs&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Text;&lt;br /&gt;using System.Windows;&lt;br /&gt;using System.Windows.Controls;&lt;br /&gt;using System.Windows.Data;&lt;br /&gt;using System.Windows.Documents;&lt;br /&gt;using System.Windows.Input;&lt;br /&gt;using System.Windows.Media;&lt;br /&gt;using System.Windows.Media.Imaging;&lt;br /&gt;using System.Windows.Navigation;&lt;br /&gt;using System.Windows.Shapes;&lt;br /&gt;&lt;br /&gt;namespace MileageWindowsForm&lt;br /&gt;{&lt;br /&gt;    /// &lt;summary&gt;&lt;br /&gt;    /// Interaction logic for MainWindow.xaml&lt;br /&gt;    /// &lt;/summary&gt;&lt;br /&gt;    public partial class MainWindow : Window&lt;br /&gt;    {&lt;br /&gt;        public MainWindow()&lt;br /&gt;        {&lt;br /&gt;            InitializeComponent();&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        private void btnCalculateMileage_Click(object sender, RoutedEventArgs e)&lt;br /&gt;        {&lt;br /&gt;            Mileage m = new Mileage();&lt;br /&gt;            m.BeginningMiles = double.Parse(txtBeginningMileage.Text);&lt;br /&gt;            m.EndingMiles = double.Parse(txtEndingMileage.Text);&lt;br /&gt;            m.Gallons = double.Parse(txtGallons.Text);&lt;br /&gt;            m.PricePerGallon = double.Parse(txtPricePerGallon.Text);&lt;br /&gt;&lt;br /&gt;            double MPG = m.CalculateMilesPerGallon();&lt;br /&gt;            double totalCost = m.TotalCost();&lt;br /&gt;&lt;br /&gt;            lblMilesPerGallon.Content = "Your MPG is " + MPG.ToString("F2");&lt;br /&gt;            lblPrice.Content = "The total cost is " + totalCost.ToString("c");&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;Here is the Mileage Class again. It is totally unchanged from the previous console.Examples&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Text;&lt;br /&gt;&lt;br /&gt;namespace MileageWindowsForm&lt;br /&gt;{&lt;br /&gt;    public class Mileage&lt;br /&gt;    {&lt;br /&gt;        //fields&lt;br /&gt;        private double beginningMiles;&lt;br /&gt;        private double endingMiles;&lt;br /&gt;        private double gallons;&lt;br /&gt;        private double pricePerGallon;&lt;br /&gt;&lt;br /&gt;        public Mileage()&lt;br /&gt;        {&lt;br /&gt;            beginningMiles=0;&lt;br /&gt;            endingMiles=0;&lt;br /&gt;            gallons=0;&lt;br /&gt;            pricePerGallon=0;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public Mileage(double begMiles, double endMiles, double gals)&lt;br /&gt;        {&lt;br /&gt;            beginningMiles = begMiles;&lt;br /&gt;            endingMiles = endMiles;&lt;br /&gt;            gallons = gals;&lt;br /&gt;            pricePerGallon = 0;&lt;br /&gt;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public Mileage(double begMiles, double endMiles, double gals, double price)&lt;br /&gt;        {&lt;br /&gt;            beginningMiles = begMiles;&lt;br /&gt;            endingMiles = endMiles;&lt;br /&gt;            gallons = gals;&lt;br /&gt;            pricePerGallon =price;&lt;br /&gt;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        #region Properties&lt;br /&gt;&lt;br /&gt;        public double BeginningMiles&lt;br /&gt;        {&lt;br /&gt;            get { return beginningMiles; }&lt;br /&gt;            set { beginningMiles = value; }&lt;br /&gt;        }&lt;br /&gt;               &lt;br /&gt;&lt;br /&gt;        public double EndingMiles&lt;br /&gt;        {&lt;br /&gt;            get { return endingMiles; }&lt;br /&gt;            set { endingMiles = value; }&lt;br /&gt;        }&lt;br /&gt;        &lt;br /&gt;        public double Gallons&lt;br /&gt;        {&lt;br /&gt;            get { return gallons; }&lt;br /&gt;            set { gallons = value; }&lt;br /&gt;        }&lt;br /&gt;       &lt;br /&gt;         public double PricePerGallon&lt;br /&gt;        {&lt;br /&gt;            get { return pricePerGallon; }&lt;br /&gt;            set { pricePerGallon = value; }&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;#endregion&lt;br /&gt;&lt;br /&gt;         private double TotalMiles()&lt;br /&gt;         {&lt;br /&gt;             return EndingMiles - BeginningMiles;&lt;br /&gt;         }&lt;br /&gt;&lt;br /&gt;         public double CalculateMilesPerGallon()&lt;br /&gt;         {&lt;br /&gt;             return TotalMiles() / Gallons;&lt;br /&gt;         }&lt;br /&gt;&lt;br /&gt;         public double TotalCost()&lt;br /&gt;         {&lt;br /&gt;             return Gallons * PricePerGallon;&lt;br /&gt;         }&lt;br /&gt;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-4014790131516440681?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/4014790131516440681/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2011/11/mileage-with-forms-evening.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/4014790131516440681'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/4014790131516440681'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2011/11/mileage-with-forms-evening.html' title='Mileage with Forms Evening'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-l-PQ4P6kWng/TsHas4LqT_I/AAAAAAAAAWU/hByQsCAC_rs/s72-c/MileageForm.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-1442497343067222631</id><published>2011-11-09T14:09:00.000-08:00</published><updated>2011-11-09T14:11:04.692-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>Java Equivalent of ITC 110 Assignment 6</title><content type='html'>&lt;p&gt;Here is the code for the BMI Class&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;public class BMI {&lt;br /&gt;&lt;br /&gt; /**&lt;br /&gt;  * This class calculates Body&lt;br /&gt;  * Mass Index&lt;br /&gt;  */&lt;br /&gt; //fields&lt;br /&gt; private int weight;&lt;br /&gt; private int feet;&lt;br /&gt; private int inches;&lt;br /&gt; private int totalHeightInInches;&lt;br /&gt; &lt;br /&gt; //constructors&lt;br /&gt; public BMI(){&lt;br /&gt;  weight=0;&lt;br /&gt;  feet=0;&lt;br /&gt;  inches=0;&lt;br /&gt;  totalHeightInInches=0;&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; public BMI(int weightInPounds, int heightInFeet, int additionalInches)&lt;br /&gt; {&lt;br /&gt;  SetWeight(weightInPounds);&lt;br /&gt;  SetHeightInFeet(heightInFeet);&lt;br /&gt;  SetRemainingInches(additionalInches);&lt;br /&gt;  totalHeightInInches=0;&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; //mutators and accessors&lt;br /&gt; public void SetWeight(int w)&lt;br /&gt; {&lt;br /&gt;    weight=w;&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; public int GetWeight()&lt;br /&gt; {&lt;br /&gt;  return weight;&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; public void SetHeightInFeet(int ft)&lt;br /&gt; {&lt;br /&gt;  feet=ft;&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; public int GetHeightInFeet()&lt;br /&gt; {&lt;br /&gt;  return feet;&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; public void SetRemainingInches(int inch)&lt;br /&gt; {&lt;br /&gt;  inches=inch;&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; public int GetRemainingInches()&lt;br /&gt; {&lt;br /&gt;  return inches;&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; //methods&lt;br /&gt; &lt;br /&gt; private void CalculateTotalHeightInInches()&lt;br /&gt; {&lt;br /&gt;  totalHeightInInches=(feet*12)+inches;&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; public double CalculateBMI()&lt;br /&gt; {&lt;br /&gt;  CalculateTotalHeightInInches();&lt;br /&gt;  return (double)GetWeight() * 703/(double)&lt;br /&gt;    (totalHeightInInches * totalHeightInInches);&lt;br /&gt; &lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; public String BMIEvaluation(){&lt;br /&gt;  double b = CalculateBMI();&lt;br /&gt;  String eval="";&lt;br /&gt;  if (b &gt; 30)&lt;br /&gt;   eval="Obese";&lt;br /&gt;  else if (b &gt;24.9)&lt;br /&gt;   eval="Overweight";&lt;br /&gt;  else if (b &gt; 18.4)&lt;br /&gt;   eval="Normal";&lt;br /&gt;  else&lt;br /&gt;   eval="Underweight";&lt;br /&gt;  &lt;br /&gt;  return eval;&lt;br /&gt;   &lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; &lt;br /&gt; &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;hr/&gt;&lt;p&gt;Here is the program class with the main. You could make a display class that is called by the main. That would be a better structure, but I did not specify that as a requirement&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;import java.util.Scanner;&lt;br /&gt;public class Program {&lt;br /&gt;&lt;br /&gt; /**&lt;br /&gt;  * @param args&lt;br /&gt;  */&lt;br /&gt; public static void main(String[] args) {&lt;br /&gt;  Scanner scan=new Scanner(System.in);&lt;br /&gt;  &lt;br /&gt;  System.out.println("Enter your wieght in pounds");&lt;br /&gt;  int lbs = scan.nextInt();&lt;br /&gt;  &lt;br /&gt;  System.out.println("enter your height in feet");&lt;br /&gt;  int ft = scan.nextInt();&lt;br /&gt;  &lt;br /&gt;  System.out.println("enter any Remaining inches");&lt;br /&gt;  int inch = scan.nextInt();&lt;br /&gt;  &lt;br /&gt;  BMI bmi = new BMI(lbs, ft, inch);&lt;br /&gt;  double b = bmi.CalculateBMI();&lt;br /&gt;  &lt;br /&gt;  System.out.println("Your BM! is " + b);&lt;br /&gt;  String badNews=bmi.BMIEvaluation();&lt;br /&gt;  System.out.println(badNews);&lt;br /&gt;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;Here is the output&lt;/p&gt;&lt;hr/&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;Enter your wieght in pounds&lt;br /&gt;180&lt;br /&gt;enter your height in feet&lt;br /&gt;5&lt;br /&gt;enter any Remaining inches&lt;br /&gt;10&lt;br /&gt;Your BM! is 25.824489795918367&lt;br /&gt;Overweight&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-1442497343067222631?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/1442497343067222631/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2011/11/java-equivalent-of-itc-110-assignment-6.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/1442497343067222631'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/1442497343067222631'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2011/11/java-equivalent-of-itc-110-assignment-6.html' title='Java Equivalent of ITC 110 Assignment 6'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-486801152709409111</id><published>2011-11-08T14:28:00.000-08:00</published><updated>2011-11-17T09:19:12.276-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC172'/><title type='text'>Model View Control (MVC)</title><content type='html'>&lt;h1&gt;Overview&lt;/h1&gt;&lt;p&gt;Model View Control is an object oriented programming pattern. It consists of three parts. (Each part can consist of more than one class.). The pattern has the advantage of clearly separating responsibilities and concerns.&lt;/p&gt;&lt;h2&gt;Model&lt;/h2&gt;&lt;p&gt;The model's responsibility is connecting to and dealing with data. This can be done with LINQ, as in our example, or with Data Entities or with classic ADO.Net&lt;/p&gt;&lt;h2&gt;Controller&lt;/h2&gt;&lt;p&gt;The controller acts as an intermediary between the data and the display of the data in a &lt;strong&gt;view&lt;/strong&gt;&lt;/p&gt;&lt;h2&gt;View&lt;/h2&gt;&lt;p&gt;The view consist of html designed to display the data&lt;/p&gt;&lt;h1&gt;The Tutorial&lt;/h1&gt;&lt;p&gt;Open Visual Studio and select New Project. Select ASP. MVC 2 Web Project&lt;/p&gt;&lt;div class="separator" style="clear: both;"&gt;&lt;a href="http://1.bp.blogspot.com/-XHRbLXeqR1s/Trmbrlhb4qI/AAAAAAAAAUQ/vvvL0pxM8GM/s1600/picture1.JPG" imageanchor="1" style=""&gt;&lt;img border="0" height="286" width="320" src="http://1.bp.blogspot.com/-XHRbLXeqR1s/Trmbrlhb4qI/AAAAAAAAAUQ/vvvL0pxM8GM/s320/picture1.JPG" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;Go ahead and create a test project, though we will not be looking at it right now&lt;/p&gt;&lt;div class="separator" style="clear: both;"&gt;&lt;a href="http://2.bp.blogspot.com/-t7ckJASVBCM/TrmcErrw5lI/AAAAAAAAAUc/GETU5-4iMoQ/s1600/Picture2.JPG" imageanchor="1" style=""&gt;&lt;img border="0" height="206" width="320" src="http://2.bp.blogspot.com/-t7ckJASVBCM/TrmcErrw5lI/AAAAAAAAAUc/GETU5-4iMoQ/s320/Picture2.JPG" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;You will end up with the following in your Solution pane&lt;/p&gt;&lt;div class="separator" style="clear: both;"&gt;&lt;a href="http://3.bp.blogspot.com/-fs0WtOjKmpQ/Trmcr1iIRFI/AAAAAAAAAUo/Y0NfPJ3KBgw/s1600/picture3.JPG" imageanchor="1" style=""&gt;&lt;img border="0" height="320" width="190" src="http://3.bp.blogspot.com/-fs0WtOjKmpQ/Trmcr1iIRFI/AAAAAAAAAUo/Y0NfPJ3KBgw/s320/picture3.JPG" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;In the code window you have the code for the Home Controler&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Web;&lt;br /&gt;using System.Web.Mvc;&lt;br /&gt;&lt;br /&gt;namespace VehicleMVC.Controllers&lt;br /&gt;{&lt;br /&gt;    [HandleError]&lt;br /&gt;    public class HomeController : Controller&lt;br /&gt;    {&lt;br /&gt;        public ActionResult Index()&lt;br /&gt;        {&lt;br /&gt;            ViewData["Message"] = "Welcome to ASP.NET MVC!";&lt;br /&gt;&lt;br /&gt;            return View();&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public ActionResult About()&lt;br /&gt;        {&lt;br /&gt;            return View();&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;We will ignore it for now&lt;/p&gt;&lt;p&gt;First we will build the model.&lt;/p&gt;&lt;p&gt;Right Click on the model folder and from the context menu choose Add, New. Select "Data" in the object dialog and then "Linq to SQL classes"&lt;/p&gt;&lt;div class="separator" style="clear: both;"&gt;&lt;a href="http://1.bp.blogspot.com/-Di1mLx1eP4s/Trmd3xRiMXI/AAAAAAAAAU0/SiV35_5g7o8/s1600/picture4.JPG" imageanchor="1" style=""&gt;&lt;img border="0" height="157" width="320" src="http://1.bp.blogspot.com/-Di1mLx1eP4s/Trmd3xRiMXI/AAAAAAAAAU0/SiV35_5g7o8/s320/picture4.JPG" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;Name the Linq to SQL "Vehicles.dbml" and click OK&lt;/p&gt;&lt;p&gt;If it is not open already, from the View menu select "Server Explorer"&lt;/p&gt;&lt;p&gt;If you do not have an existing connection to Automart Database, add one. If you do have a connection you can skip the next 3 steps&lt;/p&gt;&lt;p&gt;Right click on Data Connections and select Add Connection&lt;/p&gt;&lt;p&gt;Choose SQL Server for a data source&lt;/p&gt;&lt;div class="separator" style="clear: both;"&gt;&lt;a href="http://3.bp.blogspot.com/-1b-rpE9PO-k/TrmfOt1VinI/AAAAAAAAAVA/UB6NgjqbBo8/s1600/picture5.JPG" imageanchor="1" style=""&gt;&lt;img border="0" height="183" width="320" src="http://3.bp.blogspot.com/-1b-rpE9PO-k/TrmfOt1VinI/AAAAAAAAAVA/UB6NgjqbBo8/s320/picture5.JPG" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;Type "Localhost" for the name of the server and select "Automart" as the database&lt;/p&gt;&lt;div class="separator" style="clear: both;"&gt;&lt;a href="http://3.bp.blogspot.com/-2aCof-RKjYo/TrmftT_SZeI/AAAAAAAAAVM/8B8khCwg0wU/s1600/picture6.JPG" imageanchor="1" style=""&gt;&lt;img border="0" height="320" width="215" src="http://3.bp.blogspot.com/-2aCof-RKjYo/TrmftT_SZeI/AAAAAAAAAVM/8B8khCwg0wU/s320/picture6.JPG" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;Press OK&lt;/p&gt;&lt;p&gt;Expand the node for the new connections. Expand Tables. Locate the table Vehicles and drag it onto the designer&lt;/p&gt;&lt;div class="separator" style="clear: both;"&gt;&lt;a href="http://4.bp.blogspot.com/-6YxBapjSR7M/Trmgb0-JK1I/AAAAAAAAAVY/8f-TgbJg3x4/s1600/picture7.JPG" imageanchor="1" style=""&gt;&lt;img border="0" height="194" width="320" src="http://4.bp.blogspot.com/-6YxBapjSR7M/Trmgb0-JK1I/AAAAAAAAAVY/8f-TgbJg3x4/s320/picture7.JPG" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;Save the Designer&lt;/p&gt;&lt;p&gt;In the Solutions pane, right click on the Controller folder and select Add controller. Name it "VehicleController."&lt;/p&gt;&lt;div class="separator" style="clear: both;"&gt;&lt;a href="http://1.bp.blogspot.com/-fo-JEpdpxfo/TrmhFddAGoI/AAAAAAAAAVk/lehLQ8-Q0Io/s1600/picture8.JPG" imageanchor="1" style=""&gt;&lt;img border="0" height="138" width="320" src="http://1.bp.blogspot.com/-fo-JEpdpxfo/TrmhFddAGoI/AAAAAAAAAVk/lehLQ8-Q0Io/s320/picture8.JPG" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;Add the following using line to the top. It connects the controller with the data model&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;using VehicleMVC.Models;&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;Change the method name to VehicleView and then add code as shown below&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;        public ActionResult VehicleView()&lt;br /&gt;        {&lt;br /&gt;           VehiclesDataContext dc = new VehiclesDataContext();&lt;br /&gt;           var cars = from v in dc.vehicles&lt;br /&gt;                      orderby v.VehicleYear&lt;br /&gt;                      select v;&lt;br /&gt;            return View(cars);&lt;br /&gt;        }&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;Right click in the method and select Add View&lt;/p&gt;&lt;div class="separator" style="clear: both;"&gt;&lt;a href="http://2.bp.blogspot.com/-1QWBsLQj1lA/Trmi9PGmw1I/AAAAAAAAAVw/Z-BUEY0ii4c/s1600/picture9.JPG" imageanchor="1" style=""&gt;&lt;img border="0" height="320" width="313" src="http://2.bp.blogspot.com/-1QWBsLQj1lA/Trmi9PGmw1I/AAAAAAAAAVw/Z-BUEY0ii4c/s320/picture9.JPG" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;Add a page directive on the view to import the data model&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;%@ Import Namespace="VehicleMVC.Models" %&gt;&lt;br /&gt;&lt;/pre&gt;&lt;p&gt; Modify the content 2 section. Add this foreach loop&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;h2&gt;Vehicles Served&amp;lt;/h2&gt;&lt;br /&gt;    &amp;lt;ul&gt;&lt;br /&gt;    &amp;lt;%foreach (vehicle v in (IEnumerable)ViewData.Model)&lt;br /&gt;      { %&gt;&lt;br /&gt;      &amp;lt;li&gt;&amp;lt;%= v.LicenseNumber%&gt; | &amp;lt;%= v.VehicleMake%&gt; | &amp;lt;%= v.VehicleYear%&gt;&amp;lt;/li&gt;&lt;br /&gt;      &amp;lt;%} %&gt;&lt;br /&gt;    &amp;lt;/ul&gt;&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;The whole page looks like this&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %&gt;&lt;br /&gt;&amp;lt;%@ Import Namespace="VehicleMVC.Models" %&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server"&gt;&lt;br /&gt; VehicleView&lt;br /&gt;&amp;lt;/asp:Content&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"&gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;h2&gt;Vehicles Served&amp;lt;/h2&gt;&lt;br /&gt;    &amp;lt;ul&gt;&lt;br /&gt;    &amp;lt;%foreach (vehicle v in (IEnumerable)ViewData.Model)&lt;br /&gt;      { %&gt;&lt;br /&gt;      &amp;lt;li&gt;&amp;lt;%= v.LicenseNumber%&gt; | &amp;lt;%= v.VehicleMake%&gt; | &amp;lt;%= v.VehicleYear%&gt;&amp;lt;/li&gt;&lt;br /&gt;      &amp;lt;%} %&gt;&lt;br /&gt;    &amp;lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/asp:Content&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;Now we will modify the main master page to add a new tab and display the view&lt;/p&gt;&lt;p&gt;find and open the Site.Master under Views/Shared in the Solution Explorer&lt;/p&gt;&lt;p&gt;In the site master under the div "menucontainer" add another list item so that the menu looks like this&lt;/p&gt;&lt;pre&gt;&lt;br /&gt; &amp;lt;div id="menucontainer"&gt;&lt;br /&gt;            &lt;br /&gt;     &amp;lt;ul id="menu"&gt;              &lt;br /&gt;          &amp;lt;li&gt;&amp;lt;%= Html.ActionLink("Home", "Index", "Home")%&gt;&amp;lt;/li&gt;&lt;br /&gt;          &amp;lt;li&gt;&amp;lt;%= Html.ActionLink("About", "About", "Home")%&gt;&amp;lt;/li&gt;&lt;br /&gt;          &amp;lt;li&gt;&amp;lt;%= Html.ActionLink("Vehicles","VehicleView","Vehicle") %&gt;&amp;lt;/li&gt;&lt;br /&gt;      &amp;lt;/ul&gt;&lt;br /&gt;            &lt;br /&gt; &amp;lt;/div&gt;&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;The first item is the text for the tab, the second the name of the view file, the third the folder it is in.&lt;/p&gt;&lt;p&gt;Run the program. It can take quite awhile to compile the first time&lt;/p&gt;&lt;p&gt;If all goes well (an unlikely event) you should see the following web page&lt;/p&gt;&lt;div class="separator" style="clear: both;"&gt;&lt;a href="http://1.bp.blogspot.com/-bbwCfl1q0EI/TrmslRg05jI/AAAAAAAAAV8/t3AvIsfXgF8/s1600/picture10.JPG" imageanchor="1" style=""&gt;&lt;img border="0" height="162" width="320" src="http://1.bp.blogspot.com/-bbwCfl1q0EI/TrmslRg05jI/AAAAAAAAAV8/t3AvIsfXgF8/s320/picture10.JPG" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;Click the vehicle tab and you should see the vehicles listed by year&lt;/p&gt;&lt;div class="separator" style="clear: both;"&gt;&lt;a href="http://1.bp.blogspot.com/-pz6GNiUV_aw/Trms9DltOEI/AAAAAAAAAWI/hk7EIX5W0gk/s1600/picture11.JPG" imageanchor="1" style=""&gt;&lt;img border="0" height="163" width="320" src="http://1.bp.blogspot.com/-pz6GNiUV_aw/Trms9DltOEI/AAAAAAAAAWI/hk7EIX5W0gk/s320/picture11.JPG" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-486801152709409111?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/486801152709409111/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2011/11/model-view-control-mvc.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/486801152709409111'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/486801152709409111'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2011/11/model-view-control-mvc.html' title='Model View Control (MVC)'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-XHRbLXeqR1s/Trmbrlhb4qI/AAAAAAAAAUQ/vvvL0pxM8GM/s72-c/picture1.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-3456009536507019873</id><published>2011-11-08T11:56:00.000-08:00</published><updated>2011-11-08T11:56:35.230-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC110'/><title type='text'>Mileage Classes Morning</title><content type='html'>&lt;h2&gt;Program.cs&lt;/h2&gt;&lt;pre&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Text;&lt;br /&gt;&lt;br /&gt;namespace MileageClassExample&lt;br /&gt;{&lt;br /&gt;    class Program&lt;br /&gt;    {&lt;br /&gt;        static void Main(string[] args)&lt;br /&gt;        {&lt;br /&gt;            Display d = new Display();&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;hr/&gt;&lt;h2&gt;Display.cs&lt;/h2&gt;&lt;pre&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Text;&lt;br /&gt;&lt;br /&gt;namespace MileageClassExample&lt;br /&gt;{&lt;br /&gt;    class Display&lt;br /&gt;    {&lt;br /&gt;        Mileage m;&lt;br /&gt;&lt;br /&gt;        public Display()&lt;br /&gt;        {&lt;br /&gt;            m = new Mileage();&lt;br /&gt;            GetInputs();&lt;br /&gt;            DisplayOutputs();&lt;br /&gt;            PauseIt();&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        private void GetInputs()&lt;br /&gt;        {&lt;br /&gt;            Console.WriteLine("This program calculates Mileage");&lt;br /&gt;            Console.WriteLine("*****************************");&lt;br /&gt;&lt;br /&gt;            Console.WriteLine("Enter the Beginning Mileage");&lt;br /&gt;            m.BeginningMiles = double.Parse(Console.ReadLine());&lt;br /&gt;&lt;br /&gt;            Console.WriteLine("Enter the Ending Mileage");&lt;br /&gt;            m.EndingMiles = double.Parse(Console.ReadLine());&lt;br /&gt;&lt;br /&gt;            Console.WriteLine("Enter the Gallons");&lt;br /&gt;            m.Gallons = double.Parse(Console.ReadLine());&lt;br /&gt;&lt;br /&gt;            Console.WriteLine("Enter the Price per gallon");&lt;br /&gt;            m.PricePerGallon = double.Parse(Console.ReadLine());&lt;br /&gt;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        private void DisplayOutputs()&lt;br /&gt;        {&lt;br /&gt;            Console.WriteLine("***********************");&lt;br /&gt;            Console.WriteLine("Your Miles Per Gallon is {0:F2}", &lt;br /&gt;                m.CalculateMilesPerGallon());&lt;br /&gt;            Console.WriteLine("You paid {0:C}", m.TotalCost());&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        private void PauseIt()&lt;br /&gt;        {&lt;br /&gt;            Console.WriteLine("Press any key to exit");&lt;br /&gt;            Console.ReadKey();&lt;br /&gt;        }//end PauseIt&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;h2&gt;Mileage.cs&lt;/h2&gt;&lt;pre&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Text;&lt;br /&gt;&lt;br /&gt;namespace MileageClassExample&lt;br /&gt;{&lt;br /&gt;    public class Mileage&lt;br /&gt;    {&lt;br /&gt;        //fields&lt;br /&gt;        private double beginningMiles;&lt;br /&gt;        private double endingMiles;&lt;br /&gt;        private double gallons;&lt;br /&gt;        private double pricePerGallon;&lt;br /&gt;&lt;br /&gt;        public Mileage()&lt;br /&gt;        {&lt;br /&gt;            beginningMiles=0;&lt;br /&gt;            endingMiles=0;&lt;br /&gt;            gallons=0;&lt;br /&gt;            pricePerGallon=0;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public Mileage(double begMiles, double endMiles, double gals)&lt;br /&gt;        {&lt;br /&gt;            beginningMiles = begMiles;&lt;br /&gt;            endingMiles = endMiles;&lt;br /&gt;            gallons = gals;&lt;br /&gt;            pricePerGallon = 0;&lt;br /&gt;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public Mileage(double begMiles, double endMiles, double gals, double price)&lt;br /&gt;        {&lt;br /&gt;            beginningMiles = begMiles;&lt;br /&gt;            endingMiles = endMiles;&lt;br /&gt;            gallons = gals;&lt;br /&gt;            pricePerGallon =price;&lt;br /&gt;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        #region Properties&lt;br /&gt;&lt;br /&gt;        public double BeginningMiles&lt;br /&gt;        {&lt;br /&gt;            get { return beginningMiles; }&lt;br /&gt;            set { beginningMiles = value; }&lt;br /&gt;        }&lt;br /&gt;               &lt;br /&gt;&lt;br /&gt;        public double EndingMiles&lt;br /&gt;        {&lt;br /&gt;            get { return endingMiles; }&lt;br /&gt;            set { endingMiles = value; }&lt;br /&gt;        }&lt;br /&gt;        &lt;br /&gt;        public double Gallons&lt;br /&gt;        {&lt;br /&gt;            get { return gallons; }&lt;br /&gt;            set { gallons = value; }&lt;br /&gt;        }&lt;br /&gt;       &lt;br /&gt;         public double PricePerGallon&lt;br /&gt;        {&lt;br /&gt;            get { return pricePerGallon; }&lt;br /&gt;            set { pricePerGallon = value; }&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;#endregion&lt;br /&gt;&lt;br /&gt;         private double TotalMiles()&lt;br /&gt;         {&lt;br /&gt;             return EndingMiles - BeginningMiles;&lt;br /&gt;         }&lt;br /&gt;&lt;br /&gt;         public double CalculateMilesPerGallon()&lt;br /&gt;         {&lt;br /&gt;             return TotalMiles() / Gallons;&lt;br /&gt;         }&lt;br /&gt;&lt;br /&gt;         public double TotalCost()&lt;br /&gt;         {&lt;br /&gt;             return Gallons * PricePerGallon;&lt;br /&gt;         }&lt;br /&gt;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-3456009536507019873?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/3456009536507019873/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2011/11/mileage-classes-morning.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/3456009536507019873'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/3456009536507019873'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2011/11/mileage-classes-morning.html' title='Mileage Classes Morning'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-6699873582567646890</id><published>2011-11-07T19:02:00.000-08:00</published><updated>2011-11-07T19:02:56.285-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC110'/><title type='text'>More Classes</title><content type='html'>&lt;p&gt;Here are the classes we did for the evening session. &lt;/p&gt;&lt;div class="separator" style="clear: both;"&gt;&lt;a href="http://1.bp.blogspot.com/-nB_71LVb2kk/Tribs7mby4I/AAAAAAAAAUE/WFKfnh-6z9k/s1600/mileageClasses.JPG" imageanchor="1" style=""&gt;&lt;img border="0" height="208" width="320" src="http://1.bp.blogspot.com/-nB_71LVb2kk/Tribs7mby4I/AAAAAAAAAUE/WFKfnh-6z9k/s320/mileageClasses.JPG" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;h2&gt;Program.cs&lt;/h2&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Text;&lt;br /&gt;&lt;br /&gt;namespace MultiClassExample&lt;br /&gt;{&lt;br /&gt;    class Program&lt;br /&gt;    {&lt;br /&gt;        static void Main(string[] args)&lt;br /&gt;        {&lt;br /&gt;            Display dis = new Display();&lt;br /&gt;            //Mileage m = new Mileage();&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;            //m.BeginningMiles = 1000;&lt;br /&gt;            //m.EndingMiles = 1450;&lt;br /&gt;            //m.Gallons = 25;&lt;br /&gt;            //m.PricePerGallon = 3.71;&lt;br /&gt;&lt;br /&gt;            //Console.WriteLine("Your miles per gallon are {0:F2}", m.MilesPerGallon());&lt;br /&gt;            //Console.WriteLine("The cost per Mile is {0:C}", m.CostPerMile());&lt;br /&gt;&lt;br /&gt;            //Mileage m3 = new Mileage(2000, 2400);&lt;br /&gt;            //m3.Gallons = 20;&lt;br /&gt;            //Console.WriteLine("The MPG is {0}", m3.MilesPerGallon());&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;            //Mileage m2 = new Mileage(12000, 12500, 25);&lt;br /&gt;            //Console.WriteLine("The MPG is {0}", m2.MilesPerGallon());&lt;br /&gt;&lt;br /&gt;            //Console.ReadKey();&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    //I could write a new class right here&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;hr/&gt;&lt;h2&gt;Display.cs&lt;/h2&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Text;&lt;br /&gt;&lt;br /&gt;namespace MultiClassExample&lt;br /&gt;{&lt;br /&gt;    class Display&lt;br /&gt;    {&lt;br /&gt;        Mileage m; &lt;br /&gt;&lt;br /&gt;        public Display()&lt;br /&gt;        {&lt;br /&gt;            m = new Mileage();&lt;br /&gt;            GetInputs();&lt;br /&gt;            ShowOutputs();&lt;br /&gt;            PauseIt();&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        private void GetInputs()&lt;br /&gt;        {&lt;br /&gt;            Console.WriteLine("This program calculates MPG");&lt;br /&gt;&lt;br /&gt;            Console.WriteLine("Enter the Beginning Miles");&lt;br /&gt;            m.BeginningMiles = double.Parse(Console.ReadLine());&lt;br /&gt;&lt;br /&gt;            Console.WriteLine("Enter the Ending Miles");&lt;br /&gt;            m.EndingMiles = double.Parse(Console.ReadLine());&lt;br /&gt;&lt;br /&gt;            Console.WriteLine("Enter the Gallons");&lt;br /&gt;            m.Gallons = double.Parse(Console.ReadLine());&lt;br /&gt;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        private void ShowOutputs()&lt;br /&gt;        {&lt;br /&gt;            Console.WriteLine("the Miles perGallon is {0}", m.MilesPerGallon());&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        private void PauseIt()&lt;br /&gt;        {&lt;br /&gt;            Console.WriteLine("Press any key to exit");&lt;br /&gt;            Console.ReadKey();&lt;br /&gt;        }//end PauseIt&lt;br /&gt;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;hr/&gt;&lt;h2&gt;Mileage.cs&lt;/h2&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Text;&lt;br /&gt;&lt;br /&gt;namespace MultiClassExample&lt;br /&gt;{&lt;br /&gt;    public class Mileage&lt;br /&gt;    {&lt;br /&gt;        //fields&lt;br /&gt;        double beginningMiles;&lt;br /&gt;        double endingMiles;&lt;br /&gt;        double pricePerGallon;&lt;br /&gt;        double gallons;&lt;br /&gt;&lt;br /&gt;        public Mileage()&lt;br /&gt;        {&lt;br /&gt;            beginningMiles=0;&lt;br /&gt;             endingMiles=0;&lt;br /&gt;            pricePerGallon=0;&lt;br /&gt;            gallons=0;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public Mileage(double begMiles, double endMiles)&lt;br /&gt;        {&lt;br /&gt;            beginningMiles = begMiles;&lt;br /&gt;            endingMiles = endMiles;&lt;br /&gt;            pricePerGallon = 0;&lt;br /&gt;            gallons = 0;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public Mileage(double begMiles, double endMiles, double gals)&lt;br /&gt;        {&lt;br /&gt;            beginningMiles = begMiles;&lt;br /&gt;            endingMiles = endMiles;&lt;br /&gt;            pricePerGallon = 0;&lt;br /&gt;            gallons = gals;&lt;br /&gt;        }&lt;br /&gt;     &lt;br /&gt;        #region Properties&lt;br /&gt;&lt;br /&gt;        public double BeginningMiles&lt;br /&gt;        {&lt;br /&gt;            get { return beginningMiles; }&lt;br /&gt;            set { beginningMiles = value; }&lt;br /&gt;        }&lt;br /&gt;        &lt;br /&gt;&lt;br /&gt;        public double EndingMiles&lt;br /&gt;        {&lt;br /&gt;            get { return endingMiles; }&lt;br /&gt;            set { endingMiles = value; }&lt;br /&gt;        }&lt;br /&gt;        &lt;br /&gt;&lt;br /&gt;        public double PricePerGallon&lt;br /&gt;        {&lt;br /&gt;            get { return pricePerGallon; }&lt;br /&gt;            set { pricePerGallon = value; }&lt;br /&gt;        }&lt;br /&gt;      &lt;br /&gt;&lt;br /&gt;        public double Gallons&lt;br /&gt;        {&lt;br /&gt;            get { return gallons; }&lt;br /&gt;            set { gallons = value; }&lt;br /&gt;        }&lt;br /&gt;        #endregion&lt;br /&gt;&lt;br /&gt;        //methods&lt;br /&gt;        private double GetTotalMileage()&lt;br /&gt;        {&lt;br /&gt;            return EndingMiles - BeginningMiles;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public double MilesPerGallon()&lt;br /&gt;        {&lt;br /&gt;            return GetTotalMileage() / Gallons;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public double CostPerMile()&lt;br /&gt;        {&lt;br /&gt;            return PricePerGallon / MilesPerGallon();&lt;br /&gt;        }&lt;br /&gt;            &lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-6699873582567646890?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/6699873582567646890/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2011/11/more-classes.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/6699873582567646890'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/6699873582567646890'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2011/11/more-classes.html' title='More Classes'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-nB_71LVb2kk/Tribs7mby4I/AAAAAAAAAUE/WFKfnh-6z9k/s72-c/mileageClasses.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-8006267754247695111</id><published>2011-11-07T11:19:00.000-08:00</published><updated>2011-11-07T11:22:47.603-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC220'/><title type='text'>Normalization Practices</title><content type='html'>&lt;p&gt;Here is the diagram for the DVD.&lt;/p&gt;&lt;p&gt;This diagram reflects the process of going through Normal form 1, where we found and removed the multivalued attributes.Once removed they have many to many relationships with the main Entity, so we needed to create linking tables rejoin them. There are no functional dependencies or transient dependencies, so the diagram is already in normal form 3&lt;/p&gt;&lt;div class="separator" style="clear: both;"&gt;&lt;a href="http://3.bp.blogspot.com/-49CUPwR5_MQ/TrgvwnMO32I/AAAAAAAAAT4/wQ-vKFZSHaU/s1600/DVD.jpg" imageanchor="1" style=""&gt;&lt;img border="0" height="234" width="320" src="http://3.bp.blogspot.com/-49CUPwR5_MQ/TrgvwnMO32I/AAAAAAAAAT4/wQ-vKFZSHaU/s320/DVD.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-8006267754247695111?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/8006267754247695111/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2011/11/normalization-practices.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/8006267754247695111'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/8006267754247695111'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2011/11/normalization-practices.html' title='Normalization Practices'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-49CUPwR5_MQ/TrgvwnMO32I/AAAAAAAAAT4/wQ-vKFZSHaU/s72-c/DVD.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-4755012301629797989</id><published>2011-11-02T19:01:00.000-07:00</published><updated>2011-11-02T19:01:56.594-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC110'/><title type='text'>Class Examples (Evening)</title><content type='html'>&lt;p&gt;Here is our Box class&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Text;&lt;br /&gt;&lt;br /&gt;namespace ClassExamples&lt;br /&gt;{&lt;br /&gt;    public class Box&lt;br /&gt;    {&lt;br /&gt;        //fields&lt;br /&gt;        private double height;&lt;br /&gt;        private double width;&lt;br /&gt;        private double depth;&lt;br /&gt;&lt;br /&gt;        //default constructor&lt;br /&gt;       //a constructor has the same name&lt;br /&gt;       //as the class and no return type&lt;br /&gt;        public Box()&lt;br /&gt;        {&lt;br /&gt;            Height = 0;&lt;br /&gt;            Width = 0;&lt;br /&gt;            Depth = 0;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;       //overloaded constructor&lt;br /&gt;        public Box(double h, double w, double d)&lt;br /&gt;        {&lt;br /&gt;            Height = h;&lt;br /&gt;            Width = w;&lt;br /&gt;            Depth = d;&lt;br /&gt;        }&lt;br /&gt;        &lt;br /&gt;        #region properties&lt;br /&gt;&lt;br /&gt;        public double Width&lt;br /&gt;        {&lt;br /&gt;            get { return width; }&lt;br /&gt;            set { width = value; }&lt;br /&gt;        }&lt;br /&gt;        &lt;br /&gt;       &lt;br /&gt;        public double Depth&lt;br /&gt;        {&lt;br /&gt;            get { return depth; }&lt;br /&gt;            set { depth = value; }&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public double Height&lt;br /&gt;        {&lt;br /&gt;            get &lt;br /&gt;            {&lt;br /&gt;                return height;&lt;br /&gt;            }&lt;br /&gt;            set&lt;br /&gt;            {&lt;br /&gt;                height = value;&lt;br /&gt;            }&lt;br /&gt;        &lt;br /&gt;        }&lt;br /&gt;        #endregion&lt;br /&gt;&lt;br /&gt;        //class method &lt;br /&gt;        public double CalculateVolume()&lt;br /&gt;        {&lt;br /&gt;            return height * width * depth;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;Here is the main class where we called the Box class and assigned properties&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Text;&lt;br /&gt;&lt;br /&gt;namespace ClassExamples&lt;br /&gt;{&lt;br /&gt;    class Program&lt;br /&gt;    {&lt;br /&gt;        static void Main(string[] args)&lt;br /&gt;        {&lt;br /&gt;            //Console.BackgroundColor = ConsoleColor.DarkMagenta;&lt;br /&gt;            //Console.WriteLine("Hello");&lt;br /&gt;&lt;br /&gt;            //initialize the new box class &lt;br /&gt;            //using the default constructor&lt;br /&gt;            Box b = new Box();&lt;br /&gt;            //set the property values&lt;br /&gt;            b.Height = 5.1; //all use the set of the property&lt;br /&gt;            b.Depth = 6;&lt;br /&gt;            b.Width = 4;&lt;br /&gt;&lt;br /&gt;            //call the method&lt;br /&gt;            double volume = b.CalculateVolume();&lt;br /&gt;&lt;br /&gt;            //these are using the get part of the properties&lt;br /&gt;            Console.WriteLine("The volume of a box with a height of {0} and a width of {1} and a depth of {2} has a volume of {3} cubic feet", b.Height, b.Width, b.Depth, volume);&lt;br /&gt;&lt;br /&gt;            //initialize a second Box instance&lt;br /&gt;            //useing the overloaded constructor&lt;br /&gt;            Box b2 = new Box(4, 5, 2);&lt;br /&gt;&lt;br /&gt;            Console.WriteLine("The volume of box 2 is {0} cubic feet", b2.CalculateVolume());&lt;br /&gt;           &lt;br /&gt;            Console.ReadKey();&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-4755012301629797989?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/4755012301629797989/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2011/11/class-examples-evening.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/4755012301629797989'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/4755012301629797989'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2011/11/class-examples-evening.html' title='Class Examples (Evening)'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-9026352093565781660</id><published>2011-11-01T12:20:00.000-07:00</published><updated>2011-11-01T12:20:48.427-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC110'/><title type='text'>Assignment 5 Morning</title><content type='html'>&lt;p&gt;There are a few differences between this and the evening versions&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Text;&lt;br /&gt;&lt;br /&gt;namespace Assignment5&lt;br /&gt;{&lt;br /&gt;    class Program&lt;br /&gt;    {&lt;br /&gt;        const int SIZE= 50;&lt;br /&gt;        int[] gameResults = new int[SIZE];&lt;br /&gt;        int counter = 0;&lt;br /&gt;&lt;br /&gt;        static void Main(string[] args)&lt;br /&gt;        {&lt;br /&gt;            Program p = new Program();&lt;br /&gt;            p.StartGame();&lt;br /&gt;            //Console.ReadKey();&lt;br /&gt;        }//end main&lt;br /&gt;&lt;br /&gt;        private void StartGame()&lt;br /&gt;        {&lt;br /&gt;            string choice = "y";&lt;br /&gt;            do&lt;br /&gt;            {&lt;br /&gt;                int num = GetRandom();&lt;br /&gt;                GetGuess(num);&lt;br /&gt;                counter++;&lt;br /&gt;                Console.WriteLine("do you want to play again (y/n)");&lt;br /&gt;                choice = Console.ReadLine();&lt;br /&gt;                choice = choice.ToLower();&lt;br /&gt;            } while (choice.Equals("y"));&lt;br /&gt;        }//end start game&lt;br /&gt;&lt;br /&gt;        private int GetRandom()&lt;br /&gt;        {&lt;br /&gt;            Random rand = new Random();&lt;br /&gt;            int number = rand.Next(1,1000);&lt;br /&gt;            Console.WriteLine(number);&lt;br /&gt;            return number;&lt;br /&gt;        }//end get random&lt;br /&gt;&lt;br /&gt;        private void GetGuess(int number)&lt;br /&gt;        {&lt;br /&gt;            int score;&lt;br /&gt;            for (score = 10; score &gt; 0; score--)&lt;br /&gt;            {&lt;br /&gt;&lt;br /&gt;                Console.WriteLine("Enter your guess between 1 and 1000");&lt;br /&gt;                int guess = int.Parse(Console.ReadLine());&lt;br /&gt;&lt;br /&gt;                if (guess &gt; number)&lt;br /&gt;                {&lt;br /&gt;                    Console.WriteLine("Too high");&lt;br /&gt;                }//end if&lt;br /&gt;                else if (guess &lt; number)&lt;br /&gt;                {&lt;br /&gt;                    Console.WriteLine("Too low");&lt;br /&gt;                }//end else if&lt;br /&gt;                else&lt;br /&gt;                {&lt;br /&gt;                    Console.WriteLine("Congratulations");&lt;br /&gt;                    break;&lt;br /&gt;                }//end else&lt;br /&gt;            }//end for&lt;br /&gt;            GetScores(score, number);&lt;br /&gt;        }//end GetGuess&lt;br /&gt;&lt;br /&gt;        private void GetScores(int gameScore, int num)&lt;br /&gt;        {&lt;br /&gt;            Console.WriteLine("Your current score is {0}", gameScore);&lt;br /&gt;            if (gameScore == 0)&lt;br /&gt;            {&lt;br /&gt;                Console.WriteLine("the number was {0}", num);&lt;br /&gt;            }//end if &lt;br /&gt;&lt;br /&gt;            gameResults[counter] = gameScore;&lt;br /&gt;            int totalScore = 0;&lt;br /&gt;            //totalScore = gameResults.Sum();&lt;br /&gt;            for (int i = 0; i &amp;lt; SIZE; i++)&lt;br /&gt;            {&lt;br /&gt;                totalScore += gameResults[i];&lt;br /&gt;            }//end for&lt;br /&gt;            double averageScore = (double)totalScore / (counter + 1);&lt;br /&gt;            Console.WriteLine("You have played {0} games", counter + 1);&lt;br /&gt;            Console.WriteLine("the total score is {0}", totalScore);&lt;br /&gt;            Console.WriteLine("the Average score is {0}",averageScore);&lt;br /&gt;        }//end GetScores&lt;br /&gt;&lt;br /&gt;    }//end class program&lt;br /&gt;}//end namespace&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-9026352093565781660?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/9026352093565781660/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2011/11/assignment-5-morning.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/9026352093565781660'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/9026352093565781660'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2011/11/assignment-5-morning.html' title='Assignment 5 Morning'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-4865360730997592814</id><published>2011-10-31T19:16:00.000-07:00</published><updated>2011-10-31T19:16:05.469-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC110'/><title type='text'>Assignment five Evening</title><content type='html'>&lt;p&gt;Here is the code for assignment 5. This is not the only way to do it&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Text;&lt;br /&gt;&lt;br /&gt;namespace GuessingGame&lt;br /&gt;{&lt;br /&gt;    class Program&lt;br /&gt;    {&lt;br /&gt;        int[] scoreArray = new int[50];&lt;br /&gt;        int counter = 0;&lt;br /&gt;&lt;br /&gt;        static void Main(string[] args)&lt;br /&gt;        {&lt;br /&gt;            Program p = new Program();&lt;br /&gt;            string choice = "y";&lt;br /&gt;            do&lt;br /&gt;            {&lt;br /&gt;                p.GetRandom();&lt;br /&gt;                p.counter++;&lt;br /&gt;                Console.WriteLine("Do you want to play again: y/n");&lt;br /&gt;                choice = Console.ReadLine();&lt;br /&gt;            } while (choice.Equals("y"));&lt;br /&gt;           // Console.ReadKey();&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        private void GetRandom()&lt;br /&gt;        {&lt;br /&gt;            Random rand = new Random();&lt;br /&gt;            int number = rand.Next(1, 1000);&lt;br /&gt;            //Console.WriteLine(number);&lt;br /&gt;            GetGuesses(number);&lt;br /&gt;            &lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        private void GetGuesses(int number)&lt;br /&gt;        {&lt;br /&gt;            int i;&lt;br /&gt;            for (i = 10; i &gt; 0; i--)&lt;br /&gt;            {&lt;br /&gt;                Console.WriteLine("Enter a guess between 1 and 1000");&lt;br /&gt;                int guess = int.Parse(Console.ReadLine());&lt;br /&gt;&lt;br /&gt;                if (guess &gt; number)&lt;br /&gt;                {&lt;br /&gt;                    Console.WriteLine("Your guess is too high");&lt;br /&gt;                }&lt;br /&gt;                else if (guess &lt; number)&lt;br /&gt;                {&lt;br /&gt;                    Console.WriteLine("Your guess is too low");&lt;br /&gt;                }&lt;br /&gt;                else&lt;br /&gt;                {&lt;br /&gt;                    Console.WriteLine("Congratulations");&lt;br /&gt;                    break;&lt;br /&gt;                 }&lt;br /&gt;                &lt;br /&gt;            }//end of for loop&lt;br /&gt;&lt;br /&gt;            CalculateScores(i);&lt;br /&gt;        }//end Guess&lt;br /&gt;&lt;br /&gt;        private void CalculateScores(int score)&lt;br /&gt;        {&lt;br /&gt;            Console.WriteLine("Your current score is {0}", score);&lt;br /&gt;            scoreArray[counter] = score;&lt;br /&gt;            int totalScore = 0;&lt;br /&gt;            for (int x = 0; x &amp;lt; 50; x++)&lt;br /&gt;            {&lt;br /&gt;                totalScore += scoreArray[x];&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            double averageScore = (double)totalScore / (double)(counter + 1);&lt;br /&gt;            Console.WriteLine("Your have played {0} games", counter+1);&lt;br /&gt;            Console.WriteLine("Your total score is {0} ", totalScore);&lt;br /&gt;            Console.WriteLine("Your average score is {0} ", averageScore);&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-4865360730997592814?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/4865360730997592814/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2011/10/assignment-five-evening.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/4865360730997592814'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/4865360730997592814'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2011/10/assignment-five-evening.html' title='Assignment five Evening'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-108170299450915242</id><published>2011-10-31T14:43:00.000-07:00</published><updated>2011-10-31T14:43:50.789-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>Java Equivalent to ITC110 Assignment 5</title><content type='html'>&lt;p&gt;Here is the java code &lt;/p&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;import java.util.Scanner;&lt;br /&gt;public class GuessingGame {&lt;br /&gt;&lt;br /&gt; /**&lt;br /&gt;  * This program presents a guessing game&lt;br /&gt;  * where the computer randomly selects&lt;br /&gt;  * a number between 0 and 1000&lt;br /&gt;  * and the player gets 10 chances to guess&lt;br /&gt;  * the player can play as many times&lt;br /&gt;  * as he or she wants and the program&lt;br /&gt;  * will list total wins and average score&lt;br /&gt;  */&lt;br /&gt; int gameCounter=0;&lt;br /&gt; int[] scoreArray=new int[50];&lt;br /&gt; public static void main(String[] args) {&lt;br /&gt;  //instantiate the class&lt;br /&gt;  GuessingGame gg = new GuessingGame();&lt;br /&gt;  //get the scanner&lt;br /&gt;  Scanner reader = new Scanner(System.in);&lt;br /&gt;  //initialize the variable for exiting&lt;br /&gt;  int choice=1;&lt;br /&gt;  //loop so the player can play until they choose&lt;br /&gt;  //to quit&lt;br /&gt;  do&lt;br /&gt;  {&lt;br /&gt;   //call the start of the game&lt;br /&gt;  gg.Start();&lt;br /&gt;  //increment the number of games&lt;br /&gt;  gg.gameCounter++;&lt;br /&gt;  System.out.println("Do you want to play again? 0 to quit");&lt;br /&gt;  choice=reader.nextInt();&lt;br /&gt;  &lt;br /&gt;  }while (choice != 0);&lt;br /&gt;&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; private void Start()&lt;br /&gt; {&lt;br /&gt;  //Call the method to get the random number&lt;br /&gt;  double num=GetRandom();&lt;br /&gt;  //the line below just for testing &lt;br /&gt;  //System.out.println((int)num);&lt;br /&gt;  &lt;br /&gt;  //cast the random number to an integer&lt;br /&gt;  //and pass to the GetGuess method&lt;br /&gt;  GetGuess((int)num);&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; private double GetRandom()&lt;br /&gt; {&lt;br /&gt;  //Get the random number&lt;br /&gt;  double number = Math.random()*1000;&lt;br /&gt;  return number;&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; private void GetGuess(int number)&lt;br /&gt; {&lt;br /&gt;  int score; //declare score counter&lt;br /&gt;  Scanner reader = new Scanner(System.in);&lt;br /&gt;  //loop backwards to keep score&lt;br /&gt;  for(score=10; score &gt; 0; score--)&lt;br /&gt;  {&lt;br /&gt;   System.out.println("Enter a quess between 0 and 1000");&lt;br /&gt;   double guess=reader.nextDouble();&lt;br /&gt;   &lt;br /&gt;   //check the guesses&lt;br /&gt;   if(guess &gt; number)&lt;br /&gt;    System.out.println("Your guess is too high");&lt;br /&gt;   else if(guess &amp;lt; number)&lt;br /&gt;    System.out.println("Your guess is too low");&lt;br /&gt;   else&lt;br /&gt;   {&lt;br /&gt;    System.out.println("congratulations");&lt;br /&gt;    break; //leave the loop if correct&lt;br /&gt;   }&lt;br /&gt;  }&lt;br /&gt;  GetScores(score);//call the get scores method&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; private void GetScores(int score)&lt;br /&gt; {&lt;br /&gt;  //output the current score&lt;br /&gt;  System.out.println("Your current Score is " + score);&lt;br /&gt;  //assign it to the scoreArray&lt;br /&gt;  scoreArray[gameCounter]=score;&lt;br /&gt;  //initialize the variable to get the totals&lt;br /&gt;  int scoreTotal=0;&lt;br /&gt;  //loop through the array to get the total&lt;br /&gt;&lt;br /&gt;  for (int i=0;i&amp;lt;50;i++)&lt;br /&gt;  {&lt;br /&gt;   scoreTotal+=scoreArray[i];&lt;br /&gt;  }&lt;br /&gt;  //get the average casting it to a double to get decimal&lt;br /&gt;  //pars&lt;br /&gt;  double scoreAverage=(double)scoreTotal/(double)(gameCounter + 1);&lt;br /&gt;  //pring out the results&lt;br /&gt;  System.out.println("Your have played " + (gameCounter + 1) + "games");&lt;br /&gt;  System.out.println("Your average score is " + scoreAverage);&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;Here is a transcript of the console when the program is running&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;Enter a quess between 0 and 1000&lt;br /&gt;500&lt;br /&gt;Your guess is too low&lt;br /&gt;Enter a quess between 0 and 1000&lt;br /&gt;750&lt;br /&gt;Your guess is too low&lt;br /&gt;Enter a quess between 0 and 1000&lt;br /&gt;875&lt;br /&gt;Your guess is too high&lt;br /&gt;Enter a quess between 0 and 1000&lt;br /&gt;800&lt;br /&gt;Your guess is too low&lt;br /&gt;Enter a quess between 0 and 1000&lt;br /&gt;850&lt;br /&gt;Your guess is too high&lt;br /&gt;Enter a quess between 0 and 1000&lt;br /&gt;825&lt;br /&gt;Your guess is too high&lt;br /&gt;Enter a quess between 0 and 1000&lt;br /&gt;812&lt;br /&gt;Your guess is too low&lt;br /&gt;Enter a quess between 0 and 1000&lt;br /&gt;819&lt;br /&gt;Your guess is too low&lt;br /&gt;Enter a quess between 0 and 1000&lt;br /&gt;822&lt;br /&gt;Your guess is too low&lt;br /&gt;Enter a quess between 0 and 1000&lt;br /&gt;&lt;br /&gt;823&lt;br /&gt;congratulations&lt;br /&gt;Your current Score is 1&lt;br /&gt;Your have played 1games&lt;br /&gt;Your average score is 1.0&lt;br /&gt;Do you want to play again? 0 to quit&lt;br /&gt;1&lt;br /&gt;Enter a quess between 0 and 1000&lt;br /&gt;500&lt;br /&gt;Your guess is too high&lt;br /&gt;Enter a quess between 0 and 1000&lt;br /&gt;250&lt;br /&gt;Your guess is too low&lt;br /&gt;Enter a quess between 0 and 1000&lt;br /&gt;350&lt;br /&gt;Your guess is too low&lt;br /&gt;Enter a quess between 0 and 1000&lt;br /&gt;425&lt;br /&gt;Your guess is too low&lt;br /&gt;Enter a quess between 0 and 1000&lt;br /&gt;475&lt;br /&gt;Your guess is too high&lt;br /&gt;Enter a quess between 0 and 1000&lt;br /&gt;450&lt;br /&gt;Your guess is too high&lt;br /&gt;Enter a quess between 0 and 1000&lt;br /&gt;433&lt;br /&gt;Your guess is too low&lt;br /&gt;Enter a quess between 0 and 1000&lt;br /&gt;444&lt;br /&gt;Your guess is too high&lt;br /&gt;Enter a quess between 0 and 1000&lt;br /&gt;439&lt;br /&gt;Your guess is too low&lt;br /&gt;Enter a quess between 0 and 1000&lt;br /&gt;441&lt;br /&gt;Your guess is too high&lt;br /&gt;Your current Score is 0&lt;br /&gt;Your have played 2games&lt;br /&gt;Your average score is 0.5&lt;br /&gt;Do you want to play again? 0 to quit&lt;br /&gt;&lt;br /&gt;0&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-108170299450915242?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/108170299450915242/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2011/10/java-equivalent-to-itc110-assignment-5.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/108170299450915242'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/108170299450915242'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2011/10/java-equivalent-to-itc110-assignment-5.html' title='Java Equivalent to ITC110 Assignment 5'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-1481581996773789779</id><published>2011-10-27T14:14:00.000-07:00</published><updated>2011-10-27T14:15:34.704-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC110'/><title type='text'>MultiDimensional Arrays</title><content type='html'>&lt;p&gt;The simplest multidimensional array is a two dimensional array. You can think of a two dimensional array as a simple sort of table with columns and rows. The first dimension is the number of rows and the second dimension is the number of columns.&lt;p&gt;&lt;p&gt;Here is an example of a two dimensional string array that keeps track of book titles and authors. It has 3 rows and 2 columns&lt;p&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt; string[,] books = new string[3, 2];&lt;br /&gt;           &lt;br /&gt;            books[0, 0] = "War and Peace";&lt;br /&gt;            books[0, 1] = "Tolstoy";&lt;br /&gt;            books[1, 0] = "Lord of the Rings";&lt;br /&gt;            books[1, 1] = "Tolkein";&lt;br /&gt;            books[2, 0] = "Huckleberry Finn";&lt;br /&gt;            books[2, 1] = "Twain";&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;Here is an example of a two dimensional array with 3 rows and 3 columns. Think of it as containing the  height, width and length of a set of boxes&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;int[,] boxes = new int[3, 3];&lt;br /&gt;            boxes[0, 0] = 4;&lt;br /&gt;            boxes[0, 1] = 2;&lt;br /&gt;            boxes[0, 2] = 3;&lt;br /&gt;            boxes[1, 0] = 2;&lt;br /&gt;            boxes[1, 1] = 2;&lt;br /&gt;            boxes[1, 2] = 1;&lt;br /&gt;            boxes[2, 0] = 3;&lt;br /&gt;            boxes[2, 1] = 2;&lt;br /&gt;            boxes[2, 2] = 5;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;It is also possible to have arrays with more than two dimensions. Below is a three dimensional array.&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;int[, ,] space = new int[2, 2, 2];&lt;br /&gt;&lt;br /&gt;            space[0, 0, 0] = 5;&lt;br /&gt;            space[0, 0, 1] = 4;&lt;br /&gt;            space[0, 1, 0] = 3;&lt;br /&gt;            space[0, 1, 1] = 4;&lt;br /&gt;            space[1, 0, 0] = 3;&lt;br /&gt;            space[1, 0, 1] = 6;&lt;br /&gt;            space[1, 1, 0] = 2;&lt;br /&gt;            space[1, 1, 1] = 5;&lt;br /&gt;            space[2, 0, 0] = 3;&lt;br /&gt;            space[2, 0, 1] = 6;&lt;br /&gt;            space[2, 1, 0] = 2;&lt;br /&gt;            space[2, 1, 1] = 5;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;Arrays can have more than 3 dimensions, but they rapidly get difficult to manage.&lt;/p&gt;&lt;p&gt;To display a multidimensional array, you access its indexes just as in an one dimensional array. Below is the full program that creates these arrays and displays all but the last one. If you would like a little chalange, you can add code to the display method to display the contents of the 3 dimensional array.&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Text;&lt;br /&gt;&lt;br /&gt;namespace MultidimensionalArrays&lt;br /&gt;{&lt;br /&gt;    class Program&lt;br /&gt;    {&lt;br /&gt;        static void Main(string[] args)&lt;br /&gt;        {&lt;br /&gt;            Program p = new Program();&lt;br /&gt;            p.Display();&lt;br /&gt;            Console.ReadKey();&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        private string[,] TwoDimensionalArray()&lt;br /&gt;        {&lt;br /&gt;            //define two dimensional Array&lt;br /&gt;            //first number is number of rows&lt;br /&gt;            //the second is number of columns&lt;br /&gt;            string[,] books = new string[3, 2];&lt;br /&gt;           &lt;br /&gt;            books[0, 0] = "War and Peace";&lt;br /&gt;            books[0, 1] = "Tolstoy";&lt;br /&gt;            books[1, 0] = "Lord of the Rings";&lt;br /&gt;            books[1, 1] = "Tolkein";&lt;br /&gt;            books[2, 0] = "Huckleberry Finb";&lt;br /&gt;            books[2, 1] = "Twain";&lt;br /&gt;&lt;br /&gt;            return books;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        private int[,] Another2DimensionalArray()&lt;br /&gt;        {&lt;br /&gt;            //think of an array that holds&lt;br /&gt;            //the height, width, and length&lt;br /&gt;            //of boxes&lt;br /&gt;            //although it has 3 columns&lt;br /&gt;            //it is still a two dimensional &lt;br /&gt;            //array&lt;br /&gt;            int[,] boxes = new int[3, 3];&lt;br /&gt;            boxes[0, 0] = 4;&lt;br /&gt;            boxes[0, 1] = 2;&lt;br /&gt;            boxes[0, 2] = 3;&lt;br /&gt;            boxes[1, 0] = 2;&lt;br /&gt;            boxes[1, 1] = 2;&lt;br /&gt;            boxes[1, 2] = 1;&lt;br /&gt;            boxes[2, 0] = 3;&lt;br /&gt;            boxes[2, 1] = 2;&lt;br /&gt;            boxes[2, 2] = 5;&lt;br /&gt;&lt;br /&gt;            return boxes;&lt;br /&gt;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        private int[, ,] ThreeDimensionalArray()&lt;br /&gt;        {&lt;br /&gt;            //think of 3 dimensionals as a cube&lt;br /&gt;            //you can do more dimensions but it&lt;br /&gt;            //gets beyond absurd&lt;br /&gt;            int[, ,] space = new int[2, 2, 2];&lt;br /&gt;&lt;br /&gt;            space[0, 0, 0] = 5;&lt;br /&gt;            space[0, 0, 1] = 4;&lt;br /&gt;            space[0, 1, 0] = 3;&lt;br /&gt;            space[0, 1, 1] = 4;&lt;br /&gt;            space[1, 0, 0] = 3;&lt;br /&gt;            space[1, 0, 1] = 6;&lt;br /&gt;            space[1, 1, 0] = 2;&lt;br /&gt;            space[1, 1, 1] = 5;&lt;br /&gt;            space[2, 0, 0] = 3;&lt;br /&gt;            space[2, 0, 1] = 6;&lt;br /&gt;            space[2, 1, 0] = 2;&lt;br /&gt;            space[2, 1, 1] = 5;&lt;br /&gt;&lt;br /&gt;            return space;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        private void Display()&lt;br /&gt;        {&lt;br /&gt;            //you access the values in multidimensional arrays&lt;br /&gt;            //just like regular ones, through their indexes&lt;br /&gt;&lt;br /&gt;            string[,] mybooks = TwoDimensionalArray();&lt;br /&gt;            Console.WriteLine("The second book is {0}, by {1}", &lt;br /&gt;                mybooks[1, 0], mybooks[1, 1]);&lt;br /&gt;            Console.WriteLine("*********************************");&lt;br /&gt;            // the loop below multiplies the contents&lt;br /&gt;            //of the three columns together&lt;br /&gt;            int[,] cubes = Another2DimensionalArray();&lt;br /&gt;            int cubicInches = 0;&lt;br /&gt;            for (int i = 0; i &amp;lt; 3; i++)&lt;br /&gt;            {&lt;br /&gt;                cubicInches = cubes[i, 0] * cubes[i, 1] * cubes[i, 2];&lt;br /&gt;                Console.WriteLine("Box {0}, is {1} cubic inches", i+1, cubicInches);&lt;br /&gt;            }&lt;br /&gt;            Console.WriteLine("*********************************");&lt;br /&gt;           &lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-1481581996773789779?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/1481581996773789779/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2011/10/multidimensional-arrays.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/1481581996773789779'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/1481581996773789779'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2011/10/multidimensional-arrays.html' title='MultiDimensional Arrays'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-8604108629089110715</id><published>2011-10-26T09:01:00.000-07:00</published><updated>2011-10-26T09:01:20.345-07:00</updated><title type='text'>Midterm code</title><content type='html'>&lt;pre&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Text;&lt;br /&gt;&lt;br /&gt;namespace ExamExample&lt;br /&gt;{&lt;br /&gt;    class Program&lt;br /&gt;    {&lt;br /&gt;        const int SIZE = 50;&lt;br /&gt;        static void Main(string[] args)&lt;br /&gt;        {&lt;br /&gt;            Program p = new Program();&lt;br /&gt;            p.CreateArrays();&lt;br /&gt;            p.PauseIt();&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;       &lt;br /&gt;&lt;br /&gt;        private void CreateArrays()&lt;br /&gt;        { &lt;br /&gt;            int[] numbers= new int[SIZE];&lt;br /&gt;            FillArray(numbers);&lt;br /&gt;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        private void FillArray(int[] numbers)&lt;br /&gt;        {&lt;br /&gt;            Random rand = new Random();&lt;br /&gt;            for (int i = 0; i &amp;lt; SIZE; i++)&lt;br /&gt;            {&lt;br /&gt;                numbers[i] = rand.Next(1, 100);&lt;br /&gt;            }&lt;br /&gt;            GetEvenNumbers(numbers);&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        private void GetEvenNumbers(int[] numbers)&lt;br /&gt;        {&lt;br /&gt;            int evenCount = 0;&lt;br /&gt;            int oddCount = 0;&lt;br /&gt;&lt;br /&gt;            for (int i = 0; i &amp;lt; SIZE; i++)&lt;br /&gt;            {&lt;br /&gt;                if (numbers[i] % 2 == 0)&lt;br /&gt;                {&lt;br /&gt;                    evenCount++;&lt;br /&gt;                }&lt;br /&gt;                else&lt;br /&gt;                {&lt;br /&gt;                    oddCount++;&lt;br /&gt;                }&lt;br /&gt;&lt;br /&gt;            }&lt;br /&gt;            Console.WriteLine("There were {0} even numbers and {1} odd numbers", evenCount, oddCount);&lt;br /&gt;           &lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        private void PauseIt()&lt;br /&gt;        {&lt;br /&gt;            Console.WriteLine("\n\nPress any key to exit");&lt;br /&gt;            Console.ReadKey();&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;       &lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-8604108629089110715?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/8604108629089110715/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2011/10/midterm-code.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/8604108629089110715'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/8604108629089110715'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2011/10/midterm-code.html' title='Midterm code'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-2058697645650383285</id><published>2011-10-25T12:07:00.000-07:00</published><updated>2011-10-25T12:07:45.667-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC110'/><title type='text'>Random</title><content type='html'>&lt;p&gt;Here is the random Function&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Text;&lt;br /&gt;&lt;br /&gt;namespace RandomExample&lt;br /&gt;{&lt;br /&gt;    class Program&lt;br /&gt;    {&lt;br /&gt;        static void Main(string[] args)&lt;br /&gt;        {&lt;br /&gt;            Random rand = new Random();&lt;br /&gt;            int number=rand.Next(1, 1000);&lt;br /&gt;&lt;br /&gt;            Console.WriteLine(number);&lt;br /&gt;&lt;br /&gt;            Console.ReadKey();&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-2058697645650383285?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/2058697645650383285/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2011/10/random.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/2058697645650383285'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/2058697645650383285'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2011/10/random.html' title='Random'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-4237564729350221654</id><published>2011-10-25T12:04:00.001-07:00</published><updated>2011-10-25T12:04:59.411-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC110'/><title type='text'>Assignment4 Morning Class</title><content type='html'>&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Text;&lt;br /&gt;&lt;br /&gt;namespace Assignment4Morning&lt;br /&gt;{&lt;br /&gt;    class Program&lt;br /&gt;    {&lt;br /&gt;        /// &lt;summary&gt;&lt;br /&gt;        /// This program calculates GPAs&lt;br /&gt;        /// Based on grades and credits&lt;br /&gt;        /// entered&lt;br /&gt;        /// Steve Conger 10/25/2011&lt;br /&gt;        /// &lt;/summary&gt;&lt;br /&gt;      &lt;br /&gt;        static void Main(string[] args)&lt;br /&gt;        {&lt;br /&gt;            Program p = new Program();&lt;br /&gt;&lt;br /&gt;            string quit = "y";&lt;br /&gt;            while (quit != "n")&lt;br /&gt;            {&lt;br /&gt;                p.CreateGPAArrays();&lt;br /&gt;                Console.WriteLine("Continue y/n?");&lt;br /&gt;                quit = Console.ReadLine();&lt;br /&gt;               quit= quit.ToLower();&lt;br /&gt;            }&lt;br /&gt;            //Console.ReadKey();&lt;br /&gt;        }//end main&lt;br /&gt;&lt;br /&gt;        private void CreateGPAArrays()&lt;br /&gt;        {&lt;br /&gt;            Console.WriteLine("Enter how many grades you want to enter");&lt;br /&gt;            int number = int.Parse(Console.ReadLine());&lt;br /&gt;&lt;br /&gt;            double[] grades = new double[number];&lt;br /&gt;            int[] credits = new int[number];&lt;br /&gt;&lt;br /&gt;            FillGPAArrays(grades, credits);&lt;br /&gt;        }//end Create&lt;br /&gt;&lt;br /&gt;        private void FillGPAArrays(double[] grades, int[] credits)&lt;br /&gt;        {&lt;br /&gt;            for (int index = 0; index &lt; grades.Length; index++)&lt;br /&gt;            {&lt;br /&gt;                double grade=0;&lt;br /&gt;                &lt;br /&gt;                do&lt;br /&gt;                {&lt;br /&gt;                    Console.WriteLine("enter grade");&lt;br /&gt;                    grade = double.Parse(Console.ReadLine());&lt;br /&gt;                    if (grade &lt; 0 || grade &gt; 4)&lt;br /&gt;                    {&lt;br /&gt;                        Console.WriteLine("Grades must be between 0 and 4");&lt;br /&gt;                        &lt;br /&gt;                    }&lt;br /&gt;                } while (grade &lt; 0 || grade &gt; 4);&lt;br /&gt;                grades[index] = grade;&lt;br /&gt;&lt;br /&gt;                Console.WriteLine("enter Credits");&lt;br /&gt;                credits[index] = int.Parse(Console.ReadLine());&lt;br /&gt;&lt;br /&gt;            &lt;br /&gt;            }//end for&lt;br /&gt;            CalculateGPA(grades, credits);&lt;br /&gt;        }//end Fill&lt;br /&gt;&lt;br /&gt;        private void CalculateGPA(double[] grades, int[] credits)&lt;br /&gt;        {&lt;br /&gt;            double weight=0;&lt;br /&gt;            int totalCredits = 0;&lt;br /&gt;&lt;br /&gt;            for (int index = 0; index &lt; grades.Length; index++)&lt;br /&gt;            {&lt;br /&gt;                weight += grades[index] * credits[index];&lt;br /&gt;                totalCredits += credits[index];&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            //alternate way to sum credits&lt;br /&gt;            //c# 4.0 and above only&lt;br /&gt;            int total = credits.Sum();&lt;br /&gt;&lt;br /&gt;            double gpa = weight / totalCredits;&lt;br /&gt;&lt;br /&gt;            Console.WriteLine("Your GPA is {0}", Math.Round(gpa,1));&lt;br /&gt;            &lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    }//end class&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-4237564729350221654?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/4237564729350221654/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2011/10/assignment4-morning-class.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/4237564729350221654'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/4237564729350221654'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2011/10/assignment4-morning-class.html' title='Assignment4 Morning Class'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-2525964243116167378</id><published>2011-10-24T19:11:00.000-07:00</published><updated>2011-10-24T19:11:58.171-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC110'/><title type='text'>Assignment 4</title><content type='html'>&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Text;&lt;br /&gt;&lt;br /&gt;namespace Assignment4&lt;br /&gt;{&lt;br /&gt;    class Program&lt;br /&gt;    {&lt;br /&gt;        static void Main(string[] args)&lt;br /&gt;        {&lt;br /&gt;            Program p = new Program();&lt;br /&gt;            string quit = "y";&lt;br /&gt;            while (quit != "n")&lt;br /&gt;            {&lt;br /&gt;                p.CreateArrays();&lt;br /&gt;                Console.WriteLine("Do you want start over? n to quit");&lt;br /&gt;               quit=Console.ReadLine();&lt;br /&gt;                quit.ToLower();&lt;br /&gt;            }&lt;br /&gt;            Console.ReadKey();&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        private void CreateArrays()&lt;br /&gt;        {&lt;br /&gt;            Console.WriteLine("How many Grades do you want to enter");&lt;br /&gt;            int number = int.Parse(Console.ReadLine());&lt;br /&gt;&lt;br /&gt;            double[] grades = new double[number];&lt;br /&gt;            double[] credits = new double[number];&lt;br /&gt;&lt;br /&gt;            FillArrays(grades, credits);&lt;br /&gt;            &lt;br /&gt;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        private void FillArrays(double[] grades, double[] credits)&lt;br /&gt;        {&lt;br /&gt;            for (int counter = 0; counter &amp;lt; grades.Length; counter++)&lt;br /&gt;            {&lt;br /&gt;                double grade = 0;&lt;br /&gt;                do&lt;br /&gt;                {&lt;br /&gt;                    Console.WriteLine("Enter a Grade");&lt;br /&gt;                    grade = double.Parse(Console.ReadLine());&lt;br /&gt;                    if (grade &amp;lt;= 0 || grade &gt; 4)&lt;br /&gt;                    {&lt;br /&gt;                        Console.WriteLine("Grades must be between 0 and 4");&lt;br /&gt;                    }&lt;br /&gt;&lt;br /&gt;                } while (grade &amp;lt;= 0 || grade &gt; 4);&lt;br /&gt;                grades[counter]=grade;&lt;br /&gt;&lt;br /&gt;                Console.WriteLine("Enter the Credits");&lt;br /&gt;                credits[counter] = double.Parse(Console.ReadLine());&lt;br /&gt;            }//end for&lt;br /&gt;            CalculateGPA(grades, credits);&lt;br /&gt;        }//end fill arrays&lt;br /&gt;&lt;br /&gt;        private void CalculateGPA(double[] grades, double[] credits)&lt;br /&gt;        {&lt;br /&gt;            double totalCredits = 0;&lt;br /&gt;            double weight = 0;&lt;br /&gt;&lt;br /&gt;            for (int counter = 0; counter &amp;lt; grades.Length; counter++)&lt;br /&gt;            {&lt;br /&gt;                weight+=grades[counter] * credits[counter];&lt;br /&gt;                totalCredits += credits[counter];&lt;br /&gt;            }//end for&lt;br /&gt;&lt;br /&gt;            &lt;br /&gt;            &lt;br /&gt;            double gpa = weight / totalCredits;&lt;br /&gt;&lt;br /&gt;            Console.WriteLine("Your GPA is {0:F1}", gpa);&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;    }//end class&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;and here is the code for doing random numbers&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt; static void Main(string[] args)&lt;br /&gt;  {&lt;br /&gt;            &lt;br /&gt;            Random rand = new Random();&lt;br /&gt;            int number = rand.Next(1, 10);&lt;br /&gt;            Console.WriteLine(number);&lt;br /&gt;            Console.ReadKey();&lt;br /&gt;&lt;br /&gt;   }&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-2525964243116167378?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/2525964243116167378/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2011/10/assignment-4.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/2525964243116167378'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/2525964243116167378'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2011/10/assignment-4.html' title='Assignment 4'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-8680211041239826591</id><published>2011-10-20T13:52:00.000-07:00</published><updated>2011-10-20T13:52:08.735-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>Java Equivalent of ITC110 Assignment 4</title><content type='html'>&lt;p&gt;This is an assignment that deals with loops and arrays. It uses two array one for Grades and one for Credits. The purpose of the program is to calculate a GPA. The arrays are created in one method and then passed to another where they are filled in a for loop. Then they are passed to a third method where the arrays are multiplied together and summed to get the GPA.&lt;/p&gt;&lt;p&gt;Two other loops are added. One, a while loop in main, lets the user repeat the program as often as they wish. They enter 0 to exit. The other, a do loop, is used in the FillArrays method to make sure the grade is between 0 and 4. It will not allow the user to continue until they have entered a grade in the valid range. The grade is not written to the array until it is valid.&lt;/p&gt;&lt;p&gt;Here is the Java code&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;import java.util.Scanner;&lt;br /&gt;&lt;br /&gt;public class GPACalculator {&lt;br /&gt;&lt;br /&gt; /**&lt;br /&gt;  * This program calculates a GPA &lt;br /&gt;  * to do so it uses parallel arrays&lt;br /&gt;  * one for grades and one for credits&lt;br /&gt;  * it checks to make sure grades are&lt;br /&gt;  * between 0 and 4&lt;br /&gt;  * this program is the java equivalent&lt;br /&gt;  * of ITC110 assignment 4&lt;br /&gt;  * Steve Conger !0/20/2011&lt;br /&gt;  */&lt;br /&gt; //declare the scanner globally&lt;br /&gt; Scanner reader = new Scanner(System.in);&lt;br /&gt; &lt;br /&gt; public static void main(String[] args) {&lt;br /&gt;  GPACalculator calc=new GPACalculator();&lt;br /&gt;  int choice=1;&lt;br /&gt;  while(choice !=0)&lt;br /&gt;  {&lt;br /&gt;   calc.CreateArrays();&lt;br /&gt;   System.out.println("Do you want to enter more grades: 0 to exit");&lt;br /&gt;   choice=calc.reader.nextInt();&lt;br /&gt;  }&lt;br /&gt;  &lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; private void CreateArrays()&lt;br /&gt; {&lt;br /&gt;  &lt;br /&gt;  System.out.println("How many grades do you want to enter?");&lt;br /&gt;  int number=reader.nextInt();&lt;br /&gt;  &lt;br /&gt;  //declare the arrays&lt;br /&gt;  double[] grades = new double[number];&lt;br /&gt;  double[] credits=new double[number];&lt;br /&gt;  &lt;br /&gt;  //call the FillArrays method&lt;br /&gt;  FillArrays(grades, credits);&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; private void FillArrays(double[] grades, double[]credits)&lt;br /&gt; {&lt;br /&gt;  //loop through and fill the arrays)&lt;br /&gt;  for(int i=0;i&amp;lt;grades.length; i ++)&lt;br /&gt;  {&lt;br /&gt;   //the do loop makes sure the grade is in &lt;br /&gt;   //the proper range&lt;br /&gt;   double grade=0;&lt;br /&gt;   do&lt;br /&gt;   {&lt;br /&gt;   System.out.println("Enter the grade");&lt;br /&gt;   grade=reader.nextDouble();&lt;br /&gt;   if(grade&amp;lt;0 || grade&gt;4)&lt;br /&gt;   {&lt;br /&gt;    System.out.println("Grades must be between 0 and 4");&lt;br /&gt;   }&lt;br /&gt;   }while (grade&amp;lt;0 || grade&gt;4);&lt;br /&gt;   grades[i]=grade;&lt;br /&gt;   System.out.println("Enter the credits");&lt;br /&gt;   credits[i]=reader.nextDouble();&lt;br /&gt;  }&lt;br /&gt;  //call the CalculateGPA method&lt;br /&gt;  CalculateGPA(grades, credits);&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; private void CalculateGPA(double[] grades, double[]credits)&lt;br /&gt; {&lt;br /&gt;  double weight=0;&lt;br /&gt;  double totalCredits=0;&lt;br /&gt;  &lt;br /&gt;  for(int i=0;i&amp;lt;grades.length; i ++)&lt;br /&gt;  {&lt;br /&gt;   weight += grades[i] * credits[i];&lt;br /&gt;   totalCredits += credits[i];&lt;br /&gt;  }&lt;br /&gt;  &lt;br /&gt;  double gpa = weight / totalCredits;&lt;br /&gt;  System.out.println("Your GPA is " + gpa);&lt;br /&gt;  &lt;br /&gt; }&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-8680211041239826591?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/8680211041239826591/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2011/10/java-equivalent-of-itc110-assignment-4.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/8680211041239826591'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/8680211041239826591'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2011/10/java-equivalent-of-itc110-assignment-4.html' title='Java Equivalent of ITC110 Assignment 4'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-4035427316303203766</id><published>2011-10-19T14:57:00.000-07:00</published><updated>2011-10-19T14:59:35.744-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC172'/><title type='text'>Consuming a Simple Web Services</title><content type='html'>&lt;p&gt;This blog leads you through the process of consuming a simple web service. In it we will find a web service that provides global weather reports based on city and country and we will reference that web service in our own ASP.Net form and create our own little app that uses it.&lt;/p&gt;&lt;p&gt;Go to this url to get Free web services: &lt;a href="http://www.webservicex.net/WS/wscatlist.aspx"&gt;http://www.webservicex.net/WS/wscatlist.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Click on global weather &lt;/p&gt;&lt;p&gt;Click on get weather&lt;/p&gt;&lt;p&gt;Copy WSDL Schema Location  http://www.webservicex.net/globalweather.asmx?WSDL&lt;/p&gt;&lt;p&gt;Open Visual Studio&lt;/p&gt;&lt;p&gt;Create a new website&lt;/p&gt;&lt;p&gt;Go to the Website menu,And select add web reference&lt;/p&gt;&lt;p&gt;Paste the schema location in the URL text box&lt;/p&gt;&lt;p&gt;Change the name of the web service name to net.globalweather.www&lt;/p&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;a href="http://4.bp.blogspot.com/-LB3tILDVqxQ/Tp9GrJYCXXI/AAAAAAAAASk/4IhQ5b9Pv4Y/s1600/AddWebReference.JPG" imageanchor="1" style=""&gt;&lt;img border="0" height="227" width="320" src="http://4.bp.blogspot.com/-LB3tILDVqxQ/Tp9GrJYCXXI/AAAAAAAAASk/4IhQ5b9Pv4Y/s320/AddWebReference.JPG" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;Add the web serviceadd a labels and textboxes for city name and country and a button and a label to the web form&lt;/p&gt;&lt;hr/&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;&lt;br /&gt;&amp;lt;head runat="server"&gt;&lt;br /&gt;    &amp;lt;title&gt;&amp;lt;/title&gt;&lt;br /&gt;&amp;lt;/head&gt;&lt;br /&gt;&amp;lt;body&gt;&lt;br /&gt;    &amp;lt;form id="form1" runat="server"&gt;&lt;br /&gt;    &amp;lt;div&gt;&lt;br /&gt;    &amp;lt;h1&gt;Global Weather&amp;lt;/h1&gt;&lt;br /&gt;      &amp;lt;p&gt; &lt;br /&gt;         &amp;lt;asp:Label ID="Label2" runat="server" Text="Enter City"&gt; &lt;br /&gt;        &amp;lt;/asp:Label&gt;&amp;lt;asp:TextBox ID="txtCity" runat="server"&gt;&amp;lt;/asp:TextBox&gt; &lt;br /&gt;      &amp;lt;/p&gt;&lt;br /&gt;      &amp;lt;p&gt;&lt;br /&gt;        &amp;lt;asp:Label ID="Label3" runat="server" Text="Enter Country"&gt;&lt;br /&gt;        &amp;lt;/asp:Label&gt;&amp;lt;asp:TextBox ID="txtCountry" runat="server"&gt;&amp;lt;/asp:TextBox&gt;&lt;br /&gt;      &amp;lt;/p&gt;&lt;br /&gt;      &amp;lt;p&gt;&lt;br /&gt;        &amp;lt;asp:Button ID="Button1" runat="server" Text="Get Weather" /&gt;&lt;br /&gt;       &amp;lt;/p&gt;&lt;br /&gt;       &amp;lt;p&gt;&lt;br /&gt;        &amp;lt;asp:Label ID="lblWeather" runat="server" Text="Label"&gt;&amp;lt;/asp:Label&gt;&lt;br /&gt;        &amp;lt;/p&gt;&lt;br /&gt;    &amp;lt;/div&gt;&lt;br /&gt;    &amp;lt;/form&gt;&lt;br /&gt;&amp;lt;/body&gt;&lt;br /&gt;&amp;lt;/html&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="separator" style="clear: both; text-align: Left;"&gt;&lt;a href="http://2.bp.blogspot.com/-UbJTKr1drIA/Tp9G7nsiDTI/AAAAAAAAASw/n4oKTzTH0GA/s1600/WeatherForm.JPG" imageanchor="1" style=""&gt;&lt;img border="0" height="235" width="320" src="http://2.bp.blogspot.com/-UbJTKr1drIA/Tp9G7nsiDTI/AAAAAAAAASw/n4oKTzTH0GA/s320/WeatherForm.JPG" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;hr/&gt;&lt;p&gt;Double click the buttom in design mode to get to the C# code window&lt;/p&gt;&lt;p&gt;In the buttonI_click method enter the following code&lt;/p&gt;&lt;pre&gt;&lt;br /&gt; protected void Button1_Click(object sender, EventArgs e)&lt;br /&gt; {&lt;br /&gt;     GlobalWeather gw = new GlobalWeather();&lt;br /&gt;     string weather = gw.GetWeather(txtCity.Text, txtCountry.Text);&lt;br /&gt;     lblWeather.Text = weather;&lt;br /&gt; }&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;Note how little code it takes to process this. The web service tells you when you add it that this method requires two string arguments (city and country) and that it returns a string. Some webservices can be more complex, but most are fairly straight forward to use&lt;/p&gt;&lt;p&gt;Here is a picture of the form running&lt;/p&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;a href="http://4.bp.blogspot.com/-0-ehoXwbtsc/Tp9HBU0hr2I/AAAAAAAAAS8/3Sj6gZxTvgM/s1600/WeatherRunning.JPG" imageanchor="1" style=""&gt;&lt;img border="0" height="201" width="320" src="http://4.bp.blogspot.com/-0-ehoXwbtsc/Tp9HBU0hr2I/AAAAAAAAAS8/3Sj6gZxTvgM/s320/WeatherRunning.JPG" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-4035427316303203766?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/4035427316303203766/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2011/10/consuming-simple-web-services.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/4035427316303203766'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/4035427316303203766'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2011/10/consuming-simple-web-services.html' title='Consuming a Simple Web Services'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-LB3tILDVqxQ/Tp9GrJYCXXI/AAAAAAAAASk/4IhQ5b9Pv4Y/s72-c/AddWebReference.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-5915175985475064790</id><published>2011-10-18T12:58:00.001-07:00</published><updated>2011-10-18T12:58:20.719-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>Java Equivalent to C# Assignment 3</title><content type='html'>&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;package Income;&lt;br /&gt;import java.util.Scanner;&lt;br /&gt;&lt;br /&gt;public class NetIncomeCalculator {&lt;br /&gt;&lt;br /&gt; /**&lt;br /&gt;  * This program calculates gross pay&lt;br /&gt;  * and net pay given deductions in &lt;br /&gt;  * Social Security, medicare and a bus&lt;br /&gt;  * pass. It uses else if statments&lt;br /&gt;  * to determine the rate of deduductions&lt;br /&gt;  * This is the equivalent of&lt;br /&gt;  * Assignment three in C# in ITC 110&lt;br /&gt;  * Steve Conger 10/18/2011&lt;br /&gt;  */&lt;br /&gt; &lt;br /&gt; //declaring constants&lt;br /&gt; //final double SOCIALSECURITY = .09;&lt;br /&gt; //final double MEDICARE=.03;&lt;br /&gt; final int BUSPASS=25;&lt;br /&gt;   &lt;br /&gt; public static void main(String[] args) {&lt;br /&gt;  //declare and instantiate the class&lt;br /&gt;  //to load it (main being static is&lt;br /&gt;  //already loaded into memory&lt;br /&gt;  NetIncomeCalculator netcalc = new NetIncomeCalculator();&lt;br /&gt;  //call the starting method&lt;br /&gt;  netcalc.Display();&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; private void Display()&lt;br /&gt; {&lt;br /&gt;  //get input&lt;br /&gt;  //the scanner is an object to read from the console&lt;br /&gt;  Scanner reader = new Scanner(System.in);&lt;br /&gt;  System.out.println("Enter the number of hours worked");&lt;br /&gt;  double hours = reader.nextDouble();&lt;br /&gt;  System.out.println("Enter your rate per hour");&lt;br /&gt;  double rate=reader.nextDouble();&lt;br /&gt;  &lt;br /&gt;  //call the methods to do the calculations&lt;br /&gt;  double grossPay=CalcIncome(hours, rate);&lt;br /&gt;  double socialSec = CalcSocialSecurity(grossPay);&lt;br /&gt;  double medicare = CalcMedicare(grossPay);&lt;br /&gt;  double netPay=CalcNetPay(grossPay, socialSec, medicare);&lt;br /&gt;  &lt;br /&gt;  //outputs&lt;br /&gt;  System.out.println("Your gross income is " + grossPay);&lt;br /&gt;  System.out.println("Your Social Security deduction is " + socialSec);&lt;br /&gt;  System.out.println("Your Medicare deduction is " + medicare);&lt;br /&gt;  System.out.println("Your Bus pass deduction is " + BUSPASS/4);&lt;br /&gt;  System.out.println("Your net pay is " + netPay);&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; private double CalcIncome(double hrs, double rt)&lt;br /&gt; {&lt;br /&gt;  double gross=0;&lt;br /&gt;  //check to see if the hours are more than forty&lt;br /&gt;  //if they are pay time and a half for overtime&lt;br /&gt;  //if not just pay the rate of pay&lt;br /&gt;  if (hrs &gt; 40)&lt;br /&gt;  {&lt;br /&gt;   gross=rt * (40 + ((hrs-40)*1.5));&lt;br /&gt;  }&lt;br /&gt;  else&lt;br /&gt;  {&lt;br /&gt;   gross = rt * hrs;&lt;br /&gt;  }&lt;br /&gt;  return gross;&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; private double CalcSocialSecurity(double gPay)&lt;br /&gt; {&lt;br /&gt;  double ss =0;&lt;br /&gt;  if (gPay &gt;= 5000)&lt;br /&gt;   ss=.4;&lt;br /&gt;  else if (gPay &gt;= 4000 )&lt;br /&gt;   ss=.35;&lt;br /&gt;  else if (gPay &gt;=3000)&lt;br /&gt;   ss=.25;&lt;br /&gt;  else if (gPay &gt;=2000)&lt;br /&gt;   ss=.2;&lt;br /&gt;  else if (gPay &gt; 1000)&lt;br /&gt;   ss=.12;&lt;br /&gt;  else&lt;br /&gt;   ss=.09;&lt;br /&gt;  &lt;br /&gt;  return gPay * ss;&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; private double CalcMedicare(double gPay)&lt;br /&gt; {&lt;br /&gt;  double med=0;&lt;br /&gt;  if (gPay &gt;=5000)&lt;br /&gt;   med=.2;&lt;br /&gt;  else if (gPay &gt;= 2000)&lt;br /&gt;   med=.1;&lt;br /&gt;  else&lt;br /&gt;   med=.05;&lt;br /&gt;  return gPay * med;&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; private double CalcNetPay(double gPay, double ss, double med)&lt;br /&gt; {&lt;br /&gt;  return gPay - (ss + med + (BUSPASS/4));&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-5915175985475064790?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/5915175985475064790/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2011/10/java-equivalent-to-c-assignment-3.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/5915175985475064790'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/5915175985475064790'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2011/10/java-equivalent-to-c-assignment-3.html' title='Java Equivalent to C# Assignment 3'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-506741680344011576</id><published>2011-10-18T12:22:00.000-07:00</published><updated>2011-10-18T12:23:14.719-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC110'/><title type='text'>Morning Arrays and loops</title><content type='html'>&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Text;&lt;br /&gt;&lt;br /&gt;namespace ArraysAndLoops2&lt;br /&gt;{&lt;br /&gt;    class Program&lt;br /&gt;    {&lt;br /&gt;        /// &lt;summary&gt;&lt;br /&gt;        /// This program will create an array&lt;br /&gt;        /// populate and array&lt;br /&gt;        /// Display it&lt;br /&gt;        /// sum and average the contents&lt;br /&gt;        /// &lt;/summary&gt;&lt;br /&gt;       &lt;br /&gt;        static void Main(string[] args)&lt;br /&gt;        {&lt;br /&gt;            Program p = new Program();&lt;br /&gt;            string choice="y";&lt;br /&gt;            while (choice != "n" &amp;&amp; choice != "N")&lt;br /&gt;            {&lt;br /&gt;                p.CreateArray();&lt;br /&gt;                p.ParallelArrays();&lt;br /&gt;                Console.WriteLine("Do you want enter more payments? Y/N");&lt;br /&gt;                choice = Console.ReadLine();&lt;br /&gt;            }&lt;br /&gt;            Console.ReadKey();&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        private void CreateArray()&lt;br /&gt;        {&lt;br /&gt;            //double[] payments = new double[5];&lt;br /&gt;            //payments[0] = 234.5;&lt;br /&gt;            //payments[1] = 45.6;&lt;br /&gt;            //payments[2] = 100;&lt;br /&gt;            //payments[3] = 37.98;&lt;br /&gt;            //payments[4] = 223;&lt;br /&gt;&lt;br /&gt;            //int[] ray;&lt;br /&gt;            //ray = new int[] { 45, 2, 3, 7, 22 };&lt;br /&gt;&lt;br /&gt;            Console.WriteLine("How many payments do you want to enter");&lt;br /&gt;            int number = int.Parse(Console.ReadLine());&lt;br /&gt;&lt;br /&gt;            double[] payments = new double[number];&lt;br /&gt;&lt;br /&gt;            for (int i = 0; i &lt; number; i++)&lt;br /&gt;            {&lt;br /&gt;                Console.WriteLine(payments[i]);&lt;br /&gt;            }//end for&lt;br /&gt;&lt;br /&gt;            FillArray(payments, number);&lt;br /&gt;        }//end create array&lt;br /&gt;&lt;br /&gt;        private void FillArray(double[] paymnts, int size)&lt;br /&gt;        {&lt;br /&gt;            for (int i = 0; i &amp;lt; size; i++)&lt;br /&gt;            {&lt;br /&gt;                Console.WriteLine("Enter Payment");&lt;br /&gt;                paymnts[i] = double.Parse(Console.ReadLine());&lt;br /&gt;            }// end for&lt;br /&gt;            DisplayArray(paymnts, size);&lt;br /&gt;        }//end of Fill array&lt;br /&gt;&lt;br /&gt;        private void DisplayArray(double[] pmts, int size)&lt;br /&gt;        {&lt;br /&gt;            Console.WriteLine("************************\n");&lt;br /&gt;          &lt;br /&gt;            //Console.Clear();&lt;br /&gt;            for (int i = 0; i &amp;lt; size; i++)&lt;br /&gt;            {&lt;br /&gt;                Console.WriteLine(pmts[i]);&lt;br /&gt;            }//end for&lt;br /&gt;            SumAndAverage(pmts, size);&lt;br /&gt;        }//end Display&lt;br /&gt;&lt;br /&gt;        private void SumAndAverage(double[] pay, int size)&lt;br /&gt;        {&lt;br /&gt;            double total = 0;&lt;br /&gt;            for (int i = 0; i &amp;lt; size; i++)&lt;br /&gt;            {&lt;br /&gt;                total += pay[i]; //total=total + pay[i] -= *= %= /=&lt;br /&gt;            }&lt;br /&gt;            Console.WriteLine("The total is {0}", total);&lt;br /&gt;            double average = total / pay.Length;&lt;br /&gt;            Console.WriteLine("the average is {0}", average);&lt;br /&gt;        }//end sum and average&lt;br /&gt;&lt;br /&gt;        private void ParallelArrays()&lt;br /&gt;        {&lt;br /&gt;            int[] myArray1 = new int[] { 2, 3, 54, 6, 8 };&lt;br /&gt;            int[] myArray2 = new int[] { 3, 5, 2, 12, 4 };&lt;br /&gt;&lt;br /&gt;            for (int i = 0; i &amp;lt; myArray1.Length; i++)&lt;br /&gt;            {&lt;br /&gt;                Console.WriteLine(myArray1[i] * myArray2[i]);&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;    }//end class&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-506741680344011576?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/506741680344011576/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2011/10/using-systemusing-system.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/506741680344011576'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/506741680344011576'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2011/10/using-systemusing-system.html' title='Morning Arrays and loops'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-48406247582391136</id><published>2011-10-17T19:12:00.000-07:00</published><updated>2011-10-17T19:12:22.262-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC110'/><title type='text'>Loops and Arrays</title><content type='html'>&lt;pre&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Text;&lt;br /&gt;&lt;br /&gt;namespace ArraysAndLoops&lt;br /&gt;{&lt;br /&gt;    class Program&lt;br /&gt;    {&lt;br /&gt;&lt;br /&gt;        /*This program will have three methods&lt;br /&gt;         * one to create an array&lt;br /&gt;         * one to populate it&lt;br /&gt;         * and one to display it&lt;br /&gt;         */&lt;br /&gt;        static void Main(string[] args)&lt;br /&gt;        {&lt;br /&gt;            Program p = new Program();&lt;br /&gt;            string exit = "y";&lt;br /&gt;            while (exit != "n" &amp;&amp; exit !="N")&lt;br /&gt;            {&lt;br /&gt;                p.CreateArray();&lt;br /&gt;                Console.WriteLine("Do you want to continue y/n");&lt;br /&gt;                exit = Console.ReadLine();&lt;br /&gt;            }&lt;br /&gt;            p.PauseIt();&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        //this method&lt;br /&gt;        //creates an array&lt;br /&gt;        private void CreateArray()&lt;br /&gt;        {&lt;br /&gt;&lt;br /&gt;            Console.WriteLine("How many payments do you want to enter?");&lt;br /&gt;            int number = int.Parse(Console.ReadLine());&lt;br /&gt;            double[] payments= new double[number];&lt;br /&gt;&lt;br /&gt;            FillArray(payments, number);&lt;br /&gt;&lt;br /&gt;            //double[] pmts = new double[] { 12.95, 34, 21.4, 43 };&lt;br /&gt;            //payments[0] = 255;&lt;br /&gt;            //payments[1] = 34.5;&lt;br /&gt;            //payments[2] = 44.5;&lt;br /&gt;            //payments[3] = 34;&lt;br /&gt;            //payments[4] = 34.5;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        private void FillArray(double[] payArray, int size)&lt;br /&gt;        {&lt;br /&gt;            //for loop&lt;br /&gt;            for (int i=0; i &lt; size; i++)&lt;br /&gt;            {&lt;br /&gt;                Console.WriteLine("Enter a payment");&lt;br /&gt;&lt;br /&gt;                payArray[i] = double.Parse(Console.ReadLine());&lt;br /&gt;            }//end for&lt;br /&gt;            DisplayArray(payArray, size); //call DisplayArrayMethod&lt;br /&gt;           &lt;br /&gt;        }//end fill array&lt;br /&gt;&lt;br /&gt;        private void DisplayArray(double[] pmt, int size)&lt;br /&gt;        {&lt;br /&gt;            Console.WriteLine("***********************");&lt;br /&gt;            int x = 0;&lt;br /&gt;            while (x &lt; size)&lt;br /&gt;            {&lt;br /&gt;                Console.WriteLine(pmt[x]);&lt;br /&gt;                x++;&lt;br /&gt;&lt;br /&gt;                /*&lt;br /&gt;                 * +=  (number += 10) same as (number= number + 10);&lt;br /&gt;                -= minus (number -=10) same as (number=number-10)&lt;br /&gt;                -- decrement subtract one each time&lt;br /&gt;                *= (number *=10) same as (number=number*10)&lt;br /&gt;                %=(number %=10) same as (number=number%10)&lt;br /&gt;                /=(number /=10) same as (number=number/10)&lt;br /&gt;                  */&lt;br /&gt;            }//end while&lt;br /&gt;            Sum(pmt, size);&lt;br /&gt;        } //end display&lt;br /&gt;&lt;br /&gt;        private void Sum(double[] payment, int size)&lt;br /&gt;        {&lt;br /&gt;            double total = 0;&lt;br /&gt;            for (int i = 0; i &lt; size; i++)&lt;br /&gt;            {&lt;br /&gt;                total += payment[i];&lt;br /&gt;                //weight = grades[i] * credits[i];&lt;br /&gt;            }&lt;br /&gt;            double average = total / size;&lt;br /&gt;            Console.WriteLine("the total is {0}", total);&lt;br /&gt;            Console.WriteLine("the Average is {0}",average);&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        private void PauseIt()&lt;br /&gt;        {&lt;br /&gt;            Console.WriteLine("Press any key to exit");&lt;br /&gt;            Console.ReadKey();&lt;br /&gt;        }//end PauseIt&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    }//end class&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-48406247582391136?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/48406247582391136/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2011/10/loops-and-arrays.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/48406247582391136'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/48406247582391136'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2011/10/loops-and-arrays.html' title='Loops and Arrays'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-8810645355169133299</id><published>2011-10-17T16:29:00.000-07:00</published><updated>2011-10-17T16:29:52.833-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC110'/><title type='text'>Arrays</title><content type='html'>&lt;p&gt;An array says your book, "represents a fixed number of elements of the same type." An array, for instance can be a set of integers or a set of doubles or strings. The set can be accessed under a single variable name.&lt;/p&gt; &lt;p&gt; You use square brackets [] to signify an array. The following declares an array of integers with 5 elements&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;int[] myArray=new int[5];&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;Each element in an array has an index number. We can use these indexes to assign or access values in an array. Indexes always begin with 0&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;myArray[0]=5;&lt;br /&gt;myArray[1]=12;&lt;br /&gt;myArray[2]=7;&lt;br /&gt;myArray[3]=74;&lt;br /&gt;myArray[4]=9;&lt;br /&gt;&lt;br /&gt;Console.WriteLine("The fourth element of the array is {0}",myArray[3]);&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;Here is another way to declare an array. This declaration declares a string array and assigns the values at the moment when the array is created&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;string[ ] weekdays =new string[ ]&lt;br /&gt;       {"Monday","Tuesday","Wednesday", "Thursday", "Friday", "Saturday", "Sunday"};&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;The values are still indexed 0 to 6&lt;/p&gt;&lt;hr/&gt;&lt;p&gt;Array work naturally with loops. You can easily use a loop to assign values:&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;for (int i=0; i&amp;lt;size;i++)&lt;br /&gt;{&lt;br /&gt;     Console.WriteLine("Enter an Integer");&lt;br /&gt;     myArray[i]=int.Parse(Console.ReadLine());&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;Arrays can be passed as a parameter to methods and they can be returned by a method.&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;private void CreateArray()&lt;br /&gt;{&lt;br /&gt;    double[ ] payments = new double[5];&lt;br /&gt;    FillArray(payments, 5);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private void FillArray(double[ ] pmts, int size)&lt;br /&gt;{&lt;br /&gt;    int x=0;&lt;br /&gt;   while (x &amp;lt; size)&lt;br /&gt;  {&lt;br /&gt;     Console.WriteLine("Enter Payment Amount");&lt;br /&gt;     pmts[x]=double.Parse(Console.ReadLine());&lt;br /&gt;     x++;&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-8810645355169133299?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/8810645355169133299/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2011/10/arrays.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/8810645355169133299'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/8810645355169133299'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2011/10/arrays.html' title='Arrays'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-5307080278093507686</id><published>2011-10-17T13:18:00.000-07:00</published><updated>2011-10-24T13:48:30.878-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Trends'/><title type='text'>Apps</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-L6eQA2ggc6k/TpSvYkUas2I/AAAAAAAAARc/_Doc8l8XHMU/s1600/IPhone.jpg" imageanchor="1" style="clear:left; float:left;margin-right:1em; margin-bottom:1em"&gt;&lt;img border="0" height="275" width="183" src="http://3.bp.blogspot.com/-L6eQA2ggc6k/TpSvYkUas2I/AAAAAAAAARc/_Doc8l8XHMU/s320/IPhone.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;The term "app"  is short for application, but it has come to have a special meaning when applied to mobile devices such as phones, mp3  players and tablets. To some extent, these apps, like the term, are abbreviated. They are streamlined to run on the limited resources of a phone or tablet. That isn't to say that some of them aren't quite complex, but no matter how sophisticated, they must run within the constraints of the device they are on.&lt;/p&gt;&lt;p&gt;The question is how important is it for a student to get into the app market, and, if it is important, what skills do they need to get a foot in the door.&lt;/p&gt;&lt;p&gt;Apps have become big business, just as a decade ago every company had to have a web site, now every company has to have an app on your phone. Apps are rapidly becoming the predominate way of accessing the internet.&lt;p&gt;In September 2010 Chris Anderson wrote an article for &lt;b&gt;Wired&lt;/b&gt; called &lt;b&gt;The Web is Dead, Long Live the Internet&lt;/b&gt; In it he said:&lt;/p&gt;&lt;p&gt;&lt;em&gt; Over the past few years, one of the most important shifts in the digital world has been the move from the wide-open Web to semiclosed platforms that use the Internet for transport but not the browser for display. It’s driven primarily by the rise of the iPhone model of mobile computing, and it’s a world Google can’t crawl, one where HTML doesn’t rule. And it’s the world that consumers are increasingly choosing, not because they’re rejecting the idea of the Web but because these dedicated platforms often just work better or fit better into their lives (the screen comes to them, they don’t have to go to the screen). The fact that it’s easier for companies to make money on these platforms only cements the trend. Producers and consumers agree: The Web is not the culmination of the digital revolution.&lt;/em&gt; &lt;/p&gt;&lt;p&gt;&lt;em&gt;And the shift is only accelerating. Within five years, Morgan Stanley projects, the number of users accessing the Net from mobile devices will surpass the number who access it from PCs. Because the screens are smaller, such mobile traffic tends to be driven by specialty software, mostly apps, designed for a single purpose. For the sake of the optimized experience on mobile devices, users forgo the general-purpose browser. They use the Net, but not the Web. Fast beats flexible.&lt;/em&gt;&lt;/p&gt;&lt;a href="http://www.wired.com/magazine/2010/08/ff_webrip/all/1"&gt;http://www.wired.com/magazine/2010/08/ff_webrip/all/1 &lt;/a&gt;&lt;p&gt;Sara Perez in &lt;b&gt;Read Write Moblie&lt;/b&gt; notes:&lt;em&gt;Native data applications, such as those installed on smartphones like the iPhone and devices running Android, now account for 50% of all mobile data volume according to a new report from Finnish mobile analytics company Zokem. In a global smartphone study released this month, the company found that while the mobile Web browser was still the most popular smartphone "app," the use of native apps outside the browser is growing faster than mobile browsing itself.&lt;/em&gt; &lt;/p&gt;&lt;p&gt;Cisco networks notes the following:&lt;/p&gt;&lt;p&gt;&lt;em&gt;&lt;b&gt;Global mobile data traffic grew 2.6-fold in 2010, nearly tripling for the third year in a row.&lt;/b&gt; The 2010 mobile data traffic growth rate was higher than anticipated. Last year's forecast projected that the growth rate would be 149 percent. This year's estimate is that global mobile data traffic grew 159 percent in 2010 &lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&lt;b&gt;Last year's mobile data traffic was three times the size of the entire global Internet in 2000.&lt;/b&gt; Global mobile data traffic in 2010 (237 petabytes per month) was over three times greater than the total global Internet traffic in 2000 (75 petabytes per month).&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&lt;b&gt;Mobile video traffic will exceed 50 percent for the first time in 2011.&lt;/b&gt; Mobile video traffic was 49.8 percent of total mobile data traffic at the end of 2010, and will account for 52.8 percent of traffic by the end of 2011.&lt;/em&gt;&lt;/p&gt;&lt;a href="http://www.cisco.com/en/US/solutions/collateral/ns341/ns525/ns537/ns705/ns827/white_paper_c11-520862.html"&gt;http://www.cisco.com/en/US/solutions/collateral/ns341/ns525/ns537/ns705/ns827/white_paper_c11-520862.html&lt;/a&gt;&lt;p&gt;Companies are advertising for programmers to create apps. Typically they want people who can program for Apple's IOS and also for Android. Some also want Window's phone developers. &lt;a href="http://www.SimplyHired.com"&gt;&lt;b&gt;Simply Hired&lt;/b&gt;&lt;/a&gt; had scores of listing for IPhone developer and nearly equal listings for Android developers. There were several listings for Windows phones as well.&lt;/p&gt;&lt;p&gt;The financial model for these apps is still developing. Many are free. They either generate no revenue for the app creator or they generate revenue by incorporating advertisements. Company based apps are usually free, the app itself being a form of advertising. Many other free apps are "lite" versions which encourage you to upgrade to a more feature rich version for a price. Some apps are sold at a 99 cent level. If an app takes off and is downloaded often enough this can add up to significant revenue. Other, usually serious productivity apps, such as Quick Office, charge comparatively large fees for download. But even these fees are miniscule compared to the prices of comparable software for the PC. An expensive app might be priced around 25 dollars, whereas its pc equivalent would be hundreds.&lt;/p&gt;&lt;p&gt;For a student, then there would seem to be two opportunities. One would be to work for a company that wants to build and distribute apps to support its business customers and processes. Another is to build their own apps and try to sell them in the app stores.&lt;/p&gt;&lt;hr/&gt;&lt;h2&gt;Skills Required to Create Apps&lt;/h2&gt;&lt;p&gt;First let's consider what apps do:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;They must use disk and memory resources efficiently since these are limited on mobile devices&lt;/li&gt;&lt;li&gt;They must surrender focus gracefully, especially on phones where they must recede to allow the phone call to take precedence.&lt;/li&gt;&lt;li&gt;They must thread processes to allow both foreground and background processing&lt;/li&gt;&lt;li&gt;They often store data locally for short terms (some for longer)&lt;/li&gt;&lt;li&gt;They usually read from and write to cloud data sources&lt;/li&gt;&lt;li&gt;They need to refresh on receiving focus&lt;/li&gt;&lt;li&gt;They usually keep the location and status of the user&lt;/li&gt;&lt;li&gt;Most apps listen for data and can pass alerts to the user&lt;/li&gt;&lt;li&gt;They need a simple, clear GUI&lt;/li&gt;&lt;li&gt;Many scale to the device with a different look on a phone than a tablet&lt;/li&gt;&lt;/ul&gt;&lt;p&gt; Let's be clear, to develop apps a programmer still needs all the basic programming skills. He or she must know how to  use programming structures such a selection, repetition and arrays. He or she must know how to create appropriate methods, etc. In addition they should have a good understanding of object oriented principles especially inheritance, since much mobile programming involves extending objects that are provided by the development kit.&lt;/p&gt;&lt;p&gt;Additionally, a developer should learn to thread applications, separating foreground and background operations. This is an important skill for surrendering focus to a phone call or another application&lt;/p&gt;&lt;p&gt;The developer should know how to find and access services, both on the phone and the cloud. These include the GPS  services and various data services&lt;/p&gt;&lt;p&gt;Basic database skills for storing and retrieving data are also valuable.&lt;/p&gt;&lt;hr/&gt;&lt;h2&gt;Specific Platform requirements&lt;/h2&gt;&lt;h3&gt;IPhone| IPad| IPod&lt;/h3&gt;&lt;p&gt;The tools for IOS development are only available on the MAC. IOS Apps are developed in Object C using XCode. All apps must be processed and approved by Apple and distributed through Apple's AppStore&lt;/p&gt;&lt;p&gt;Here is Apple's&lt;a href="http://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/Introduction/Introduction.html"&gt;"&gt;Developer site&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Here is an example of &lt;a href="http://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/iPhone101/Articles/A1_CodeListings.html#//apple_ref/doc/uid/TP40007514-CH12-SW1"&gt; Objective C code&lt;/a&gt;  for a hello world IPhone app&lt;/p&gt;&lt;h3&gt;Android&lt;/h3&gt;&lt;p&gt;The primary tools for Android are Java and xml through the Android SDK. There are several possible distributors for Android Apps, the largest of which is Google. You can also self distribute if you wish.&lt;/p&gt;&lt;p&gt;Here is the link to the &lt;a href="http://developer.android.com/guide/index.html"&gt;Android Developers guide&lt;/a&gt;&lt;/p&gt;&lt;h3&gt;Windows Phones&lt;/h3&gt;&lt;p&gt;Windows phones use Silverlight with its XAML xml and C# or alternatively XBoxes XNA platform with C#.&lt;/p&gt;&lt;p&gt;Here is &lt;a href="http://msdn.microsoft.com/en-us/library/ff402523(v=vs.92).aspx"&gt; Microsoft's phone development site&lt;/a&gt;&lt;/p&gt;&lt;p&gt;It is also possible to create phone apps in all these platforms using HTML5. HTML5 apps are run through the phones browser. Microsoft has announced that its next OS, Windows 8 will work across hardware platforms and be based on HTML 5 and JavaScript. I am still unclear as to what that implementation will look like.&lt;/p&gt;&lt;hr/&gt;&lt;p&gt;&lt;strong&gt;This is just a draft of the topic. I will try to expand on it more over time. Please feel free to comment and suggest additions or changes&lt;/strong&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-5307080278093507686?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/5307080278093507686/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2011/10/apps.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/5307080278093507686'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/5307080278093507686'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2011/10/apps.html' title='Apps'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-L6eQA2ggc6k/TpSvYkUas2I/AAAAAAAAARc/_Doc8l8XHMU/s72-c/IPhone.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-5757520772094618213</id><published>2011-10-11T12:02:00.001-07:00</published><updated>2011-10-11T12:03:00.753-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC110'/><title type='text'>Morning Class Selection statements</title><content type='html'>&lt;p&gt;Here is the code we did in class with comments&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Text;&lt;br /&gt;&lt;br /&gt;namespace SelectionExamples&lt;br /&gt;{&lt;br /&gt;    class Program&lt;br /&gt;    {&lt;br /&gt;        /*******************&lt;br /&gt;         * this program has examples of &lt;br /&gt;         * if statements including an embedded if&lt;br /&gt;         * and an if else statement&lt;br /&gt;         * steve Conger 10/11/2011 &lt;br /&gt;         * ****************************/&lt;br /&gt;&lt;br /&gt;        static void Main(string[] args)&lt;br /&gt;        {&lt;br /&gt;            Program prog = new Program();&lt;br /&gt;            //prog.SimpleIf();&lt;br /&gt;            prog.IfElseIfExample();&lt;br /&gt;            prog.PauseIt();&lt;br /&gt;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        private void SimpleIf()&lt;br /&gt;        {&lt;br /&gt;            //this is not so simple an if any more&lt;br /&gt;            //declare an integer&lt;br /&gt;            //this is assigned a value by the "out" parameter&lt;br /&gt;            //two lines down&lt;br /&gt;            int number = 0;&lt;br /&gt;            Console.WriteLine("Enter an integer");&lt;br /&gt;&lt;br /&gt;            //try parse returns true or false&lt;br /&gt;            //true if the number can be converted to an integer&lt;br /&gt;            //otherwise false. If it is true it passes the &lt;br /&gt;            //interger value "out" to the number variable&lt;br /&gt;            //declared above&lt;br /&gt;            bool isInteger = int.TryParse(Console.ReadLine(),out number);&lt;br /&gt;&lt;br /&gt;            //below is an example of an imbedded if&lt;br /&gt;            //if it is a good number test it &lt;br /&gt;            if (isInteger == true)&lt;br /&gt;            {&lt;br /&gt;                //never get to this if, if it is not a number&lt;br /&gt;                if (number % 2 == 0)&lt;br /&gt;                {&lt;br /&gt;                    Console.WriteLine("the number is even");&lt;br /&gt;                }&lt;br /&gt;                else&lt;br /&gt;                {&lt;br /&gt;                    Console.WriteLine("the number is odd");&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;            else&lt;br /&gt;            {&lt;br /&gt;                Console.WriteLine("Not a valid number");&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        private void PauseIt()&lt;br /&gt;        {&lt;br /&gt;            Console.WriteLine("Press any key to exit");&lt;br /&gt;            Console.ReadKey();&lt;br /&gt;        }//end PauseIt&lt;br /&gt;&lt;br /&gt;        private void IfElseIfExample()&lt;br /&gt;        {&lt;br /&gt;            Console.WriteLine("Enter a test score");&lt;br /&gt;            int score = int.Parse(Console.ReadLine());&lt;br /&gt;&lt;br /&gt;            string grade=null; //initializes the string though to nothing&lt;br /&gt;&lt;br /&gt;            //below is an if, else if statement. It allows you to test &lt;br /&gt;            // a value against a sequence of ranges&lt;br /&gt;            //it is important that the sequence be correct&lt;br /&gt;            if (score &gt;= 90)&lt;br /&gt;            {&lt;br /&gt;                grade = "A";&lt;br /&gt;            }&lt;br /&gt;            else if (score &gt;= 80)&lt;br /&gt;            {&lt;br /&gt;                grade = "B";&lt;br /&gt;            }&lt;br /&gt;            else if (score &gt;= 70)&lt;br /&gt;            {&lt;br /&gt;                grade = "C";&lt;br /&gt;            }&lt;br /&gt;            else if (score &gt;= 60)&lt;br /&gt;            {&lt;br /&gt;                grade = "D";&lt;br /&gt;            }&lt;br /&gt;            else&lt;br /&gt;            {&lt;br /&gt;                grade = "F";&lt;br /&gt;            }&lt;br /&gt;            Console.WriteLine("your grade is {0}", grade);&lt;br /&gt;        }//end if else if&lt;br /&gt;        &lt;br /&gt;    }//end Program&lt;br /&gt;&lt;br /&gt;    &lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-5757520772094618213?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/5757520772094618213/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2011/10/morning-class-selection-statements.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/5757520772094618213'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/5757520772094618213'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2011/10/morning-class-selection-statements.html' title='Morning Class Selection statements'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-7594642969496429983</id><published>2011-10-10T18:56:00.000-07:00</published><updated>2011-10-10T18:56:17.594-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC110'/><title type='text'>If statements</title><content type='html'>&lt;p&gt;Here is the code from the evening class&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Text;&lt;br /&gt;&lt;br /&gt;namespace IfExamples&lt;br /&gt;{&lt;br /&gt;    class IfStatements&lt;br /&gt;    {&lt;br /&gt;        static void Main(string[] args)&lt;br /&gt;        {&lt;br /&gt;            IfStatements ifs = new IfStatements();&lt;br /&gt;            //ifs.SimpleIfStatement();&lt;br /&gt;            //ifs.IfElseExample();&lt;br /&gt;            ifs.SwitchExample();&lt;br /&gt;            ifs.PauseIt();&lt;br /&gt;        }//end main&lt;br /&gt;&lt;br /&gt;        private void SimpleIfStatement()&lt;br /&gt;        {&lt;br /&gt;            Console.WriteLine("Enter an age");&lt;br /&gt;            int age = int.Parse(Console.ReadLine());&lt;br /&gt;           //equality ==&lt;br /&gt;            //!= not equal&lt;br /&gt;&lt;br /&gt;            if (age &gt; 75)&lt;br /&gt;            {&lt;br /&gt;                Console.WriteLine("You are old");&lt;br /&gt;            }&lt;br /&gt;            else&lt;br /&gt;            {&lt;br /&gt;                Console.WriteLine("You are a spring chicken");&lt;br /&gt;            }&lt;br /&gt;        }//end SimpleIf&lt;br /&gt;&lt;br /&gt;        private void PauseIt()&lt;br /&gt;        {&lt;br /&gt;            Console.WriteLine("Press any key to exit");&lt;br /&gt;            Console.ReadKey();&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        }//end PauseIt&lt;br /&gt;&lt;br /&gt;        private void IfElseExample()&lt;br /&gt;        {&lt;br /&gt;            bool isInteger;&lt;br /&gt;            int score;&lt;br /&gt;            Console.WriteLine("Enter your test Score");&lt;br /&gt;             isInteger= int.TryParse(Console.ReadLine(), out score);&lt;br /&gt;&lt;br /&gt;             if (isInteger == false)&lt;br /&gt;             {&lt;br /&gt;                 Console.WriteLine("Next time enter a number");&lt;br /&gt;                 return;&lt;br /&gt;             }&lt;br /&gt;&lt;br /&gt;            int grade = 0;&lt;br /&gt;&lt;br /&gt;            if (score &gt;= 90)&lt;br /&gt;            {&lt;br /&gt;                grade = 4;&lt;br /&gt;            }&lt;br /&gt;            else if (score &gt;= 80)&lt;br /&gt;            {&lt;br /&gt;                grade = 3;&lt;br /&gt;            }&lt;br /&gt;            else if (score &gt;= 70)&lt;br /&gt;            {&lt;br /&gt;                grade = 2;&lt;br /&gt;            }&lt;br /&gt;            else if (score &gt;= 60)&lt;br /&gt;            {&lt;br /&gt;                grade = 1;&lt;br /&gt;            }&lt;br /&gt;            else&lt;br /&gt;            {&lt;br /&gt;                grade = 0;&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            Console.WriteLine("Your Grade is {0}", grade);&lt;br /&gt;        }//end ifelse&lt;br /&gt;&lt;br /&gt;        private void SwitchExample()&lt;br /&gt;        {&lt;br /&gt;            int choice;&lt;br /&gt;            Console.WriteLine("Choose which method to run");&lt;br /&gt;            Console.WriteLine("1: SimpleIfStatement");&lt;br /&gt;            Console.WriteLine("2: IfElseExample");&lt;br /&gt;            Console.WriteLine("3: Exit");&lt;br /&gt;&lt;br /&gt;            choice = int.Parse(Console.ReadLine());&lt;br /&gt;&lt;br /&gt;            switch (choice)&lt;br /&gt;            {&lt;br /&gt;                case 1:&lt;br /&gt;                    SimpleIfStatement();&lt;br /&gt;                    break;&lt;br /&gt;                case 2:&lt;br /&gt;                    IfElseExample();&lt;br /&gt;                    break;&lt;br /&gt;                case 3:&lt;br /&gt;                    PauseIt();&lt;br /&gt;                    break;&lt;br /&gt;                default:&lt;br /&gt;                    Console.WriteLine("Not a valid choice");&lt;br /&gt;                    break;&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;        }//end switch&lt;br /&gt;&lt;br /&gt;        //if (number &gt; 0 &amp;&amp; number &lt; 100) and&lt;br /&gt;        //if (number &lt; 0 || number &gt; 100) or&lt;br /&gt;&lt;br /&gt;    }//end class&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-7594642969496429983?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/7594642969496429983/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2011/10/if-statements.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/7594642969496429983'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/7594642969496429983'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2011/10/if-statements.html' title='If statements'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-8640978824618787155</id><published>2011-10-10T14:11:00.000-07:00</published><updated>2011-10-18T09:31:30.453-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>ITC 110 Assignment 2 in Java</title><content type='html'>&lt;p&gt;Here is the Java equivalent of Assignment 2&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;package Income;&lt;br /&gt;import java.util.Scanner;&lt;br /&gt;&lt;br /&gt;public class NetIncomeCalculator {&lt;br /&gt;&lt;br /&gt; /**&lt;br /&gt;  * This program calculates gross pay&lt;br /&gt;  * and net pay given deductions in &lt;br /&gt;  * Social Security, medicare and a bus&lt;br /&gt;  * pass. This is the equivalent of&lt;br /&gt;  * Assignment two in C# in ITC 110&lt;br /&gt;  * Steve Conger 10/10/2011&lt;br /&gt;  */&lt;br /&gt; &lt;br /&gt; //declaring constants&lt;br /&gt; final double SOCIALSECURITY = .09;&lt;br /&gt; final double MEDICARE=.03;&lt;br /&gt; final int BUSPASS=25;&lt;br /&gt;   &lt;br /&gt; public static void main(String[] args) {&lt;br /&gt;  //declare and instantiate the class&lt;br /&gt;  //to load it (main being static is&lt;br /&gt;  //already loaded into memory&lt;br /&gt;  NetIncomeCalculator netcalc = new NetIncomeCalculator();&lt;br /&gt;  //call the starting method&lt;br /&gt;  netcalc.Display();&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; private void Display()&lt;br /&gt; {&lt;br /&gt;  //get input&lt;br /&gt;  //the scanner is an object to read from the console&lt;br /&gt;  Scanner reader = new Scanner(System.in);&lt;br /&gt;  System.out.println("Enter the number of hours worked");&lt;br /&gt;  double hours = reader.nextDouble();&lt;br /&gt;  System.out.println("Enter your rate per hour");&lt;br /&gt;  double rate=reader.nextDouble();&lt;br /&gt;  &lt;br /&gt;  //call the methods to do the calculations&lt;br /&gt;  double grossPay=CalcIncome(hours, rate);&lt;br /&gt;  double socialSec = CalcSocialSecurity(grossPay);&lt;br /&gt;  double medicare = CalcMedicare(grossPay);&lt;br /&gt;  double netPay=CalcNetPay(grossPay, socialSec, medicare);&lt;br /&gt;  &lt;br /&gt;  //outputs&lt;br /&gt;  System.out.println("Your gross income is " + grossPay);&lt;br /&gt;  System.out.println("Your Social Security deduction is " + socialSec);&lt;br /&gt;  System.out.println("Your Medicare deduction is " + medicare);&lt;br /&gt;  System.out.println("Your Bus pass deduction is " + BUSPASS);&lt;br /&gt;  System.out.println("Your net pay is " + netPay);&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; private double CalcIncome(double hrs, double rt)&lt;br /&gt; {&lt;br /&gt;  double gross=0;&lt;br /&gt;  //check to see if the hours are more than forty&lt;br /&gt;  //if they are pay time and a half for overtime&lt;br /&gt;  //if not just pay the rate of pay&lt;br /&gt;  if (hrs &gt; 40)&lt;br /&gt;  {&lt;br /&gt;   gross=rt * (40 + ((hrs-40)*1.5));&lt;br /&gt;  }&lt;br /&gt;  else&lt;br /&gt;  {&lt;br /&gt;   gross = rt * hrs;&lt;br /&gt;  }&lt;br /&gt;  return gross;&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; private double CalcSocialSecurity(double gPay)&lt;br /&gt; {&lt;br /&gt;  return gPay * SOCIALSECURITY;&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; private double CalcMedicare(double gPay)&lt;br /&gt; {&lt;br /&gt;  return gPay * MEDICARE;&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; private double CalcNetPay(double gPay, double ss, double med)&lt;br /&gt; {&lt;br /&gt;  return gPay - (ss + med + BUSPASS);&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;Here is the output from the program&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;Enter the number of hours worked&lt;br /&gt;45&lt;br /&gt;Enter your rate per hour&lt;br /&gt;25&lt;br /&gt;Your gross income is 1187.5&lt;br /&gt;Your Social Security deduction is 106.875&lt;br /&gt;Your Medicare deduction is 35.625&lt;br /&gt;Your Bus pass deduction is 25&lt;br /&gt;Your net pay is 1020.0&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-8640978824618787155?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/8640978824618787155/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2011/10/itc-110-assignment-2-in-java.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/8640978824618787155'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/8640978824618787155'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2011/10/itc-110-assignment-2-in-java.html' title='ITC 110 Assignment 2 in Java'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-4084708185591142523</id><published>2011-10-10T13:14:00.000-07:00</published><updated>2011-10-18T09:31:58.280-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>ITC 110 Assignment 1 in Java</title><content type='html'>&lt;p&gt;This is the Java equivalent of the first ITC 110 assignment. I will do the other assignments in ITC 110 and also post them here&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;package Mileage;&lt;br /&gt;import java.util.Scanner;&lt;br /&gt;import java.io.*;&lt;br /&gt;public class CalcMileage {&lt;br /&gt;&lt;br /&gt; /**&lt;br /&gt;  * This is a simple program to Calculate&lt;br /&gt;  * miles per gallon&lt;br /&gt;  * it is the equivalent to ITC110&lt;br /&gt;  * assignment 1&lt;br /&gt;  * steve conger 9-26-2011&lt;br /&gt;  */&lt;br /&gt; public static void main(String[] args) {&lt;br /&gt;  //declare Scanner&lt;br /&gt;  Scanner reader = new Scanner(System.in);&lt;br /&gt;  //declare variables&lt;br /&gt;  double beginMileage;&lt;br /&gt;  double endMileage;&lt;br /&gt;  double gallons;&lt;br /&gt;  double pricePerGallon;&lt;br /&gt;  double milesPerGallon;&lt;br /&gt;  double costPerMile;&lt;br /&gt;  //get input&lt;br /&gt;  System.out.println("Enter the beginning mileage");&lt;br /&gt;  beginMileage=reader.nextDouble();&lt;br /&gt;  System.out.println("Enter the ending mileage");&lt;br /&gt;  endMileage=reader.nextDouble();&lt;br /&gt;  System.out.println("Enter the number of gallons");&lt;br /&gt;  gallons=reader.nextDouble();&lt;br /&gt;  System.out.println("Enter the price per gallon");&lt;br /&gt;  pricePerGallon=reader.nextDouble();&lt;br /&gt;  &lt;br /&gt;  //do processing of input&lt;br /&gt;  milesPerGallon=(endMileage-beginMileage)/gallons;&lt;br /&gt;  costPerMile=pricePerGallon /(endMileage-beginMileage);&lt;br /&gt;  &lt;br /&gt;  //output results&lt;br /&gt;  System.out.print("Your miles per gallon is ");&lt;br /&gt;  System.out.format("%.2f",milesPerGallon);&lt;br /&gt;  System.out.println();&lt;br /&gt;  System.out.print("the cost per mile is ");&lt;br /&gt;  System.out.format("%.2f",costPerMile);&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-4084708185591142523?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/4084708185591142523/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2011/10/itc-110-assignment-1-in-java.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/4084708185591142523'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/4084708185591142523'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2011/10/itc-110-assignment-1-in-java.html' title='ITC 110 Assignment 1 in Java'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-8340719211952743853</id><published>2011-10-06T13:25:00.000-07:00</published><updated>2011-10-06T13:25:31.156-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC110'/><title type='text'>Books and Websites</title><content type='html'>&lt;p&gt;Here is a list of books and websites you might fine useful to help you with C#&lt;/p&gt;&lt;h2&gt;Books&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;&lt;em&gt;Head First C#&lt;/em&gt;, O'Reilly, ISBN 978-0596514822&lt;/li&gt;&lt;li&gt;&lt;em&gt;Programming C#&lt;/em&gt;, Jeff Liberty, O'Relly, ISBM 978-059600699&lt;/li&gt;&lt;li&gt;&lt;em&gt;Sam's Teach Yourself, the C# Language in 21 days&lt;/em&gt;, Bradley Jones, Sams, ISBN  978-0672325465&lt;/li&gt;&lt;li&gt;&lt;em&gt;Murach's C# 2010&lt;/em&gt;, Murach and Associates, ISBN 978-1890774592&lt;/li&gt;&lt;/ul&gt;&lt;h2&gt;Web Sites&lt;/h2&gt;&lt;p&gt;&lt;a href="http://www.msdn.microsoft.com"&gt;http://www.msdn.microsoft.com &lt;/a&gt; MSDN Microsoft's development Network&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.Devx.com"&gt;http://www.Devx.com&lt;/a&gt; DevX development center&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-8340719211952743853?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/8340719211952743853/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2011/10/books-and-websites.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/8340719211952743853'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/8340719211952743853'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2011/10/books-and-websites.html' title='Books and Websites'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-1012750563578394412</id><published>2011-10-05T19:24:00.000-07:00</published><updated>2011-10-06T12:48:21.454-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC110'/><title type='text'>Start for Assignment 2</title><content type='html'>&lt;p&gt;Here is the starting code for Assignment 2&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Text;&lt;br /&gt;&lt;br /&gt;namespace Assignment2&lt;br /&gt;{&lt;br /&gt;    class Program&lt;br /&gt;    {&lt;br /&gt;&lt;br /&gt;        const double SOCSEC = .09;&lt;br /&gt;&lt;br /&gt;        static void Main(string[] args)&lt;br /&gt;        {&lt;br /&gt;            Program p = new Program();&lt;br /&gt;            p.Display();&lt;br /&gt;            p.PauseIt();&lt;br /&gt;        }//end main&lt;br /&gt;&lt;br /&gt;        private void Display()&lt;br /&gt;        {&lt;br /&gt;            Console.WriteLine("Enter the hours worked this week");&lt;br /&gt;            double hours = double.Parse(Console.ReadLine());&lt;br /&gt;            Console.WriteLine("Enter the rate per hour");&lt;br /&gt;            double rate = double.Parse(Console.ReadLine());&lt;br /&gt;&lt;br /&gt;            double weeklyGross = GrossPay(hours, rate);&lt;br /&gt;            Console.WriteLine("Your gross pay is {0:C}", weeklyGross);&lt;br /&gt;&lt;br /&gt;            double socialsec = SocialSecurity(weeklyGross);&lt;br /&gt;            Console.WriteLine("Your SS deduction is {0:C}", socialsec);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        }//end Display&lt;br /&gt;&lt;br /&gt;        double GrossPay(double weeklyHours, double hourlyRate)&lt;br /&gt;        {&lt;br /&gt;            double gross =0;&lt;br /&gt;            if (weeklyHours &gt; 40)&lt;br /&gt;            {&lt;br /&gt;                gross = hourlyRate * (40 + ((weeklyHours - 40) * 1.5));&lt;br /&gt;            }&lt;br /&gt;            else&lt;br /&gt;            {&lt;br /&gt;                gross = hourlyRate * weeklyHours;&lt;br /&gt;            }&lt;br /&gt;            return gross;&lt;br /&gt;        }//end GrossPay&lt;br /&gt;&lt;br /&gt;        private void PauseIt()&lt;br /&gt;        {&lt;br /&gt;            Console.WriteLine("Press any key to exit");&lt;br /&gt;            Console.ReadKey();&lt;br /&gt;        }//end PauseIt&lt;br /&gt;&lt;br /&gt;        private double SocialSecurity(double grossWeeklyPay)&lt;br /&gt;        {&lt;br /&gt;            return grossWeeklyPay * SOCSEC;&lt;br /&gt;        }&lt;br /&gt;    }//end Program&lt;br /&gt;}//end namespace&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-1012750563578394412?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/1012750563578394412/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2011/10/start-for-assignment-2.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/1012750563578394412'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/1012750563578394412'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2011/10/start-for-assignment-2.html' title='Start for Assignment 2'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-7343868892804071933</id><published>2011-10-05T14:05:00.000-07:00</published><updated>2011-10-05T14:05:46.791-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC110'/><title type='text'>Notes for Assignment 2</title><content type='html'>&lt;p&gt;Remember to break it into methods. Each method should do one thing. For example, one method can calculate the gross pay, another method can deduct social security, etc.&lt;/p&gt;&lt;p&gt;To calculate Overtime we need to us an if statement. We need to do one of two things depending on &lt;b&gt;if&lt;/b&gt; the hours are greater than 40 or 40 or less. This can be set up as follows:&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;if(hours &gt; 40)&lt;br /&gt;{&lt;br /&gt;     pay=rate * (40 + ((hours - 40) * 1.5);&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;    pay=rate * hours;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;If the hours are greater than forty, we multiply the rate times forty (because we know we have over forty hours and forty of them are paid at the regular rate) and then add the hours over forty times rate time 1.5 to get time and a half. The parenthesis are necessary to control the order of operations. We want the subtraction to occur first, then the multiplication, then the addition. If, on the other hand, the hours are 40 or less, we just multiply hours times the rate of pay.&lt;/p&gt;&lt;p&gt;For the assignment, you don't have to display the overtime pay separate from the regular pay. You can just display the Gross (total) pay, the deductions and the Net pay (what's left over). Though, if you want to add a challenge you can separate the two in the display.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-7343868892804071933?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/7343868892804071933/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2011/10/notes-for-assignment-2.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/7343868892804071933'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/7343868892804071933'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2011/10/notes-for-assignment-2.html' title='Notes for Assignment 2'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-3123375444706554284</id><published>2011-10-04T11:47:00.001-07:00</published><updated>2011-10-04T11:47:45.315-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC110'/><title type='text'>Methods Morning Class</title><content type='html'>&lt;p&gt;Here is the Morning class's sample code for methods. It is a little different from the evening class. I did not comment it nearly as thoroughly&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Text;&lt;br /&gt;&lt;br /&gt;namespace Methods&lt;br /&gt;{&lt;br /&gt;    class Program&lt;br /&gt;    {&lt;br /&gt;        static void Main(string[] args)&lt;br /&gt;        {&lt;br /&gt;            Program prog = new Program();&lt;br /&gt;            prog.Display();&lt;br /&gt;            prog.PauseIt();&lt;br /&gt;        }//end of Main&lt;br /&gt;&lt;br /&gt;       private void PauseIt()&lt;br /&gt;        {&lt;br /&gt;            Console.WriteLine("Press any key to exit");&lt;br /&gt;            Console.ReadKey();&lt;br /&gt;        }//end of PauseIt&lt;br /&gt;&lt;br /&gt;       private void Display()&lt;br /&gt;       {&lt;br /&gt;           Console.WriteLine("Enter the beginning mileage");&lt;br /&gt;           double beginningMileage = double.Parse(Console.ReadLine());&lt;br /&gt;&lt;br /&gt;           Console.WriteLine("Enter the ending mileage");&lt;br /&gt;           double endingMileage = double.Parse(Console.ReadLine());&lt;br /&gt;&lt;br /&gt;           double miles = TotalMiles(beginningMileage, endingMileage);&lt;br /&gt;&lt;br /&gt;           Console.WriteLine("\nYour total miles is {0}",miles);&lt;br /&gt;&lt;br /&gt;           Console.WriteLine("Enter the number of Gallons");&lt;br /&gt;           double gallons=double.Parse(Console.ReadLine());&lt;br /&gt;&lt;br /&gt;           double milesPerGal = MilesPerGallon(miles, gallons);&lt;br /&gt;           Console.WriteLine("Your miles per gallon is {0}", milesPerGal);&lt;br /&gt;           &lt;br /&gt;       }//end Display&lt;br /&gt;&lt;br /&gt;       private double TotalMiles(double startMiles, double endMiles )&lt;br /&gt;       {&lt;br /&gt;           return endMiles - startMiles;&lt;br /&gt;       }//Total Miles&lt;br /&gt;&lt;br /&gt;       private double MilesPerGallon(double totalMiles, double gals)&lt;br /&gt;       {&lt;br /&gt;           double mpg = totalMiles / gals;&lt;br /&gt;           return mpg;&lt;br /&gt;       }//end MilesPerGallon&lt;br /&gt;&lt;br /&gt;    }//end of program class&lt;br /&gt;&lt;br /&gt;}//end of namespace&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-3123375444706554284?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/3123375444706554284/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2011/10/methods-morning-class.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/3123375444706554284'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/3123375444706554284'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2011/10/methods-morning-class.html' title='Methods Morning Class'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-8884502885841216660</id><published>2011-10-03T19:16:00.001-07:00</published><updated>2011-10-03T19:16:41.390-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC110'/><title type='text'>Methods Example</title><content type='html'>&lt;p&gt;Here is our example from class with extensive comments&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Text;&lt;br /&gt;&lt;br /&gt;namespace methodsExample&lt;br /&gt;{&lt;br /&gt;    class Program&lt;br /&gt;    {&lt;br /&gt;        /*********************&lt;br /&gt;         * the point of this excercise is to show&lt;br /&gt;         * how to break a program into methods&lt;br /&gt;         * we have a display method and seperate&lt;br /&gt;         * methods to calcualte the gas mileage&lt;br /&gt;         * and the cost per mile.&lt;br /&gt;         * the point of breaking a program into methods&lt;br /&gt;         * is to divide the work and make it easier&lt;br /&gt;         * to maintain, debug and understand.&lt;br /&gt;         * Ideally each method should do one thing&lt;br /&gt;         * that way it is obvious where to look if&lt;br /&gt;         * something goes wrong&lt;br /&gt;         * Steve Conger 10/4/2011 */&lt;br /&gt;&lt;br /&gt;        static void Main(string[] args)&lt;br /&gt;        {&lt;br /&gt;            //a static method is loaded automatically&lt;br /&gt;            //into RAM, but the rest of the class is not&lt;br /&gt;            //so we need to "instantiate" the class&lt;br /&gt;            //to load it into memory where it can be used&lt;br /&gt;            Program p = new Program();&lt;br /&gt;            p.Display(); //call the display method&lt;br /&gt;            p.PauseIt();// call the PauseIT class&lt;br /&gt;            &lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        //void methods don't return a value&lt;br /&gt;        //they just do their thing&lt;br /&gt;        private void Display()&lt;br /&gt;        {&lt;br /&gt;            //inputs&lt;br /&gt;            //just like what we did in the first assignment&lt;br /&gt;            Console.WriteLine("Enter the Mileage");&lt;br /&gt;             double mileage = double.Parse(Console.ReadLine());&lt;br /&gt;             Console.WriteLine("Enter The Gallons");&lt;br /&gt;             double gals = double.Parse(Console.ReadLine());&lt;br /&gt;             Console.WriteLine("Enter The price per gallon");&lt;br /&gt;             double price = double.Parse(Console.ReadLine());&lt;br /&gt;            //outputs&lt;br /&gt;             Console.WriteLine("Your miles per gallon is {0:F2}", &lt;br /&gt;                 CalculateGasMileage(mileage, gals));//calls the CalculateGasMileage &lt;br /&gt;            //as part of the write line. You can only do this if the&lt;br /&gt;            //method returns a value&lt;br /&gt;&lt;br /&gt;            //this is another way to do it&lt;br /&gt;            //here we assign the returned result of the method&lt;br /&gt;            //to a new variable&lt;br /&gt;            double mpg=CalculateGasMileage(mileage, gals);&lt;br /&gt;&lt;br /&gt;            //we can use that variable in the writeline instead of calling&lt;br /&gt;            //the method again&lt;br /&gt;            Console.WriteLine("Your cost per mile is {0:C}",&lt;br /&gt;                CalculateCostPerMile(mpg,price));&lt;br /&gt;&lt;br /&gt;           &lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        //this method returns a double&lt;br /&gt;        //it takes two parameters that are give values&lt;br /&gt;        //when the method is called in the Display() method above&lt;br /&gt;        private double CalculateGasMileage(double miles, double gallons)&lt;br /&gt;        {&lt;br /&gt;            double milesPerGallon;&lt;br /&gt;            milesPerGallon = miles / gallons; &lt;br /&gt;            return milesPerGallon;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        private double CalculateCostPerMile(double milesPerGal, double pricePerGallon)&lt;br /&gt;        {&lt;br /&gt;            //double costPerGallon=0;&lt;br /&gt;            //this is a different way to return a value&lt;br /&gt;            //you can return the equation directly&lt;br /&gt;            return pricePerGallon / milesPerGal;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        private void PauseIt()&lt;br /&gt;        {&lt;br /&gt;            Console.WriteLine("Press any key to exit");&lt;br /&gt;            Console.ReadKey();&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-8884502885841216660?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/8884502885841216660/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2011/10/methods-example.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/8884502885841216660'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/8884502885841216660'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2011/10/methods-example.html' title='Methods Example'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-4885187635638586275</id><published>2011-09-28T19:00:00.000-07:00</published><updated>2011-09-28T19:00:49.747-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC110'/><title type='text'>Assignment One</title><content type='html'>&lt;h2&gt;Program Planning Document&lt;/h2&gt;&lt;p&gt;Your name: Steve&lt;/p&gt;&lt;p&gt;Date: 9/28/2011&lt;/p&gt;&lt;h3&gt;Purpose of the Program: &lt;/h3&gt;&lt;p&gt;he purpose of this program is to calculate gas mileage and cost per mile.&lt;/p&gt;&lt;h3&gt;Outputs: &lt;/h3&gt;&lt;p&gt;Cost per mile&lt;/p&gt;&lt;p&gt;Miles Per Gallon&lt;/p&gt;&lt;h3&gt;Inputs: &lt;/h3&gt;&lt;p&gt;Price of Gas&lt;/p&gt;&lt;p&gt;Beginning mileage&lt;/p&gt;&lt;p&gt;End Mileage&lt;/p&gt;&lt;p&gt;Gallons used&lt;/p&gt;&lt;h3&gt;Algorithm:&lt;/h3&gt;&lt;p&gt;Miles per gallon = (end Mileage-BeginningMileage)/gallons&lt;/p&gt;&lt;p&gt;Cost Per mile =cost per gallon / miles per gallon&lt;/p&gt;&lt;h3&gt;est Plan:&lt;/h3&gt;&lt;p&gt;Test: 100 miles/10 gallons (test case)&lt;/p&gt;&lt;p&gt;Expected Outcome: 10 miles per gallon&lt;/p&gt;&lt;p&gt;Test Cost 4 price /10&lt;/p&gt;&lt;p&gt;Expected Outcome .4&lt;/p&gt;&lt;p&gt;Actual Outcome: 10, .4&lt;/p&gt;&lt;p&gt;Notes:&lt;/p&gt;&lt;h3&gt;Code (paste your code below):&lt;/h3&gt;&lt;pre&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Text;&lt;br /&gt;&lt;br /&gt;namespace Assignment1&lt;br /&gt;{&lt;br /&gt;    /*Assignment 1&lt;br /&gt;     * steve Conger&lt;br /&gt;     * 9/28/2011 */&lt;br /&gt;&lt;br /&gt;    class Program&lt;br /&gt;    {&lt;br /&gt;        static void Main(string[] args)&lt;br /&gt;        {&lt;br /&gt;            //declare variables&lt;br /&gt;            double beginningMileage, endMileage, gallons, pricePerGallon, &lt;br /&gt;                milesPerGallon, costPerMile;&lt;br /&gt;&lt;br /&gt;            //Getting input&lt;br /&gt;            Console.WriteLine("Enter the beginning mileage");&lt;br /&gt;            beginningMileage = double.Parse(Console.ReadLine());&lt;br /&gt;            Console.WriteLine("Enter the ending mileage");&lt;br /&gt;            endMileage = double.Parse(Console.ReadLine());&lt;br /&gt;            Console.WriteLine("Enter the number of gallons");&lt;br /&gt;            gallons = double.Parse(Console.ReadLine());&lt;br /&gt;            Console.WriteLine("Enter the price per gallon");&lt;br /&gt;            pricePerGallon = double.Parse(Console.ReadLine());&lt;br /&gt;&lt;br /&gt;            //calculations&lt;br /&gt;            milesPerGallon = (endMileage - beginningMileage) / gallons;&lt;br /&gt;            costPerMile = pricePerGallon / milesPerGallon;&lt;br /&gt;&lt;br /&gt;            //Output&lt;br /&gt;            Console.WriteLine("Your miles per gallon are {0}", milesPerGallon);&lt;br /&gt;            Console.WriteLine("Your cost per mile is {0:C}", costPerMile);&lt;br /&gt;&lt;br /&gt;            Console.ReadKey();&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-4885187635638586275?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/4885187635638586275/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2011/09/assignment-one.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/4885187635638586275'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/4885187635638586275'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2011/09/assignment-one.html' title='Assignment One'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-7727704808862610107</id><published>2011-09-28T11:48:00.000-07:00</published><updated>2011-09-28T11:48:38.262-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC220'/><title type='text'>Statement of Work</title><content type='html'>&lt;p&gt;Here is the statement of work we did in class&lt;/p&gt;&lt;h2&gt;History&lt;/h2&gt;&lt;p&gt;The college wants to implement short certificates that can be earned more quickly than existing certificates. This will increase the number of completions. Registration says it cannot track these new certificates, so a new database is needed to track them.&lt;/p&gt;&lt;h2&gt;Scope&lt;/h2&gt;&lt;p&gt;The database should track the certificates, and the classes each certificate requires. The database must also track the classes each student takes and what certificates they have earned. For a class to qualify a student must earn at least a 2.0, the classes should all have been taken within a five year span The database should allow for class substitutions. It should allow some comments and notes. The database should produce email and phone lists for students who have earned a certificate. Students who are close to a certificate should be notified. The database should be secured to protect student information.&lt;/p&gt;&lt;p&gt;The database should produce reports of how many students earned particular certificates in a given period. It should report how many students almost achieved certificates but were missing one class or so. Might use database to track popular and special topic courses, and how much time it took to complete the certificates.&lt;/p&gt;&lt;p&gt;Constraints: The database will not read the student data directly from the school system.&lt;/p&gt;&lt;h2&gt;Objectives&lt;/h2&gt;&lt;p&gt;To track short term certicates.&lt;/p&gt;&lt;p&gt;To determine which students achieve certificates&lt;/p&gt;&lt;p&gt;Preliminary Time Line&lt;/p&gt;&lt;h2&gt; TimeLine&lt;/h2&gt;&lt;p&gt;Gathering information—4 weeks&lt;/p&gt;&lt;p&gt;Defining Business Rules—2 weeks&lt;/p&gt;&lt;p&gt;Designing databases—1 week&lt;/p&gt;&lt;p&gt;Normalizing data—1 week&lt;/p&gt;&lt;p&gt;Make the database--week&lt;/p&gt;&lt;p&gt;Test the database sql--week&lt;/p&gt;&lt;p&gt;security&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-7727704808862610107?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/7727704808862610107/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2011/09/statement-of-work.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/7727704808862610107'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/7727704808862610107'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2011/09/statement-of-work.html' title='Statement of Work'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-4786588499035294868</id><published>2011-09-26T18:24:00.001-07:00</published><updated>2011-09-27T12:57:50.915-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC110'/><title type='text'></title><content type='html'>&lt;p&gt;Here is the Hello World app from the evening class&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Text;&lt;br /&gt;&lt;br /&gt;namespace HelloWorld&lt;br /&gt;{&lt;br /&gt;    /*This is the traditional&lt;br /&gt;     * Hello world application&lt;br /&gt;     * pretty boring */&lt;br /&gt;&lt;br /&gt;    &lt;br /&gt;    class Program&lt;br /&gt;    {&lt;br /&gt;        static void Main(string[] args)&lt;br /&gt;        {&lt;br /&gt;            //This uses the console object&lt;br /&gt;            //and its WriteLine method&lt;br /&gt;            Console.WriteLine&lt;br /&gt;                ("Hello all you Martians");&lt;br /&gt;            //this is to pause the program long enough&lt;br /&gt;            //to see it&lt;br /&gt;            Console.ReadKey();&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-4786588499035294868?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/4786588499035294868/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2011/09/here-is-hello-world-app-from-evening.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/4786588499035294868'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/4786588499035294868'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2011/09/here-is-hello-world-app-from-evening.html' title=''/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-7204740830525928303</id><published>2011-09-25T13:02:00.000-07:00</published><updated>2011-09-25T13:02:36.318-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Trends'/><title type='text'>Trends in Programming and Database</title><content type='html'>&lt;p&gt;Information Technology is always in flux, but recently the field has experienced more and more significant changes than any time in recent memory. Many of the basic paradigms of computing are changing. More and more computing power is moving on to mobile devices such as phones and tablets. More and more we access our data and applications from the cloud. Computing is social and omnipresent. For would be developers and people thinking of entering the IT field the changes can be bewildering. What should I learn? What skills should I master? On What should I focus?&lt;/p&gt;&lt;p&gt;I am going to begin a new subject line in this blog called "trends." In these entries I am going to focus on arising trends in programming and database, and, in particular, the skills required to get entry level jobs in these changing fields.&lt;/p&gt;&lt;p&gt;Some of the topics I will look at include:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;The new mobile market including phones and tablets&lt;/li&gt;&lt;li&gt;Device programming (gps, cars, house, smart grid, etc.&lt;/li&gt;&lt;li&gt;Cloud computing, including cloud databases&lt;/li&gt;&lt;li&gt;Windows 8&lt;/li&gt;&lt;li&gt;HTML 5&lt;/li&gt;&lt;li&gt;Security&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;I will also look at other topics as they arise&lt;/p&gt;&lt;p&gt;I encourage comments and suggestions&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-7204740830525928303?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/7204740830525928303/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2011/09/trends-in-programming-and-database.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/7204740830525928303'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/7204740830525928303'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2011/09/trends-in-programming-and-database.html' title='Trends in Programming and Database'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-5071102519078357019</id><published>2011-08-18T12:38:00.000-07:00</published><updated>2011-08-18T12:39:16.126-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC110'/><title type='text'>Debugging and Trouble Shooting</title><content type='html'>&lt;h2&gt;Overview&lt;/h2&gt;&lt;br /&gt;There are three major types of errors that can occur in your program: First there are &lt;span style="color:Blue;"&gt;compile errors&lt;/span&gt;. These occur before you ever run the program. Typically they consist of mispelled key words or variables, missing semi-colons and curly braces.  These must be corrected before you can run the program.&lt;br /&gt;&lt;br /&gt;Next there are &lt;span style="color:Blue"&gt;Run time&lt;/span&gt; errors. These are errors that occur when the program is running. Typically they consist of Data type conflicts, or objects that are called before they are initialized. These cause the code to break and go into debug mode.&lt;br /&gt;&lt;br /&gt;The third kind of error is a &lt;span style="color:Blue"&gt;logical error&lt;/span&gt;. Logical errors are errors in the logic of the program. They usually don't cause the program to fail or crash. Rather they cause the program to return the wrong answer or no answer at all. These are the hardest errors to track down and fix.&lt;br /&gt;&lt;hr/&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Compile Errors&lt;/h2&gt;&lt;br /&gt;The key with compile errors is to use the Visual Studio environnment. &lt;br /&gt;&lt;br /&gt;Use the intellisense. The intellisense will show you all the objects defined by your program. It will show you all the relevant methods and properties. Using it can help cut down on mispellings and errors in capitalization.&lt;br /&gt;&lt;br /&gt;Read the error messages. Actually read them. They don't always tell you exactly where the problem is, but they get you close.&lt;br /&gt;&lt;br /&gt;Always work from the first error on down. Often fixing the first error will clear up most or all of the remaining errors. Errors tend to cascade through the program. One causes another which causes another, etc. If you work from the bottom of the list you will get frustrated, because you usually won't find anything wrong.&lt;br /&gt;&lt;br /&gt;Pay attention to the color coding in the coding environment itself. A keyword should be blue--if it is not it may mean you mistyped it. A red underline signifies an error. A green underline is just a comment or possibly a warning.&lt;br /&gt;&lt;hr/&gt;&lt;br /&gt;&lt;h2&gt;Run time errors&lt;/h2&gt;&lt;br /&gt;Most runtime errors are caused by user input, Users don't always enter what we expect, so the program should be able to handle the unexpected input. Ideally, test all use input to see if it is in the correct form. Use TryParse() instead of Parse().&lt;br /&gt;&lt;br /&gt;The other common cause of Runtime errors are objects that are not initialized properly. Make sure that you instantiate an object (make it new) before you call it.&lt;br /&gt;&lt;hr/&gt;&lt;br /&gt;&lt;h2&gt;Logical Errors&lt;/h2&gt;&lt;br /&gt;The key to finding logical errors is testing. Try the program with known values and a known output. If the output varies on the input, test a complete range of inputs to see if the proper outputs are returned. &lt;br /&gt;&lt;br /&gt;One strategy is to put temporary outputs in your program that print out the state of certain variables at a given point in the process. You can check these against what the variable should be.&lt;br /&gt;&lt;br /&gt;You can also use Visual Studios debugger. You can place breaks in the code and step through the part in question line by line, checking the values of the variables moment to moment.&lt;br /&gt;&lt;hr/&gt;&lt;br /&gt;&lt;h2&gt;General Suggestions&lt;/h2&gt;&lt;br /&gt;When writing a program, do one thing and then test it. If it works then when you add the next thing and the program fails you know it was in the new part. &lt;br /&gt;&lt;br /&gt;The same goes when debugging and trouble shooting. Make one change and then test it. Never make a bunch of changes willy nilly. It makes it almost impossible to tell what is working and what isn't.&lt;br /&gt;&lt;br /&gt;If you go over the code again and again and can't find a mistake in the logic, chances are good there isn't one. Look for syntax aand spelling errors instead. You often don't see these when looking at the logic.&lt;br /&gt;&lt;br /&gt;If possible, have someone else look it over. Another person can often see what you don't.&lt;br /&gt;&lt;br /&gt;If you spend hours on a thing and just can't get it to work. Walk away. Do something else entirely for a while. Often when you come back with fresh eyes, the problem that you were missing  becomes obvious.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-5071102519078357019?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/5071102519078357019/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2011/08/debugging-and-trouble-shooting.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/5071102519078357019'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/5071102519078357019'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2011/08/debugging-and-trouble-shooting.html' title='Debugging and Trouble Shooting'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-7924252075427974222</id><published>2011-08-18T12:05:00.001-07:00</published><updated>2011-08-18T12:06:53.161-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC110'/><title type='text'>Repetition Structures</title><content type='html'>Programs often need to do the same commands several times in a row. Repitition structures, or loops, are designed to do this. There are several kinds of loops. &lt;br /&gt;&lt;h2&gt;For loops&lt;/h2&gt;&lt;br /&gt;The first one we will look at is a &lt;span style="color:Blue"&gt;for&lt;/span&gt; loop.&lt;br /&gt;&lt;br /&gt;A &lt;span style="color:Blue"&gt;for&lt;/span&gt; loop contains three elements, a variable with an intial value, a terminal condition, and an increment or decriment statement. Here is an example of a simple for loop that simply outputs the numbers 1 through 10.&lt;br /&gt;&lt;hr/&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;for(int i=0;i&amp;lt;=10;i++)&lt;br /&gt;{&lt;br /&gt;   Console.WriteLine(i);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;hr/&gt;&lt;br /&gt;You could also count backwards:&lt;br /&gt;&lt;hr/&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;for(int i=10;i&gt;0;i--)&lt;br /&gt;{&lt;br /&gt;   Console.WriteLine(i);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;hr/&gt;&lt;br /&gt;The terminating condition can be a variable:&lt;br /&gt;&lt;hr/&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Console.WriteLine("How far do you want to count?");&lt;br /&gt;int number=int.Parse(Console.ReadLine());&lt;br /&gt;&lt;br /&gt;for(i=0;i&lt;=number;i++)&lt;br /&gt;{&lt;br /&gt;   Console.WriteLine(i);	&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;hr/&gt;&lt;br /&gt;&lt;h2&gt;While Loops&lt;/h2&gt;&lt;br /&gt;For loops are good when you have a specific number or repititions you want to do. While loops are good for when you have an indefinite number of repititions.&lt;br /&gt;Here is an example of a while loop:&lt;br /&gt;&lt;hr/&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;int grade=0;&lt;br /&gt;while(grade != 999)&lt;br /&gt;{&lt;br /&gt;    Console.WriteLine("Enter a grade. 999 to exit");&lt;br /&gt;    int grade = int.Parse(Console.Readline());&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;hr/&gt;&lt;br /&gt;&lt;h2&gt;Do loops&lt;/h2&gt;&lt;br /&gt;Do loops are like while loops, but the condition is at the end of the loop. This has a subtle effect. A while loop might never execute. If the condition is met before the loop is encountered--if, for instance, grade equaled 999, the program would never execute the while loop. A do loop, on the other hand, always executes at least once.&lt;br /&gt;&lt;br /&gt;Here is an example of a do loop:&lt;br /&gt;&lt;hr/&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;int grade=0;&lt;br /&gt;&lt;br /&gt;do&lt;br /&gt;{&lt;br /&gt;    Console.WriteLine("Enter a grade. 999 to exit");&lt;br /&gt;    int grade = int.Parse(Console.Readline());&lt;br /&gt;&lt;br /&gt;}while(grade != 999);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;hr/&gt;&lt;br /&gt;&lt;h2&gt;Infinite Loops&lt;/h2&gt;&lt;br /&gt;It is important that a loop have a termination point. If not you can create what is called an infinite loop. The only way out of an infinite loop is to stop the program.&lt;br /&gt;&lt;hr/&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;for(int i=0;i&gt;0;i++)&lt;br /&gt;{&lt;br /&gt;   Console.WriteLine(i);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;hr/&gt;&lt;br /&gt;&lt;h2&gt;Embedded loops, break keyword&lt;/h2&gt;&lt;br /&gt;It is important to note that you can nest loops and selection structures as you need. You can have loops inside of loops and ifs inside of ifs. We will see some examples of this in later examples and lectures.&lt;br /&gt;&lt;br /&gt;One additional Key words need mention: &lt;span style="color:Blue;"&gt;break&lt;/span&gt;. You can use break to exit from a loop before the terminal condition, Here is an example:&lt;br /&gt;&lt;hr/&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;for(int i=1;i&lt;1000;I++)&lt;br /&gt;{&lt;br /&gt;	Console.WriteLine("enter a name--'exit' to quit");&lt;br /&gt;        string name=Console.ReadLine();&lt;br /&gt;	if (name.Equals("exit") || name.Equals("Exit"))&lt;br /&gt;	{&lt;br /&gt;		break;&lt;br /&gt;	}&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-7924252075427974222?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/7924252075427974222/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2011/08/repetition-structures.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/7924252075427974222'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/7924252075427974222'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2011/08/repetition-structures.html' title='Repetition Structures'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-5758683870719573095</id><published>2011-08-17T11:33:00.000-07:00</published><updated>2011-08-17T12:09:57.994-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC110'/><title type='text'>Selection Statements</title><content type='html'>Programs often have to make choices about what to do with a value. If statements and switches are programming structures used to select what to do if a value falls into a certain range.&lt;br /&gt;&lt;br /&gt;&lt;h2 style="color:Navy:"&gt;If statements&lt;/h2&gt;&lt;br /&gt;An if consists of the if keyword and a condition in parenthesis. The condition must evaluate to true or false (a bool). If there is only one statement after the if you don't have to use curly braces {}, though I would encourage you to use them just to be in the habit. If there are multiple statements dependent on the condition you do have to use curly braces.&lt;br /&gt;&lt;br /&gt;Here is a method that shows an example of simple if statements&lt;br /&gt;&lt;br /&gt;&lt;hr/&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;        void SimpleIFStatement()&lt;br /&gt;        {&lt;br /&gt;            Console.WriteLine("Enter a number between 1 and 10");&lt;br /&gt;            int number = int.Parse(Console.ReadLine());&lt;br /&gt;&lt;br /&gt;           &lt;br /&gt;            if (number &amp;lt;1 )&lt;br /&gt;                 Console.WriteLine("the number is too small");&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;            if (number &gt; 10)&lt;br /&gt;                Console.WriteLine("The number is too Large");&lt;br /&gt;                &lt;br /&gt;        }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;hr/&gt;&lt;br /&gt;The next example shows the use of the "else" clause in an if statement. The else clause handles any value not covered by the main if statement.&lt;br /&gt;&lt;hr/&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;        void IfElseStatement()&lt;br /&gt;        {&lt;br /&gt;            Console.WriteLine("Enter your age");&lt;br /&gt;            int age = int.Parse(Console.ReadLine());&lt;br /&gt;&lt;br /&gt;            if (age &gt;= 18)&lt;br /&gt;            {&lt;br /&gt;                Console.WriteLine("You are old enough, Welcome");&lt;br /&gt;            }&lt;br /&gt;            else&lt;br /&gt;            {&lt;br /&gt;                //for anything less than 18&lt;br /&gt;                Console.WriteLine("Come back when your are older");&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;hr/&gt;&lt;br /&gt;If you need to test for multiple possible conditions you can use the if, else if, else structure. It is important to note that sequence matters. The program stops at the first true statement. In the following example if I put the lowest temperature first,  the program would always read "cool" for any temperature over 40, even if the temperature were 110. &lt;br /&gt;&lt;hr/&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;        void IFElseIFExample()&lt;br /&gt;        {&lt;br /&gt;            Console.WriteLine("Enter the day's  high Temperature");&lt;br /&gt;            int temp = int.Parse(Console.ReadLine());&lt;br /&gt;&lt;br /&gt;            if (temp &gt;= 90)&lt;br /&gt;            {&lt;br /&gt;                Console.WriteLine("Way too hot");&lt;br /&gt;            }&lt;br /&gt;                else &lt;br /&gt;                     if(temp &gt;= 80)&lt;br /&gt;                    {&lt;br /&gt;                        Console.WriteLine("A bit warm");&lt;br /&gt;                    }&lt;br /&gt;                else&lt;br /&gt;                    if (temp &gt;= 70)&lt;br /&gt;                    {&lt;br /&gt;                        Console.WriteLine("Just right");&lt;br /&gt;                    }&lt;br /&gt;                    else&lt;br /&gt;                        if (temp &gt;= 60)&lt;br /&gt;                        {&lt;br /&gt;                            Console.WriteLine("Pleasant");&lt;br /&gt;                        }&lt;br /&gt;                        else&lt;br /&gt;                            if (temp &gt;= 40)&lt;br /&gt;                            {&lt;br /&gt;                                Console.WriteLine("cool");&lt;br /&gt;                            }&lt;br /&gt;                            else&lt;br /&gt;                            {&lt;br /&gt;                                Console.WriteLine("Cold");&lt;br /&gt;                            }&lt;br /&gt;&lt;br /&gt;        }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;hr/&gt;&lt;br /&gt;Below is an if example used with the TryParse method. If you enter a bad value into the Parse method it crashes the program. With TryParse it doesn't. TryParse returns a boolean, True if the value actually parses into an int or double or whatever, false if it fails to parse. The try parse also requires an &lt;strong style="color:Blue;"&gt;out&lt;/strong&gt; parameter. If the values parses correctly it's value is assigned to the outside variable--in this case "number". &lt;br /&gt;You can test the boolean variable with an if statement to determine if the parse worked or not.&lt;br /&gt;&lt;hr/&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;void TryParseExample()&lt;br /&gt;        {&lt;br /&gt;            bool goodint;&lt;br /&gt;            int number;&lt;br /&gt;&lt;br /&gt;            Console.WriteLine("Enter an integer value");&lt;br /&gt;            goodint = int.TryParse(Console.ReadLine(), out number);&lt;br /&gt;&lt;br /&gt;            if (goodint == true)&lt;br /&gt;            {&lt;br /&gt;                Console.WriteLine("Your integer is {0}", number);&lt;br /&gt;            }&lt;br /&gt;            else&lt;br /&gt;            {&lt;br /&gt;                Console.WriteLine("Not an integer");&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;hr/&gt;&lt;br /&gt;Finally here is an example of if statements with multiple conditions using and (&amp;&amp;) and or (||) to combine them.&lt;br /&gt;In and conditions both sides of the statement must be true for the if to evaluate as true. For an or statement, if one or the other statement is true, then the whole statement is true.&lt;br /&gt;Here is the example:&lt;br /&gt;&lt;hr/&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt; void ANDORExamples()&lt;br /&gt;        {&lt;br /&gt;            Console.WriteLine("Enter a number between 1 and 10");&lt;br /&gt;            int number = int.Parse(Console.ReadLine());&lt;br /&gt;&lt;br /&gt;            //and example both must be true&lt;br /&gt;            if (number &gt; 1 &amp;&amp; number &lt; 10)&lt;br /&gt;            {&lt;br /&gt;                Console.WriteLine("Valid Entry");&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            //orExample&lt;br /&gt;            {&lt;br /&gt;                if (number &amp;lt; 1 || number &gt; 10)&lt;br /&gt;                {&lt;br /&gt;                    Console.WriteLine("Invalid Entry"); &lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Switch&lt;/h2&gt;&lt;br /&gt;Switch is another way to select based on a set of values, but unlike the if else if structure it only matches &lt;strong&gt;exact&lt;/strong&gt; values.&lt;br /&gt;&lt;hr/&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;        void SwitchExample()&lt;br /&gt;        {&lt;br /&gt;            Console.WriteLine("Enter a grade 1, 2, 3, or 4");&lt;br /&gt;            int grade = int.Parse(Console.ReadLine());&lt;br /&gt;&lt;br /&gt;            switch (grade)&lt;br /&gt;            {&lt;br /&gt;                case 1:&lt;br /&gt;                    Console.WriteLine("D");&lt;br /&gt;                    break;&lt;br /&gt;                case 2:&lt;br /&gt;                    Console.WriteLine("c");&lt;br /&gt;                    break;&lt;br /&gt;                case 3:&lt;br /&gt;                    Console.WriteLine("B");&lt;br /&gt;                    break;&lt;br /&gt;                case 4:&lt;br /&gt;                    Console.WriteLine("A");&lt;br /&gt;                    break;&lt;br /&gt;                default:&lt;br /&gt;                    Console.WriteLine("Not a valid grade");&lt;br /&gt;                    break;&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        &lt;br /&gt;&lt;br /&gt;       &lt;br /&gt;    &lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-5758683870719573095?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/5758683870719573095/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2011/08/selection-statements.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/5758683870719573095'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/5758683870719573095'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2011/08/selection-statements.html' title='Selection Statements'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-5895452898519374779</id><published>2011-08-16T14:31:00.000-07:00</published><updated>2011-08-16T14:34:04.468-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC226'/><title type='text'>Link to High Availability Presentation</title><content type='html'>Here is the link to the high Availability presentation"&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.seattlejungle.com/highavailability.htm"&gt;http://www.seattlejungle.com/highavailability.htm&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-5895452898519374779?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/5895452898519374779/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2011/08/link-to-high-availability-presentation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/5895452898519374779'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/5895452898519374779'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2011/08/link-to-high-availability-presentation.html' title='Link to High Availability Presentation'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-1692674036317181082</id><published>2011-08-16T10:04:00.001-07:00</published><updated>2011-08-16T10:53:12.395-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC224'/><title type='text'>CLR Procedure</title><content type='html'>Here is the SQL for the CLR procedure:&lt;br /&gt;&lt;hr/&gt;&lt;br /&gt;Select LocationName as [Location], &lt;br /&gt;Sum(Employee.func_PriceWithDiscount(AutoServiceID,DiscountPercent)) as Subtotal,&lt;br /&gt;Sum(Employee.GetTax(Employee.func_PriceWithDiscount(AutoServiceID,DiscountPercent),TaxPercent))&lt;br /&gt;as Tax, &lt;br /&gt;sum(Employee.func_PriceWithDiscount(AutoServiceID,DiscountPercent) +&lt;br /&gt;Employee.GetTax(Employee.func_PriceWithDiscount(AutoServiceID,DiscountPercent),TaxPercent))&lt;br /&gt;as Total&lt;br /&gt;From Employee.VehicleServiceDetail vsd&lt;br /&gt;inner Join Employee.VehicleService vs&lt;br /&gt;on vs.VehicleServiceID=vsd.VehicleServiceID&lt;br /&gt;inner Join Customer.Location l&lt;br /&gt;on l.LocationID=vs.LocationID&lt;br /&gt;Group by LocationName&lt;br /&gt;&lt;br /&gt;&lt;hr/&gt;&lt;br /&gt;Here is the CLR code with the SQL embedded:&lt;br /&gt;&lt;hr/&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Data;&lt;br /&gt;using System.Data.SqlClient;&lt;br /&gt;using System.Data.SqlTypes;&lt;br /&gt;using Microsoft.SqlServer.Server;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;public partial class StoredProcedures&lt;br /&gt;{&lt;br /&gt;    [Microsoft.SqlServer.Server.SqlProcedure]&lt;br /&gt;    public static void usp_LocationSales()&lt;br /&gt;    {&lt;br /&gt;        // Put your code here&lt;br /&gt;        using (SqlConnection connect = new SqlConnection("context connection=true"))&lt;br /&gt;        {&lt;br /&gt;            connect.Open();&lt;br /&gt;            SqlCommand cmd = connect.CreateCommand();&lt;br /&gt;            cmd.CommandText = "Select LocationName as [Location], "&lt;br /&gt;+ "Sum(Employee.func_PriceWithDiscount(AutoServiceID,DiscountPercent)) as Subtotal, "&lt;br /&gt;+ "Sum(Employee.GetTax(Employee.func_PriceWithDiscount(AutoServiceID,DiscountPercent),TaxPercent)) "&lt;br /&gt;+ " as Tax, "&lt;br /&gt;+ " sum(Employee.func_PriceWithDiscount(AutoServiceID,DiscountPercent) "&lt;br /&gt;+ "+ Employee.GetTax(Employee.func_PriceWithDiscount(AutoServiceID,DiscountPercent),TaxPercent)) "&lt;br /&gt;+ "as Total "&lt;br /&gt;+ "From Employee.VehicleServiceDetail vsd "&lt;br /&gt;+ "inner Join Employee.VehicleService vs "&lt;br /&gt;+ "on vs.VehicleServiceID=vsd.VehicleServiceID "&lt;br /&gt;+ "inner Join Customer.Location l "&lt;br /&gt;+ "on l.LocationID=vs.LocationID "&lt;br /&gt;+ "Group by LocationName ";&lt;br /&gt;&lt;br /&gt;            SqlContext.Pipe.ExecuteAndSend(cmd);&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;};&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1083017836179388179-1692674036317181082?l=congeritc.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/1692674036317181082/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2011/08/clr-procedure.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/1692674036317181082'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/1692674036317181082'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2011/08/clr-procedure.html' title='CLR Procedure'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_Mo-9s0FBmds/Szj7AsU_nDI/AAAAAAAAABQ/FqEImvw0oxs/S220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-576282404003865535</id><published>2011-08-15T10:50:00.000-07:00</published><updated>2011-08-15T10:55:23.951-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ITC115'/><title type='text'>Windows Form:Tip Calculator</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/-wV8A6Ax9A7Q/TklcujWSR_I/AAAAAAAAAQ0/xdpQ-rCFhkQ/s1600/CplusplusWindow.JPG"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 320px; height: 245px;" src="http://4.bp.blogspot.com/-wV8A6Ax9A7Q/TklcujWSR_I/AAAAAAAAAQ0/xdpQ-rCFhkQ/s320/CplusplusWindow.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5641141963090708466" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Here is all the auto generated code for the window:&lt;br /&gt;&lt;hr/&gt;&lt;br /&gt;#pragma once&lt;br /&gt;&lt;br /&gt;namespace TipCalculator {&lt;br /&gt;&lt;br /&gt;	using namespace System;&lt;br /&gt;	using namespace System::ComponentModel;&lt;br /&gt;	using namespace System::Collections;&lt;br /&gt;	using namespace System::Windows::Forms;&lt;br /&gt;	using namespace System::Data;&lt;br /&gt;	using namespace System::Drawing;&lt;br /&gt;&lt;br /&gt;	/// &lt;summary&gt;&lt;br /&gt;	/// Summary for Form1&lt;br /&gt;	/// &lt;/summary&gt;&lt;br /&gt;	public ref class Form1 : public System::Windows::Forms::Form&lt;br /&gt;	{&lt;br /&gt;	public:&lt;br /&gt;		Form1(void)&lt;br /&gt;		{&lt;br /&gt;			InitializeComponent();&lt;br /&gt;			//&lt;br /&gt;			//TODO: Add the constructor code here&lt;br /&gt;			//&lt;br /&gt;		}&lt;br /&gt;&lt;br /&gt;	protected:&lt;br /&gt;		/// &lt;summary&gt;&lt;br /&gt;		/// Clean up any resources being used.&lt;br /&gt;		/// &lt;/summary&gt;&lt;br /&gt;		~Form1()&lt;br /&gt;		{&lt;br /&gt;			if (components)&lt;br /&gt;			{&lt;br /&gt;				delete components;&lt;br /&gt;			}&lt;br /&gt;		}&lt;br /&gt;	private: System::Windows::Forms::Panel^  panel1;&lt;br /&gt;	protected: &lt;br /&gt;	private: System::Windows::Forms::RadioButton^  rdoTwentyPercent;&lt;br /&gt;	private: System::Windows::Forms::RadioButton^  rdoFifteenPercent;&lt;br /&gt;	private: System::Windows::Forms::RadioButton^  rdoTenPercent;&lt;br /&gt;	private: System::Windows::Forms::TextBox^  txtAmount;&lt;br /&gt;	private: System::Windows::Forms::Label^  label1;&lt;br /&gt;	private: System::Windows::Forms::Button^  button1;&lt;br /&gt;	private: System::Windows::Forms::Label^  label2;&lt;br /&gt;	private: System::Windows::Forms::Label^  label3;&lt;br /&gt;	private: System::Windows::Forms::Label^  label4;&lt;br /&gt;	private: System::Windows::Forms::Label^  lblTax;&lt;br /&gt;	private: System::Windows::Forms::Label^  lblTip;&lt;br /&gt;	private: System::Windows::Forms::Label^  lblTotal;&lt;br /&gt;&lt;br /&gt;	private:&lt;br /&gt;		/// &lt;summary&gt;&lt;br /&gt;		/// Required designer variable.&lt;br /&gt;		/// &lt;/summary&gt;&lt;br /&gt;		System::ComponentModel::Container ^components;&lt;br /&gt;&lt;br /&gt;#pragma region Windows Form Designer generated code&lt;br /&gt;		/// &lt;summary&gt;&lt;br /&gt;		/// Required method for Designer support - do not modify&lt;br /&gt;		/// the contents of this method with the code editor.&lt;br /&gt;		/// &lt;/summary&gt;&lt;br /&gt;		void InitializeComponent(void)&lt;br /&gt;		{&lt;br /&gt;			this-&gt;panel1 = (gcnew System::Windows::Forms::Panel());&lt;br /&gt;			this-&gt;rdoTenPercent = (gcnew System::Windows::Forms::RadioButton());&lt;br /&gt;			this-&gt;rdoFifteenPercent = (gcnew System::Windows::Forms::RadioButton());&lt;br /&gt;			this-&gt;rdoTwentyPercent = (gcnew System::Windows::Forms::RadioButton());&lt;br /&gt;			this-&gt;txtAmount = (gcnew System::Windows::Forms::TextBox());&lt;br /&gt;			this-&gt;label1 = (gcnew System::Windows::Forms::Label());&lt;br /&gt;			this-&gt;button1 = (gcnew System::Windows::Forms::Button());&lt;br /&gt;			this-&gt;label2 = (gcnew System::Windows::Forms::Label());&lt;br /&gt;			this-&gt;label3 = (gcnew System::Windows::Forms::Label());&lt;br /&gt;			this-&gt;label4 = (gcnew System::Windows::Forms::Label());&lt;br /&gt;			this-&gt;lblTax = (gcnew System::Windows::Forms::Label());&lt;br /&gt;			this-&gt;lblTip = (gcnew System::Windows::Forms::Label());&lt;br /&gt;			this-&gt;lblTotal = (gcnew System::Windows::Forms::Label());&lt;br /&gt;			this-&gt;panel1-&gt;SuspendLayout();&lt;br /&gt;			this-&gt;SuspendLayout();&lt;br /&gt;			// &lt;br /&gt;			// panel1&lt;br /&gt;			// &lt;br /&gt;			this-&gt;panel1-&gt;Controls-&gt;Add(this-&gt;rdoTwentyPercent);&lt;br /&gt;			this-&gt;panel1-&gt;Controls-&gt;Add(this-&gt;rdoFifteenPercent);&lt;br /&gt;			this-&gt;panel1-&gt;Controls-&gt;Add(this-&gt;rdoTenPercent);&lt;br /&gt;			this-&gt;panel1-&gt;Location = System::Drawing::Point(32, 56);&lt;br /&gt;			this-&gt;panel1-&gt;Name = L"panel1";&lt;br /&gt;			this-&gt;panel1-&gt;Size = System::Drawing::Size(280, 170);&lt;br /&gt;			this-&gt;panel1-&gt;TabIndex = 0;&lt;br /&gt;			// &lt;br /&gt;			// rdoTenPercent&lt;br /&gt;			// &lt;br /&gt;			this-&gt;rdoTenPercent-&gt;AutoSize = true;&lt;br /&gt;			this-&gt;rdoTenPercent-&gt;Location = System::Drawing::Point(58, 22);&lt;br /&gt;			this-&gt;rdoTenPercent-&gt;Name = L"rdoTenPercent";&lt;br /&gt;			this-&gt;rdoTenPercent-&gt;Size = System::Drawing::Size(77, 17);&lt;br /&gt;			this-&gt;rdoTenPercent-&gt;TabIndex = 0;&lt;br /&gt;			this-&gt;rdoTenPercent-&gt;TabStop = true;&lt;br /&gt;			this-&gt;rdoTenPercent-&gt;Text = L"10 Percent";&lt;br /&gt;			this-&gt;rdoTenPercent-&gt;UseVisualStyleBackColor = true;&lt;br /&gt;			// &lt;br /&gt;			// rdoFifteenPercent&lt;br /&gt;			// &lt;br /&gt;			this-&gt;rdoFifteenPercent-&gt;AutoSize = true;&lt;br /&gt;			this-&gt;rdoFifteenPercent-&gt;Location = System::Drawing::Point(58, 60);&lt;br /&gt;			this-&gt;rdoFifteenPercent-&gt;Name = L"rdoFifteenPercent";&lt;br /&gt;			this-&gt;rdoFifteenPercent-&gt;Size = System::Drawing::Size(77, 17);&lt;br /&gt;			this-&gt;rdoFifteenPercent-&gt;TabIndex = 1;&lt;br /&gt;			this-&gt;rdoFifteenPercent-&gt;TabStop = true;&lt;br /&gt;			this-&gt;rdoFifteenPercent-&gt;Text = L"15 Percent";&lt;br /&gt;			this-&gt;rdoFifteenPercent-&gt;UseVisualStyleBackColor = true;&lt;br /&gt;			// &lt;br /&gt;			// rdoTwentyPercent&lt;br /&gt;			// &lt;br /&gt;			this-&gt;rdoTwentyPercent-&gt;AutoSize = true;&lt;br /&gt;			this-&gt;rdoTwentyPercent-&gt;Location = System::Drawing::Point(58, 99);&lt;br /&gt;			this-&gt;rdoTwentyPercent-&gt;Name = L"rdoTwentyPercent";&lt;br /&gt;			this-&gt;rdoTwentyPercent-&gt;Size = System::Drawing::Size(96, 17);&lt;br /&gt;			this-&gt;rdoTwentyPercent-&gt;TabIndex = 2;&lt;br /&gt;			this-&gt;rdoTwentyPercent-&gt;TabStop = true;&lt;br /&gt;			this-&gt;rdoTwentyPercent-&gt;Text = L"twenty Percent";&lt;br /&gt;			this-&gt;rdoTwentyPercent-&gt;UseVisualStyleBackColor = true;&lt;br /&gt;			// &lt;br /&gt;			// txtAmount&lt;br /&gt;			// &lt;br /&gt;			this-&gt;txtAmount-&gt;Location = System::Drawing::Point(157, 257);&lt;br /&gt;			this-&gt;txtAmount-&gt;Name = L"txtAmount";&lt;br /&gt;			this-&gt;txtAmount-&gt;Size = System::Drawing::Size(100, 20);&lt;br /&gt;			this-&gt;txtAmount-&gt;TabIndex = 1;&lt;br /&gt;			// &lt;br /&gt;			// label1&lt;br /&gt;			// &lt;br /&gt;			this-&gt;label1-&gt;AutoSize = true;&lt;br /&gt;			this-&gt;label1-&gt;Location = System::Drawing::Point(32, 260);&lt;br /&gt;			this-&gt;label1-&gt;Name = L"label1";&lt;br /&gt;			this-&gt;label1-&gt;Size = System::Drawing::Size(126, 13);&lt;br /&gt;			this-&gt;label1-&gt;TabIndex = 2;&lt;br /&gt;			this-&gt;label1-&gt;Text = L"Enter Amount Before Tax";&lt;br /&gt;			// &lt;br /&gt;			// button1&lt;br /&gt;			// &lt;br /&gt;			this-&gt;button1-&gt;Location = System::Drawing::Point(35, 305);&lt;br /&gt;			this-&gt;button1-&gt;Name = L"button1";&lt;br /&gt;			this-&gt;button1-&gt;Size = System::Drawing::Size(75, 23);&lt;br /&gt;			this-&gt;button1-&gt;TabIndex = 3;&lt;br /&gt;			this-&gt;button1-&gt;Text = L"Calculate";&lt;br /&gt;			this-&gt;button1-&gt;UseVisualStyleBackColor = true;&lt;br /&gt;			this-&gt;button1-&gt;Click += gcnew System::EventHandler(this, &amp;Form1::button1_Click);&lt;br /&gt;			// &lt;br /&gt;			// label2&lt;br /&gt;			// &lt;br /&gt;			this-&gt;label2-&gt;AutoSize = true;&lt;br /&gt;			this-&gt;label2-&gt;Location = System::Drawing::Point(334, 263);&lt;br /&gt;			this-&gt;label2-&gt;Name = L"label2";&lt;br /&gt;			this-&gt;label2-&gt;Size = System::Drawing::Size(28, 13);&lt;br /&gt;			this-&gt;label2-&gt;TabIndex = 4;&lt;br /&gt;			this-&gt;label2-&gt;Text = L"Tax:";&lt;br /&gt;			// &lt;br /&gt;			// label3&lt;br /&gt;			// &lt;br /&gt;			this-&gt;label3-&gt;AutoSize = true;&lt;br /&gt;			this-&gt;label3-&gt;Location = System::Drawing::Point(337, 305);&lt;br /&gt;			this-&gt;label3-&gt;Name = L"label3";&lt;br /&gt;			this-&gt;label3-&gt;Size = System::Drawing::Size(25, 13);&lt;br /&gt;			this-&gt;label3-&gt;TabIndex = 5;&lt;br /&gt;			this-&gt;label3-&gt;Text = L"Tip:";&lt;br /&gt;			// &lt;br /&gt;			// label4&lt;br /&gt;			// &lt;br /&gt;			this-&gt;label4-&gt;AutoSize = true;&lt;br /&gt;			this-&gt;label4-&gt;Location = System::Drawing::Point(337, 338);&lt;br /&gt;			this-&gt;label4-&gt;Name = L"label4";&lt;br /&gt;			this-&gt;label4-&gt;Size = System::Drawing::Size(34, 13);&lt;br /&gt;			this-&gt;label4-&gt;TabIndex = 6;&lt;br /&gt;			this-&gt;label4-&gt;Text = L"Total:";&lt;br /&gt;			// &lt;br /&gt;			// lblTax&lt;br /&gt;			// &lt;br /&gt;			this-&gt;lblTax-&gt;AutoSize = true;&lt;br /&gt;			this-&gt;lblTax-&gt;Location = System::Drawing::Point(437, 263);&lt;br /&gt;			this-&gt;lblTax-&gt;Name = L"lblTax";&lt;br /&gt;			this-&gt;lblTax-&gt;Size = System::Drawing::Size(0, 13);&lt;br /&gt;			this-&gt;lblTax-&gt;TabIndex = 7;&lt;br /&gt;			// &lt;br /&gt;			// lblTip&lt;br /&gt;			// &lt;br /&gt;			this-&gt;lblTip-&gt;AutoSize = true;&lt;br /&gt;			this-&gt;lblTip-&gt;Location = System::Drawing::Point(440, 304);&lt;br /&gt;			this-&gt;lblTip-&gt;Name = L"lblTip";&lt;br /&gt;			this-&gt;lblTip-&gt;Size = System::Drawing::Size(0, 13);&lt;br /&gt;			this-&gt;lblTip-&gt;TabIndex = 8;&lt;br /&gt;			// &lt;br /&gt;			// lblTotal&lt;br /&gt;			// &lt;br /&gt;			this-&gt;lblTotal-&gt;AutoSize = true;&lt;br /&gt;			this-&gt;lblTotal-&gt;Location = System::Drawing::Point(440, 338);&lt;br /&gt;			this-&gt;lblTotal-&gt;Name = L"lblTotal";&lt;br /&gt;			this-&gt;lblTotal-&gt;Size = System::Drawing::Size(0, 13);&lt;br /&gt;			this-&gt;lblTotal-&gt;TabIndex = 9;&lt;br /&gt;			// &lt;br /&gt;			// Form1&lt;br /&gt;			
