Click to See Complete Forum and Search --> : Help Required


rob316
April 1st, 2005, 12:32 PM
I need someone to write the code for the following program:

http://www.wrestlefury.com/prog.jpg

I've created the interface but the code is what i cant do. Any help would be much appreciated.

cilu
April 1st, 2005, 03:22 PM
First, you did not actually explain what the problem is. Do you need a program that parses a string to check how many words of a certain length are there?

How much will you pay?


using System;
using System.Text.RegularExpressions;
using System.Text;
using System.Collections;

namespace ParserNamespace
{
class Class1
{
public int[] ParseString(String text)
{
int [] vector = new int[6];
Regex reg = new Regex(" |, | ,|,");

StringBuilder sbuilder = new StringBuilder();

foreach(string s in reg.Split(text))
{
if(s.Length<6) vector[s.Length-1]++;
else vector[vector.Length-1]++;
}

return vector;
}

[STAThread]
static void Main(string[] args)
{
Class1 test = new Class1();
int [] results = test.ParseString("this is just a simple text,nothing more, nothing less");

int i=1;
foreach(int val in results)
{
Console.WriteLine("Words of length {0} : {1}",i++,val);
}
}
}
}

rob316
April 1st, 2005, 03:31 PM
How much do you cost?

rob316
April 1st, 2005, 03:37 PM
The program should calculate and display the number of words that contain 1, 2, 3, 4 or 5 characters as shown in the example. Any words that contain 6 or more characters should be counted together.

If the user does not enter a string before pressing the button, an error message should be displayed and the user asked to enter another string.

The program should be able to handle situations where there is more than one space between the words in the sentence. Punctuation characters such as comma, full-stop, etc can be treated as characters in words.

cilu
April 1st, 2005, 04:12 PM
Are you familiar to C# or not? What I've written basically does want you need, except that is a console application. I'm sorry, but I'm not going to write the entire application for you.

Andy Tacker
April 4th, 2005, 01:57 AM
Rob316, you can offer someone to write code for you in JOBS Forum. (http://www.codeguru.com/forum/forumdisplay.php?f=33)

rob316
April 6th, 2005, 05:32 AM
Your code doesnt work