Are there step by step how to tutorials available for absolute beginne

Where can I find a tutorials on how to declare constants and variables

Page 1 of 1

2 Replies - 1017 Views - Last Post: 26 October 2009 - 03:42 PM Rate Topic: -----

#1 stephenw77  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 25-October 09

Are there step by step how to tutorials available for absolute beginne

Posted 25 October 2009 - 06:47 PM

Hi my name is Steve,

I am a 40+ student trying to reinvent myself and I'm presently taking a C# class at the local Junior College (were on class #8) and I am interested in finding video tutorials (if possible - written format OK too) on how to create C# projects using primarily Windows forms, just a step or 2 beyond the "Hello World" universally distributed project #1.

Most of what I've been able to find jumps from "hello world" into "Arrays and Polymorphism".

I've found MSDN to be rather verbose and all inclusive, and for me hard to wade through.

I logged my first hours in the Windows xp environment 2-3 years ago and have completed several courses (say 10 or 12 since then). From Word, Access and Excel to Acrobat, In Design, and Photoshop. I am pursuing a GIS certificate and have about 3 semesters of Arcmap.

This programming class has me baffled and I've spent hours upon hours staring at my books and mssing around in the IDE, I'm stuck on page #130 trying to make sense of If/Else statements.

To give you an idea of my greatest achievement in C# (which I wrote with lots of help) I will post the code for a fictitious company Xtreme Video, with simple order-calculate functions. As you will see I am way up at the beginning. I barely know how to declare variables and constants (But I am a pretty hard worker and have a bit of patience)...

ALL HELP and SUGGESTIONS WELCOME!

