• Post Reply Bookmark Topic Watch Topic
  • New Topic

Program checking if a matrix is a upper or lower triangular matrix based on user input  RSS feed

 
Nix Tacs
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need help on a java program that will determine if the matrix is a lower or upper triangular matrix. I only need to use java.util.Scanner;. Please help.
 
Richard Tookey
Bartender
Posts: 1166
17
Java Linux Netbeans IDE
 
Nix Tacs
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need a source code by tomorrow. Please someone help me.
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Then you had better get cracking, hadn't you

What do you have so far, and where are you stuck making progress?
 
Nix Tacs
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Here's what I can do. I dont know where to start making user input and what condition to check if its a upper or lower matrix. This code is just for upper.
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can learn a lot about input at http://www.coderanch.com/how-to/java/UserInput.
 
Vasilis Souvatzis
Ranch Hand
Posts: 94
1
Chrome Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you need the user input for? Anyway, I looked up what a triangular matrix is and it's pretty straightforward. Check the conditions for when it's an upper or lower triangular matrix. And then check how i and j are related to each other to fill those conditions.
 
fred rosenberger
lowercase baba
Bartender
Posts: 12563
49
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It sounds counter-intuitive, but you need to Stop Coding. Read that page. Then read it again. Follow its advice. you should not write a single line of code until you know what you need to do.
 
Richard Tookey
Bartender
Posts: 1166
17
Java Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nix Tacs wrote:I need help on a java program that will determine if the matrix is a lower or upper triangular matrix. I only need to use java.util.Scanner;. Please help.


When I read this I figured that the only thing you were missing was the use of the Scanner so I pointed you at the Scanner tutorial. I still read it that way but the code you just posted indicates that you pretty much have nothing. Nobody is going to give you code for the complete assignment so there is no point in just waiting for it to magically appear.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!