This page contains an archived post to the Java Answers Forum made prior to February 25, 2002.
If you wish to participate in discussions, please visit the new
Artima Forums.
Message:
java
Posted by thembie on May 20, 2001 at 8:15 PM
Write a Java program for manipulating matrices of integers. Your program must prompt the user for a single-character transaction code or Ctrl-Z to quit. The transaction codes are: N (New matrix) L (print Last matrix) A (print All matrices in the matrix vector) S (print Sum of last two matrices) C (Clear the matrix vector) Ctrl-Z (quit) If the user enters "N" your program must read the row and column specification of the new matrix, then the rows of the matrix, and then enter the matrix into a matrix vector. If the user enters "L" your program must print the last matrix entered into the matrix vector. If the user enters "A" your program must print all the matrices in the matrix vector. If the user enters "S" your program must print the sum of the last two matrices in the matrix vector. If the vector contains less than two matrices your program should do nothing. If the user enters "C" your program must clear the matrix vector of all previously entered matrices.
Replies:
|