Click here to Skip to main content
15,912,324 members
Home / Discussions / C#
   

C#

 
AnswerRe: What is the way to check for empty arraylist? Pin
Christian Wikander10-Apr-08 22:52
Christian Wikander10-Apr-08 22:52 
GeneralRe: What is the way to check for empty arraylist? Pin
Giorgi Dalakishvili10-Apr-08 22:55
mentorGiorgi Dalakishvili10-Apr-08 22:55 
GeneralMDI Parent and Child Problem Pin
D i x y10-Apr-08 18:39
D i x y10-Apr-08 18:39 
GeneralRe: MDI Parent and Child Problem Pin
Christian Wikander10-Apr-08 22:43
Christian Wikander10-Apr-08 22:43 
GeneralHelp Pin
alextheman10-Apr-08 17:56
alextheman10-Apr-08 17:56 
GeneralRe: Help Pin
Christian Graus10-Apr-08 18:21
protectorChristian Graus10-Apr-08 18:21 
GeneralRe: Help Pin
Abhijit Jana10-Apr-08 18:22
professionalAbhijit Jana10-Apr-08 18:22 
GeneralIs still confuse what i should fill in Increase, Decrease and unref procedure Pin
alextheman10-Apr-08 19:40
alextheman10-Apr-08 19:40 
sorry, I newbie in programming, I still confuse about this code

if(strs[0]=="q")
break;
else if(strs[0]=="print")
PrintSortedData();
else if(strs[0]=="inc")
Increase(strs[1]);
else if(strs[0]=="dec")
Decrease(strs[1]);
else if(strs[0] == "swap")
Swap(strs[1], strs[2]);
else if (strs[0] == "ref")
Ref(strs[1], strs[2]);
else if (strs[0] == "unref")
UnRef(strs[1]);

I have already make some changes in the coding, like below :
I confuse what i should fill in Increase, Decrease and unref procedure

Thx

using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;

namespace ApplicantTestin
{
/// The DataObject class stored with a key
class DataObject
{
// Populate
}

class Program
{
static Hashtable Data = new Hashtable();
static string[] StaticData = new string[] { "X-Ray","Echo","Alpha", "Yankee","Bravo", "Charlie",
"Delta", "Hotel", "India", "Juliet", "Foxtrot","Sierra",
"Mike","Kilo", "Lima", "November", "Oscar", "Papa", "Qubec",
"Romeo", "Tango","Golf", "Uniform", "Victor", "Whisky",
"Zulu"};

static void Main(string[] args)
{
for(int i=0;i<staticdata.length; i++)<br="" mode="hold"> Data.Add(StaticData[i].ToLower(), new DataObject(StaticData[i]) );
while(true)
{
PrintSortedData();
Console.WriteLine();
Console.Write("> ");
string str = Console.ReadLine();
string[] strs = str.Split(' ');

if(strs[0]=="q")
break;
else if(strs[0]=="print")
PrintSortedData();
else if(strs[0]=="inc")
Increase(strs[1]);
else if(strs[0]=="dec")
Decrease(strs[1]);
else if(strs[0] == "swap")
Swap(ref strs[1], ref strs[2]);
else if (strs[0] == "ref")
Ref(ref strs[1], ref strs[2]);
else if (strs[0] == "unref")
UnRef(strs[1]);
}
}

///
/// Create a reference from one data object to another.
///

/// <param name="key1" />The object to create the reference on
/// <param name="key2" />The reference object
static void Ref(ref string key1, ref string key2)
{
string key3;
key3 = key1;
key1 = key2;
key2 = key3;
}

///
/// Removes an object reference on the object specified.
///

/// <param name="key" />The object to remove the reference from
static void UnRef(string key)
{
// Populate
}

///
/// Swap the data objects stored in the keys specified
///

static void Swap(ref string key1, ref string key2)
{
string key3;
key3 = key1;
key1 = key2;
key2 = key3;

}

///
/// Decrease the Value field by 1 of the
/// data object stored with the key specified
///

static void Decrease(string key)
{
// Populate
}

///
/// Increase the Value field by 1 of the
/// data object stored with the key specified
///

static void Increase(string key)
{
// Populate
}


///
/// Prints the information in the Data hashtable to the console.
/// Output should be sorted by key
/// References should be printed between '<' and '>'
/// The output should look like the following :
///
///
/// Alpha...... -3
/// Bravo...... 2
/// Charlie.... <zulu>
/// Delta...... 1
/// Echo....... <alpha>
/// --etc---
///
///

static void PrintSortedData()
{
Console.WriteLine();
}
}
}
GeneralRe: Is still confuse what i should fill in Increase, Decrease and unref procedure Pin
Christian Graus10-Apr-08 19:46
protectorChristian Graus10-Apr-08 19:46 
GeneralRe: Is still confuse what i should fill in Increase, Decrease and unref procedure Pin
Ashfield10-Apr-08 21:30
Ashfield10-Apr-08 21:30 
Generaltravel to assembly Pin
sujithkumarsl10-Apr-08 17:53
sujithkumarsl10-Apr-08 17:53 
GeneralRe: travel to assembly Pin
N a v a n e e t h10-Apr-08 18:15
N a v a n e e t h10-Apr-08 18:15 
GeneralRe: travel to assembly Pin
sujithkumarsl10-Apr-08 18:43
sujithkumarsl10-Apr-08 18:43 
GeneralRe: travel to assembly Pin
Christian Wikander10-Apr-08 22:48
Christian Wikander10-Apr-08 22:48 
GeneralRe: travel to assembly Pin
Brady Kelly10-Apr-08 22:35
Brady Kelly10-Apr-08 22:35 
Generalcompute hash value for a string Pin
George_George10-Apr-08 15:23
George_George10-Apr-08 15:23 
GeneralRe: compute hash value for a string Pin
Christian Graus10-Apr-08 17:28
protectorChristian Graus10-Apr-08 17:28 
GeneralRe: compute hash value for a string Pin
George_George10-Apr-08 19:04
George_George10-Apr-08 19:04 
GeneralRe: compute hash value for a string Pin
Christian Graus10-Apr-08 19:43
protectorChristian Graus10-Apr-08 19:43 
GeneralRe: compute hash value for a string Pin
George_George10-Apr-08 20:00
George_George10-Apr-08 20:00 
GeneralRe: compute hash value for a string Pin
N a v a n e e t h10-Apr-08 17:49
N a v a n e e t h10-Apr-08 17:49 
GeneralRe: compute hash value for a string Pin
George_George10-Apr-08 19:06
George_George10-Apr-08 19:06 
GeneralRe: compute hash value for a string Pin
Mark Churchill10-Apr-08 19:47
Mark Churchill10-Apr-08 19:47 
GeneralRe: compute hash value for a string Pin
George_George10-Apr-08 19:55
George_George10-Apr-08 19:55 
GeneralRe: compute hash value for a string Pin
Mark Churchill10-Apr-08 20:28
Mark Churchill10-Apr-08 20:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.