• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Matrix

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi guys, im very new to this post on forum if you need help with java so i try to explain myself as good as possible and state my problem but bar with me if im out and flying.

what i need to do is to build a matrix, and after that use 3 methods, 1 method that will display some fields in the matrix not all of them, here i dont know how you print them out or even get a method to display them, i think i know how to build a matrix but if you have any cool idea here it wouldnt hurt ,

well after that i need a method that writes out the same fields in the matrix as the first but it should stand null instead of the letter.

the third method should display the same field as the first one but should be doing it in the order backwards.

what i wonder is, how do you make a method, that displays these matrix fields, thx
 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Pilare,

The way you phrased your email it sounds like you were given a homework assignment and you are asking people to solve it for you.

If that's the case, then it's not appropriate. Alternately, you might ask for help with understanding a concept. Perhaps you are wondering how to define a class to represent a matrix? Or maybe you are more concerned with how to format output? Besides being vague, there are quite a number of concepts in your question (at least as I understand it) so you might try to break down the concepts and determine which you understand and which you are having trouble with.

Tony
 
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It will definitely help if you can post some of the code you have so far. Or at least explain what you are thinking of doing. The more you show that you are putting some effort into this yourself, the more likely someone here will help you when you get stuck.

Good luck!

Layne
 
Pilare Bowblade
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
youre right it is a homework, and as for what our teacher said, you wouldnt be albe to do this by yourself, you have to use to internet to be able to finish this assingment, so here i am, what better place that a big forum where everybody help each other, what better place can you get the info for youre java assingments, sure i can look around at diffrent pages for the code but i dont think that will help me as i have tried it for soon 3 weeks..

well anyway, for those who wanna help me

Public class Matrix {

public static void main(string[] args) {

String[] Array1 { "A", "B", "C" };
String[] Array2 { "D", "E", "F" };
String[] Array3 { "G", "H", "J" };



this is just what i began with, i need printMatrix, eraseMatrix and reverseArray. i dont know how to connect these arrays with the method so its kind of what i need help with. if i say something wrong, correction is very welcome
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your matrix probably should be this

String[][] array {{"A","B","C" },{"D","E","F" },{"G","H","J"}};

to print it, use a nested 'for loop'

for erase and reverse, use the internet for a bit of research, this site and
google are two good places to search.

If you're still having trouble:
- post what you've tried, and any relevant error messages
- if no error messages, expected output Vs actual output
reply
    Bookmark Topic Watch Topic
  • New Topic