(Code as follows - via C# Express 2008)
______________________________________________________________________________________
/*
 * Project:	  Assignment #4-1
 * Programmer:   Stephen 
 * Date:		 28Sept2009
 * Description:  This project was created to enable clerks to process
 *				customers at Xtreme Cinema video store.
 */

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

namespace Stephen_White_Assignment4_1
{
	public partial class XtremeCinemaForm : Form
	{


		
			//Initialize Constants
			const decimal   DVD_COST = 4.50m,
							BLURAY_COST = 5.00m,
							NEW_RELEASE = 1.00m, 
							MEMBER_DISCOUNT = 0.10m;

			
			//Initialize variables
			decimal ItemCost,
					OrderTotal,
					SummaryReceipts;
			int OrderVideosRented,
					SummaryVideosRented,
					SummaryCustomers;
					

			string Summary, SummaryVideosRentedFormatted, SummaryCustomersFormatted, 
				   SummaryReceiptsFormatted;
				   

			DialogResult UserConfirmationDialogResult;

		public XtremeCinemaForm()
		{   
			InitializeComponent();

			//Initialize state state and variables
			ClearAllUserInput();
			HideOrderLabels();
			ItemCost = 0m;
			OrderTotal = 0m;
			OrderVideosRented = 0;
			SummaryReceipts = 0m;
			SummaryVideosRented = 0;
			SummaryCustomers = 0;
			cbxMember.Enabled = true;
			tbxVideoTitle.Focus();
		}

		private void cbxMember_CheckedChanged(object sender, EventArgs e)
		{
			CalculateItem();
			DisplayScreenValues();
			

		}

		private void btnRadioDVD_CheckedChanged(object sender, EventArgs e)
		{
			CalculateItem();
			DisplayScreenValues();
			

		}

		private void radioButtonBlueRay_CheckedChanged(object sender, EventArgs e)
		{
			CalculateItem();
			DisplayScreenValues();
			

		}

		private void cbxNewRelease_CheckedChanged(object sender, EventArgs e)
		{
			CalculateItem();
			DisplayScreenValues();
			

		}

		private void btnClearforNextItem_Click(object sender, EventArgs e)
		{
			ClearAllUserInput();
		}

		private void btnCalculateAccept_Click(object sender, EventArgs e)
		{
		if (radBtnDVD.Checked == false && radBtnBluRay.Checked == false)
				MessageBox.Show
					("Please select either DVD or Blu-ray format", "Input Error");
			else
			{
				cbxMember.Enabled = false;
				CalculateItem();
				OrderVideosRented++;
				OrderTotal = OrderTotal + ItemCost;
				ClearAllUserInput();
				DisplayScreenValues();
				ItemCost = 0m;
			}

		}

		private void btnOrderComplete_Click(object sender, EventArgs e)
		{
			if (tbxVideoTitle.Text != "")
			{
				MessageBox.Show("You must Calculate/Accept or Clear Item" + "\n" +
								"  before selecting Complete Order");
			}
			else
			{
				UserConfirmationDialogResult = MessageBox.Show
					("Finish current order?", "Accept order", MessageBoxButtons.YesNo,
									  MessageBoxIcon.Question);
				if (UserConfirmationDialogResult == DialogResult.Yes)
				{
					SummaryCustomers++;
					SummaryReceipts = SummaryReceipts + OrderTotal;
					OrderTotal = 0m;
					SummaryVideosRented = SummaryVideosRented + OrderVideosRented;
					OrderVideosRented = 0;
					cbxMember.Enabled = true;
					ClearAllUserInput();
					DisplayScreenValues();
				}

		}

	   

						   
		}

		private void btnSummary_Click(object sender, EventArgs e)
		{
			SummaryReceiptsFormatted = SummaryReceipts.ToString("C");
			SummaryCustomersFormatted = SummaryCustomers.ToString("D");
			SummaryVideosRentedFormatted = SummaryVideosRented.ToString("D");
			Summary = "Total Receipts:	" + SummaryReceiptsFormatted + "\n\n" +
						 "Total Customers:   " + SummaryCustomersFormatted + "\n\n" +
						 "Total Videos:		 " + SummaryVideosRentedFormatted;
			MessageBox.Show(Summary, "Sales summary");

		}

		private void btnExit_Click(object sender, EventArgs e)
		{
			// Exit the Video Category Location screen
			this.Close();

		}

		private void HideOrderLabels()
		{
			// Clear order display
			lblItemCost.Text = "";
			lblOrderTotal.Text = "";
			lblVideosRented.Text = "";

		}
		private void ClearAllUserInput()
		{
			// Set all radio buttons and check boxes to unselected state
			tbxVideoTitle.Text = "";
			radBtnDVD.Checked = false;
			radBtnBluRay.Checked = false;
			cbxNewRelease.Checked = false;
		}

		private void CalculateItem()
		{
			//  Calculate item cost and display in item cost box on form
			if (radBtnDVD.Checked == true)
			{
				ItemCost = DVD_COST;
			}
			else
			{
				if (radBtnBluRay.Checked == true)
				{
					ItemCost = BLURAY_COST;
				}
				else
				{
					ItemCost = 0m;
				}
			}
			if (cbxNewRelease.Checked == true)
									ItemCost = ItemCost + NEW_RELEASE;
			if (cbxMember.Checked == true)
									ItemCost = ItemCost * (1.0m - MEMBER_DISCOUNT);
			DisplayScreenValues();
		}

		private void DisplayScreenValues()
		{
			lblItemCost.Text = ItemCost.ToString("C");
			lblOrderTotal.Text = OrderTotal.ToString("C");
			lblVideosRented.Text = OrderVideosRented.ToString("D");
		}

	}
}


*** MOD EDIT: Added code tags. Please :code: ***

This post has been edited by JackOfAllTrades: 25 October 2009 - 09:02 PM


Is This A Good Question/Topic? 0
  • +

Replies To: Are there step by step how to tutorials available for absolute beginne

#2 BlackPhoenix  Icon User is offline

  • D.I.C Head

Reputation: 5
  • View blog
  • Posts: 152
  • Joined: 11-July 09

Re: Are there step by step how to tutorials available for absolute beginne

Posted 25 October 2009 - 08:28 PM

http://www.freewebs....a/tutorials.htm
Was This Post Helpful? 0
  • +
  • -

#3 stephenw77  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 25-October 09

Re: Are there step by step how to tutorials available for absolute beginne

Posted 26 October 2009 - 03:42 PM

Thankyou for the prompt response...pretty good stuff, the first three or four links had some good info, no doubt.

I may try and create the simplest of games for a final project for my course if I survive the next couple weeks.

I still find myself lost after the second "beginner's tutorial". I can comprehend the concepts, but to apply them to

a project as a whole - that appears to be a different matter. I do best with repetition of the basics, lots of it, lots and

lots of it. I can't seem to get the whole picture of how and where (I know a tiny bit about scope) to declare constants

and variables, even though I have read the rules and naming conventions many times. Any advice on where to get

lots of examples of such rudimentary procedures???

Thanks again for the reply.

S


View PostBlackPhoenix, on 25 Oct, 2009 - 07:28 PM, said:


Was This Post Helpful? 0
  • +
  • -

Page 1 of 1