Wrox Programmer Forums
|
BOOK: Professional C# 2008 ISBN: 978-0-470-19137-8
This is the forum to discuss the Wrox book Professional C# 2008 by Christian Nagel, Bill Evjen, Jay Glynn, Morgan Skinner, Karli Watson; ISBN: 9780470191378
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional C# 2008 ISBN: 978-0-470-19137-8 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 6th, 2010, 08:43 PM
Authorized User
 
Join Date: Aug 2010
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Cade_Feng
Default Can't compile it pass

I'm a novice. Write a very simple C# code. I can't complie it pass. Hope someone help me!
Thansk in advance.
Code:
using System;
namespace Wrox.JackFeng{
	class Order{
		public Order(){}
		
		public void OrderNumber(int[] iArray){
			foreach(int val in iArray){
				Console.Write(val+'\t');
			}
		}
	}
}

using Wrox.JackFeng
namespace Wrox.CadeFeng
{
	class Program{
		static void Main(){
			const string sSuggestion="Please input some Number form(0-100)!";
			const int zero=0;
			string sNum = string.Empty;
			int[] iArray ;
			int i=zero;
			bool condition = false;
			
			Console.WriteLine(sSuggestion);
			while(!condition){
				sNum = Console.ReadLine();
				iArray[i] = Convert.ToInt32(sNum);
					i++;
				if(Convert.ToInt32(sNum)==0)
					break;
			}	
			
			Order Order_ = new Order();
			Order_.OrderNumber(iArray);
		}
	}
}
__________________
Wana be a .net developer.
Sincere yours
Cade_Feng
 
Old August 7th, 2010, 01:11 PM
Authorized User
 
Join Date: Aug 2010
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Cade_Feng
Thumbs up

I have solve it. Share with Member.
Code:
using System;
using OrderMethod = Wrox.JackFeng;
namespace Wrox.CadeFeng
{
	class Program{
		static void Main(){
			const string sSuggestion="Please input five Number form(0-100)!";
			const int zero=0;
			string sNum = string.Empty;
			int i=zero,index_=zero,n=5;
			bool condition = false;
			int[] iArray = new int[n];
			
			Console.WriteLine(sSuggestion);
			while(!condition){
				sNum = Console.ReadLine();
				iArray[i] = Convert.ToInt32(sNum);
					i++;
					index_+=1;
				if(Convert.ToInt32(sNum)==zero)
					break;
			}	

			OrderMethod::Order NSEx = new OrderMethod::Order();			
			int[] iArray_1=NSEx.OrderNumber(iArray);
				
			foreach(var temp in iArray_1)
				Console.WriteLine("{0}\t",temp);
		}
	}
}

namespace Wrox.JackFeng{
	class Order{
		public int[] OrderNumber(int[] iArray){
			
			for(int index=0;index<iArray.Length-1;index++){
				for(int index_1=index;index_1<iArray.Length;index_1++){
					if(iArray[index]<iArray[index_1]){
						int temp = iArray[index];
						iArray[index]=iArray[index_1];
						iArray[index_1]=temp;
					}
				}
			}
			return iArray;
		}
	}
}
__________________
Wana be a .net developer.
Sincere yours
Cade_Feng





Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't compile it pass Cade_Feng BOOK: Beginning Microsoft Visual C# 2008 ISBN: 978-0-470-19135-4 1 August 18th, 2010 06:44 AM
Pass value to second page (create & pass var) ismailc ASP.NET 2.0 Basics 8 April 24th, 2010 07:03 AM
compile aspb ASP.NET 2.0 Professional 1 September 12th, 2006 10:22 AM
compile aspb ASP.NET 2.0 Basics 0 September 8th, 2006 10:27 AM
C# compile biran Visual Studio 2005 1 July 15th, 2005 01:36 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.