1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
lianna [129]
1 year ago
14

Q4 a.

Engineering
1 answer:
dedylja [7]1 year ago
7 0

The Java program that accepts a matrix of M × N order and then interchanges diagonals of the matrix is given below:

<h3>Steps:  </h3>
  • 1. We can only interchange diagonals for a square matrix.
  • 2. Therefore, we would have to create a square matrix of size [M × M].
  • 3. We would check whether the matrix is a square matrix or not. If the matrix is square then follow step 3 else terminate the program.
  • 4. Apply logic for interchange diagonal of the matrix some logic is given below.

<h3>Java Code</h3>

//  Java Program to Accept a Matrix of Order M x N &

//  Interchange the Diagonals

import java.util.Scanner;

public class InterchangeDiagonals {

   public static void main(String[] args)

   {

       // declare variable

       int m, n, i, j, temp;

       // create a object of scanner class

       Scanner sc = new Scanner(System.in);

       System.out.print("Enter number of rows ");

       // take number of rows

       m = sc.nextInt();

       System.out.print("Enter number of columns ");

       // take number of columns

       n = sc.nextInt();

       // declare a mxn order array

       int a[][] = new int[m][n];

       // if block it's execute when m is equals to n

       if (m == n) {

           System.out.println(

               "Enter all the values of matrix ");

           // take the matrix inputs

           for (i = 0; i < m; i++) {

               for (j = 0; j < n; j++) {

                   a[i][j] = sc.nextInt();

               }

           }

           System.out.println("original Matrix:");

           // print the original matrix

           for (i = 0; i < m; i++) {

               for (j = 0; j < n; j++) {

                   System.out.print(a[i][j] + " ");

               }

               System.out.println("");

           }

          // perform interchange

           for (j = 0; j < m; j++) {

               temp = a[j][j];

               a[j][j] = a[j][n - 1 - j];

               a[j][n - 1 - j] = temp;

           }

           System.out.println(

               " after interchanging diagonals of matrix ");

           // print interchanged matrix

           for (i = 0; i < m; i++) {

               for (j = 0; j < n; j++) {

                   System.out.print(a[i][j] + " ");

               }

               System.out.println("");

           }

       }

       // else block it's only execute when m is not equals

       // to n

       else {

           System.out.println("Rows not equal to columns");

       }

   }

}

Read more about java programming here:

brainly.com/question/18554491

#SPJ1

You might be interested in
What are the main subsystem of GSM<br> network​
Paraphin [41]

Explanation:

Network and Switching Subsystem (NSS)

Base-Station Subsystem (BSS)

Mobile station (MS)

Operation and Support Subsystem (OSS)

6 0
3 years ago
Select the properties and typical applications for the high carbon steels.
yanalaym [24]

Answer:

<u>Option-(A)</u>

Explanation:

<u>Typical applications for the high carbon steels includes the following;</u>

It is heat treatable, relatively large combinations of mechanical characteristics. Typical applications: railway wheels and tracks, gears, crankshafts, and machine parts.

3 0
3 years ago
What is the purpose of this block?
just olya [345]

The  purpose of a block to add a value to the end of an array.

<h3>What is the function that adds an element to the end of an array?</h3>

The push() is known to be often used to add an element to the end of your array.

The end() function is known to be one that transmit the internal pointer to, and also the outputs, the last factor in the array.

A null or zero value is known to be that which marks the end of an array and it is said to be the very equivalent of the null char for any kind of string

Hence, in the above scenario, The  purpose of a block to add a value to the end of an array.

Therefore, option D is correct.

Learn more about  array from

brainly.com/question/24275089

#SPJ1

3 0
2 years ago
In a wheatstone bridge three out of four resistors have of 1K ohm each ,and the fourth resistor equals 1010 ohm. If the battery
Dima020 [189]

Answer:

  248.756 mV

  49.7265 µA

Explanation:

The Thevenin equivalent source at one terminal of the bridge is ...

  voltage: (100 V)(1000/(1000 +1000) = 50 V

  impedance: 1000 || 1000 = (1000)(1000)/(1000 +1000) = 500 Ω

The Thevenin equivalent source at the other terminal of the bridge is ...

  voltage = (100 V)(1010/(1000 +1010) = 100(101/201) ≈ 50 50/201 V

  impedance: 1000 || 1010 = (1000)(1010)/(1000 +1010) = 502 98/201 Ω

__

The open-circuit voltage is the difference between these terminal voltages:

  (50 50/201) -(50) = 50/201 V ≈ 0.248756 V . . . . open-circuit voltage

__

The current that would flow is given by the open-circuit voltage divided by the sum of the source resistance and the load resistance:

  (50/201 V)/(500 +502 98/201 +4000) = 1/20110 A ≈ 49.7265 µA

8 0
3 years ago
Describe the importance of ferrite and austenite stabilizing elements in steels
podryga [215]

Answer:

The importance of ferrite and austenite stabilizing elements in steels .

Explanation:

Alloying -

The process which improves the properties of the steel by changing the chemical composition of the steel via adding some elements .

The properties can be improved by - Stabilizing Austenite and Stabilizing Ferrite .

Stabilizing austenite -

The process by which temperature is increased , in which Austenite exists .

Elements with the same crystal structure as of the austenite ( FCC ) raises its A4 value i.e. the temperature of the formation of austenite from its liquid phase and reduces the value of A3 .

Hence, the elements are -

Cobalt , Nickel , Manganese , Copper.

The examples of the Austenitic steels are -

Hadfield Steel ( 13% Mn , 1.2% Cr , 1% C ) and Austenitic Stainless steel.

Stabilizing ferrite –

The process by which temperature is decreased , in which austenite exists .

Elements with the same crystal structure as of the ferrite (BCC - Cubic body centered ) lowers its A4 value i.e. the temperature of the formation of austenite from its liquid phase and increases the value of A3 .These elements have lower solubility of carbon in austenite, that lead to increase in the amount of carbides in the steel.

Hence, the elements are -  

Aluminium , Silicon , Tungsten , Chromium , Molybdenum , Vanadium

The examples of the Ferritic steels are -

F-Cr alloys , transformer sheets steel ( 3% Si ).

3 0
4 years ago
Other questions:
  • The motor draws in the cord at B with an acceleration of aB = 2 m/s2 . When sA = 1.5 m , vB = 6.2 m/s .
    9·1 answer
  • Steam at 150 bars and 600°C passes through process equipment and emerges at 100 bars and 700°C. There is no flow of work into or
    8·1 answer
  • Rubber bands provided the thrust to get your rocket going. Why did the rocket keep moving after it left the launch pad and the r
    5·1 answer
  • Consider two identical 86-kg men who are eating identical meals and doing identical things except that one of them jogs for 30 m
    10·1 answer
  • Thread cancellation is : Group of answer choices c) the task of terminating a thread before it has completed a) the task of dest
    7·1 answer
  • You are tasked to specify the flash storage device in General Electric's Data Logger Unit used in the smart power grid. The DLU
    12·1 answer
  • For an automotive spark-ignition engine, the combustion duration (from time of ignition through completion) is approximately one
    11·1 answer
  • A six-lane freeway (three lanes in each direction) in rolling terrain has 10-ft lanes and obstructions 5 ft from the right edge.
    9·1 answer
  • Can space debris take out a whole state
    9·1 answer
  • Pls help :( I am a radio &amp; audio production student, what are two examples of a complex wave.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!