Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Closed Thread
Old 03-26-2009, 02:41 PM   #1 (permalink)
 
Newb Techie

Join Date: Mar 2009

Posts: 1

kett_jess is on a distinguished road

Default Student needs help

I need help write a program using Visual C# 2008 the requirements are listed below:

Two Dimensional Array Class:

Create a two-dimensional array class of characters called Array2d . Your Array2d should have functions that do the following:

initialize the contents of the array by setting all values to '.' (constructor)
return the value of any individual cell (char getValue(int, int); the parameters are the cell coordinates)
input a value into an individual cell ( void setValue(int, int, char); the parameters are the cell coordinates and the value to be input into the cell)
output the contents of each cell in the array in order (void display()
copies one 2-d array to another (void copy(Array2d)
reset all the values of the array to '.' (void reset().
Main Program:

Implement a simple program to demonstrate how your class works and do the following:

Declare two two-dimentional arrays
Create a menu that allows the user to do any of the following (you must use a case (switch) statement for this:
output the contents of the arrays - let the user decide which one
read in cell coordinates from the file that I will give you
read in cell coordinates from the keyboard
enter x and y cell coordinates and return the value in the cell.
enter x and y cell coordinates and enter a value to put in the cell
copy one array to the other


Other Specifications:

Create a Directory call ArrayADT to hold your files for this assignment
The class should be in a separate file called Array2d.cs.
The main program should be in a file called main.cs .
Dimensions such as the size of the array should be declared as constants
Put your name and a short description of the project or class at the top of each file.
Zip the whole project and turn in the zip file.
You may write a console application or a windows application



Can somebody please help?
kett_jess is offline  
Old 03-26-2009, 02:46 PM   #2 (permalink)
surgeVel's Avatar
 

Join Date: Feb 2008

Location: Fort Wayne, IN

Posts: 2,150

surgeVel will become famous soon enoughsurgeVel will become famous soon enough

Send a message via AIM to surgeVel
Default Re: Student needs help

Well, I know Java, not C# but in Java here is how you would copy the 2d arrays:

Code:
for (int i = 0; i < array1.length; i++){
   for(int j = 0; j < array1[i].length; i++){
        array2[i][j] = array1[i][j];//copies array value at location i,j to new array.
   }
}
You will need to use a similar process for printing out the array and resetting the array. Just a bunch of loops with a different main action.
__________________

If I was helpful, please click the icon on the left hand side of this message that looks like a check mark Thanks!

Sig courtesy of Baez =)
surgeVel is offline  
Old 03-26-2009, 04:35 PM   #3 (permalink)
 
Software Developer

Join Date: Mar 2006

Location: Columbus, OH

Posts: 569

jaeusm is on a distinguished road

Default Re: Student needs help

This looks like homework. If you have specific questions, post your code and we can help where applicable. However, you need to attempt to solve these problems yourself.
jaeusm is offline  
Old 03-26-2009, 04:43 PM   #4 (permalink)
surgeVel's Avatar
 

Join Date: Feb 2008

Location: Fort Wayne, IN

Posts: 2,150

surgeVel will become famous soon enoughsurgeVel will become famous soon enough

Send a message via AIM to surgeVel
Default Re: Student needs help

Quote:
Originally Posted by jaeusm View Post
This looks like homework. If you have specific questions, post your code and we can help where applicable. However, you need to attempt to solve these problems yourself.
Agreed. That's why I figured my code in Java would be enough to help him get the idea without giving away most of the methods
__________________

If I was helpful, please click the icon on the left hand side of this message that looks like a check mark Thanks!

Sig courtesy of Baez =)
surgeVel is offline  
Old 03-29-2009, 02:25 AM   #5 (permalink)
S0ULphIRE's Avatar
 
01001100011011110110110

Join Date: Mar 2007

Location: Perth, Australia

Posts: 1,940

S0ULphIRE has a spectacular aura aboutS0ULphIRE has a spectacular aura about

Send a message via MSN to S0ULphIRE
Default Re: Student needs help

here's an idea, post up whatever you've got so far, and I'll point out any bits I see are wrong along with some info on the basic principles you'll need to fix those bits.
THEN, with your new understanding, you'll be able to finish this program, AND you'll be able to pass when exam time rolls around because you'll have written the program yourself, and subsequently definitely know your stuff.
__________________
"As a result of all this hardship, dirt, thirst, and wombats, you would expect Australians to be a dour lot. Instead, they are genial, jolly, cheerful, and always willing to share a kind word with a stranger, unless they are an American."
-- Douglas Adams

Click this if I helped you
>>>><<<<
S0ULphIRE is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Google Grants Student Chrome Privileges Osiris Browser & General Internet Questions 0 12-15-2008 02:05 PM
how many times can you install (legit) student version vista? Ric0h Windows Operating Systems and Software 3 09-27-2008 02:54 PM
AutoCad @ student rate? CntdwnToExtn Windows Operating Systems and Software 2 04-12-2007 12:46 PM