Calculate the value of its secondary diagonal

Assignment Help JAVA Programming
Reference no: EM132430546

Given a square matrix m[3x3], create java code to calculate the value of its SECONDARY Diagonal. See example below.

Hint: In order to better understand the concepts involved in this exercises, research the terms "square matrix" and "secondary diagonal of a matrix" using your favourite search engine.

Example given matrix m[3x3] shown below:

(0,0) (0,1) (0,2)|10 12 11(1,0) (1,1) (1,2)|9 8 31(2,0) (2,1) (2,2)|2 16 24

Secondary Diagonal (generic m[3x3]) = m[0,2] + m[1,1] + m[2,0]

Secondary Diagonal (as in the example above) = 11 + 8 + 2 = 21

Note 1: Your java code MUST be GENERIC to calculate the secondary diagonal of ANY square matrix [2x2], [3x3],[4x4], etc. (Use a constant in your code to set the values of numberOfRows and numberOfColumns of your matrix.

Note 2: Your matrix m may be hardcoded (no need of user interaction)

Note 3: In case numberOfRows and numberOfColumns ar differents, your program must display the following message: "This is not a square matrix."

Reference no: EM132430546

Questions Cloud

What might use writing skills beyond academia in real life : What other ways might you use writing skills beyond academia in "real life?
Prepare the necessary journal entries if the wages paid : The payroll of Marigold Company for September 2016 is as follows. Prepare the necessary journal entries if the wages and salaries paid
What was the reaction clifton strengthsfinder report : How are you using one or more of your Signature Themes in your daily life? What steps could be taken to ensure you have an opportunity to apply your natural
Question on dynamic array : Describe any feedback you received or any specific interactions you had. Discuss how they were helpful
Calculate the value of its secondary diagonal : Given a square matrix m[3x3], create java code to calculate the value of its SECONDARY Diagonal. See example below.
Interface for controlling access to general class of actions : The approach which lies beneath this concept is "single interface with multiple implementations." It offers a single interface for controlling access
Code of Ethics of the National Association of Social Workers : Code of Ethics of the National Association of Social Workers Assignment help and solutions:-explain how it relates to career goals
Implement a static void method called multiplicationtable : Implement a static void method called multiplicationTable which accepts a positive integer n and print the multiplication table starting at 1 up to and includin
What is abstract data type : What is Abstract Data Type(ADT) Actually? If the Stack just allow a data entered is integer type, is that stack considered ADT? Or is the stack only considered

Reviews

Write a Review

JAVA Programming Questions & Answers

  How about using a break in a switch statement

CS219 - How about using a break in a switch statement, show how you can really have a problem if you skip the break statement in a switch

  Write a program that prompts the user to input an integer

Write a program that prompts the user to input an integer and then outputs both the individual digits of the number and the sum of the digits.

  Develop a data type for the time of day

Time. Develop a data type for the time of day. Provide client methods that return the current hour, minute, and second, as well as to String() and compare To() methods. Develop two implementations: one that keeps the time as a single int value (nu..

  Draw a UML diagram for class and then implement the class

For this assignment, you will create an Account class, UML diagram for the class and then implement the class by writing a test program

  Java class to accept a user-s hourly rate of pay

Write a class that accepts a user's hourly rate of pay and the number of hours worked. Display the user's gross pay, the withholding tax (15% of gross pay), and the net pay (gross pay - withholding).

  Write a driver program teststackumuc

Write a driver program TestStackUMUC, implemented as a separate class, to test the class StackUMUC . Test the class for the JDK types Double and String and for the user defined type Point.

  Create an applet that uses two integer

Create an Applet that uses two integer (int) variables x and y to place the picture of four circles on the screen. Alternate the colors by setting the g.setColor method. Also, use the g.drawString to place your name above the circles

  How many critical paths should there be in your pert chart

List the nodes [in the order of traversal] in the critical path[s] that you have identified in question 6 [above] and documented in your PERT chart.

  Create pseudocode that describes necessary flow of program

Create pseudocode that describes the necessary flow of your program with respect to both creating a user account and placing an order.

  Understand the principal of remote method invocation

Understand the principal of Remote Method Invocation (RMI) - Understand the benefits and shortcomings of RMI relative to other technologies learned

  Template files contain the message text

Template files contain the message text, together with variable fields(such as Dear [Title] [Last Name ] ...). A database (stored as a text file) contains the field values for each recipient. Use HTML as the output file format. Then design and implem..

  Writing a program that evaluates infix expressions

CMSC 350 - writing a program that evaluates infix expressions of unsigned integers using two stacks. The program should consist of three classes

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd