<?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-17718658</id><updated>2011-04-21T15:18:49.475-07:00</updated><title type='text'>Snowy Mountains</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://snowy-mountains.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17718658/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://snowy-mountains.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Golden</name><uri>http://www.blogger.com/profile/02128743714912774333</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>3</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-17718658.post-113166215476569308</id><published>2005-11-10T14:26:00.000-08:00</published><updated>2005-11-10T14:50:27.150-08:00</updated><title type='text'></title><content type='html'>Visual C# 2005 is used to build a simple consol application "Stack Component". The application takes advantage of component-oriented features such as properties, indexers, and XML comments.&lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Text;&lt;br /&gt;namespace StackComponent&lt;br /&gt;{&lt;br /&gt;class Stack&lt;br /&gt;{&lt;br /&gt;const int SizeIncrement = 10;&lt;br /&gt;private int count = 0;&lt;br /&gt;private object[] values = new object[SizeIncrement];&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// the number of elements in the stack&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;/// &lt;param name="args"&gt;&lt;/param&gt;&lt;br /&gt;public virtual int Count&lt;br /&gt;{&lt;br /&gt;get&lt;br /&gt;{&lt;br /&gt;return count;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Remove the top element from the stack and return it&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;/// &lt;returns&gt;The top element&lt;/returns&gt;&lt;br /&gt;/// &lt;param name="args"&gt;&lt;/param&gt;&lt;br /&gt;public virtual object Pop()&lt;br /&gt;{&lt;br /&gt;// Stack is empty&lt;br /&gt;if (count == 0)&lt;br /&gt;throw new InvalidOperationException();&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;// return top of stack&lt;br /&gt;count--;&lt;br /&gt;object ans = values[count];&lt;br /&gt;values[count] = null;&lt;br /&gt;return ans;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Push element into the stack&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;/// &lt;param name="obj"&gt;The object to add&lt;/param&gt;&lt;br /&gt;public virtual void Push(object obj)&lt;br /&gt;{&lt;br /&gt;// expand the stack if required&lt;br /&gt;if (count == values.Length)&lt;br /&gt;{&lt;br /&gt;int newSize = values.Length + SizeIncrement;&lt;br /&gt;object[] newValues = new object[newSize];&lt;br /&gt;for (int i = 0; i &lt; values =" newValues;"&gt;&lt;br /&gt;/// indexer to peek into the current contents of the stack&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;/// &lt;param name="args"&gt;&lt;/param&gt;&lt;br /&gt;public object this[int index]&lt;br /&gt;{&lt;br /&gt;get&lt;br /&gt;{&lt;br /&gt;return (values[count - index - 1]);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Produce a string representation of the stack&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;/// &lt;returns&gt;The string representation&lt;/returns&gt;&lt;br /&gt;/// &lt;param name="args"&gt;&lt;/param&gt;&lt;br /&gt;public override string ToString()&lt;br /&gt;{&lt;br /&gt;//throw new Exception("The method or operation is not implemented.");&lt;br /&gt;// Convert all stack items to strings&lt;br /&gt;string[] args = new string[count];&lt;br /&gt;int index = 0;&lt;br /&gt;for (int i = count - 1; i &gt;= 0; i--)&lt;br /&gt;{&lt;br /&gt;args[index] = values[i].ToString();&lt;br /&gt;index++;&lt;br /&gt;}&lt;br /&gt;// and join them together&lt;br /&gt;return String.Join(", ", args);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;class Test&lt;br /&gt;{&lt;br /&gt;public static void Main(string[] args)&lt;br /&gt;{&lt;br /&gt;Stack s = new Stack();&lt;br /&gt;for (int i = 1; i &lt;= 15; i++) { s.Push(i); } Console.WriteLine("Stack s = {0}", s); Console.WriteLine("Stack s[0] = {0}", s[0]); Console.WriteLine("Stack s[5] = {0}", s[5]); while (s.Count &gt; 0)&lt;br /&gt;Console.WriteLine("Popped {0}", s.Pop());&lt;br /&gt;Console.WriteLine("Stack s = {0}", s);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;/*** Output&lt;br /&gt;Stack s = 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1&lt;br /&gt;Stack s[0] = 15&lt;br /&gt;Stack s[5] = 10&lt;br /&gt;Popped 15&lt;br /&gt;Popped 14&lt;br /&gt;Popped 13&lt;br /&gt;Popped 12&lt;br /&gt;Popped 11&lt;br /&gt;Popped 10&lt;br /&gt;Popped 9&lt;br /&gt;Popped 8&lt;br /&gt;Popped 7&lt;br /&gt;Popped 6&lt;br /&gt;Popped 5&lt;br /&gt;Popped 4&lt;br /&gt;Popped 3&lt;br /&gt;Popped 2&lt;br /&gt;Popped 1&lt;br /&gt;Stack s =&lt;br /&gt;Press any key to continue . . .&lt;br /&gt;***/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17718658-113166215476569308?l=snowy-mountains.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://snowy-mountains.blogspot.com/feeds/113166215476569308/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17718658&amp;postID=113166215476569308' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17718658/posts/default/113166215476569308'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17718658/posts/default/113166215476569308'/><link rel='alternate' type='text/html' href='http://snowy-mountains.blogspot.com/2005/11/visual-c-2005-is-used-to-build-simple.html' title=''/><author><name>Golden</name><uri>http://www.blogger.com/profile/02128743714912774333</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17718658.post-113143940757511537</id><published>2005-11-07T23:45:00.000-08:00</published><updated>2005-11-08T00:43:27.586-08:00</updated><title type='text'></title><content type='html'>&lt;strong&gt;Visual C# 2005&lt;/strong&gt; is used to create a sample&lt;em&gt;&lt;strong&gt; consol application&lt;/strong&gt;&lt;/em&gt; "Hello World C#"&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Text;&lt;br /&gt;namespace Hello_World&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.Write("Hell World C#!\r\nPlease enter your name:");&lt;br /&gt;string name = Console.ReadLine();&lt;br /&gt;Console.Write("Hello {0}, please enter the year you were born: ", name);&lt;br /&gt;int year = int.MaxValue;&lt;br /&gt;while(year == int.MaxValue)&lt;br /&gt;{&lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;year = int.Parse(Console.ReadLine());&lt;br /&gt;}&lt;br /&gt;catch (FormatException)&lt;br /&gt;{&lt;br /&gt;Console.Write("You did not enter a valid number. ");&lt;br /&gt;Console.WriteLine("Please enter an integer, such as 1940.");&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;Console.WriteLine("You must be approximately {0} years old!",&lt;br /&gt;DateTime.Now.Year - year);&lt;br /&gt;Console.WriteLine("Press the &lt;enter&gt; key to exit the application");&lt;br /&gt;Console.Read();&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;/*&lt;br /&gt;Hell World C#!&lt;br /&gt;Please enter your name:Visual C# 2005&lt;br /&gt;Hello Visual C# 2005, please enter the year you were born: That's private!&lt;br /&gt;You did not enter a valid number. Please enter an integer, such as 2003.&lt;br /&gt;2003&lt;br /&gt;You must be approximately 2 years old!&lt;br /&gt;Press the &lt;enter&gt; key to exit the application&lt;br /&gt;Press any key to continue . . .&lt;br /&gt;*/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17718658-113143940757511537?l=snowy-mountains.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://snowy-mountains.blogspot.com/feeds/113143940757511537/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17718658&amp;postID=113143940757511537' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17718658/posts/default/113143940757511537'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17718658/posts/default/113143940757511537'/><link rel='alternate' type='text/html' href='http://snowy-mountains.blogspot.com/2005/11/visual-c-2005-is-used-to-create-sample.html' title=''/><author><name>Golden</name><uri>http://www.blogger.com/profile/02128743714912774333</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17718658.post-112903296140313497</id><published>2005-10-11T04:33:00.000-07:00</published><updated>2005-10-11T05:16:01.406-07:00</updated><title type='text'></title><content type='html'>&lt;span style="font-family:arial;"&gt;September to November is season of spring here and therefore &lt;strong&gt;the best time to visit Australia&lt;/strong&gt;. Under blue sky, flowers blossom and Kangaroos hop around the lavish green grass paddy field. Unfortunately most of people visit here in the wrong season and suffer from the local harsh climate.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17718658-112903296140313497?l=snowy-mountains.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://snowy-mountains.blogspot.com/feeds/112903296140313497/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17718658&amp;postID=112903296140313497' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17718658/posts/default/112903296140313497'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17718658/posts/default/112903296140313497'/><link rel='alternate' type='text/html' href='http://snowy-mountains.blogspot.com/2005/10/september-to-november-is-season-of.html' title=''/><author><name>Golden</name><uri>http://www.blogger.com/profile/02128743714912774333</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry></feed>
