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
Bezzdna [24]
3 years ago
12

Given decimal variables named length and width that contain the dimensions of a rectangle, write a statement that calculates the

rectangle’s area and saves the result in a new integer variable named area. (Be sure to cast the result from decimal to integer.)
Computers and Technology
1 answer:
kirill [66]3 years ago
3 0

Answer:

The code to this question can be defined as follows:

<u>Code:</u>

int area = (int) (length * width); //defining integer variable area that holds calculated value.

Explanation:

In the given question it is defined, that two decimal variable "length and width" is defined that holds some decimal value in it, and this question asks to define an integer that holds it calculated value, which can be described as follows:

  • In the above code section, an integer variable "area" is defined, which calculates the decimal variable "length and width" multiplication.
  • Inside the area variable, the typecasting is used that converts the decimal value to integer value.  
You might be interested in
You used a website to learn about the child-rearing practices in China. Your study is related most to which aspect
ozzi

Answer:

c. culture

Explanation:

I think your study is related to their culture

5 0
2 years ago
Read 2 more answers
State the keyboard key used to move the cursor to the line​
irina [24]

Answer:

Home & End are used to move the cursor to the start and end of a line

4 0
3 years ago
What symbol is used for an assignment statement in a flowchart?
Annette [7]

Answer:

processing

Explanation:

The flow chart is a diagram that shows the activity of the program, peoples or things.

Flowchart symbol and meaning in the options:

1. Processing: it is a rectangular shape block which is used for variable declaration or assignment.

2. I/0: it is a parallelogram in shape which is used for input or output.

3. Parallelogram: it is used for input or output.

4. diamond: it is used for decisions or conditions.

Therefore, the correct option is a. Processing is the one that is used for the assignment statement.

3 0
3 years ago
Jim has entered the age of each of his classmates in cells A1 through A65 of a spreadsheet.
alexandr402 [8]
The answer to this is B=MODE(A1:A65)
8 0
3 years ago
Write a method transpose, that takes as argument a 2D array of integers, myTable, and returns the transpose of myTable. The tran
Gelneren [198K]

Answer:

The program to this question can be given as:

Program:

import java.util.*; //import package

public class Main //defining class

{

public static int[][] transpose(int[][] a1) //defining function transpose

{

int i,j; //define variables

int[][] transpose = new int[a1[0].length][a1.length]; //define variable transpose.

//loop for transpose matrix.

for(i = 0; i < a1.length; i++)  

{

for(j = 0; j < a1[i].length; j++)

{

transpose [j][i] = a1[i][j]; //hold value in transpose variable

}

}

return transpose ; //return transpose matrix.  

}

public static void main(String[] args) //main method.

{

int row,col,i,j; //defining variable.

Scanner obj = new Scanner(System.in); //creating Scanner class Object

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

row = obj.nextInt(); //input rows form user.

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

col = obj.nextInt(); //input columns form user.

int[][] a1 = new int[row][col]; //defining array.

System.out.println("Enter matrix"); //message

// loop for input array elements from user

for(i=0; i<a1.length;i++)  

{

for(j=0; j<a1[i].length;j++)  

{

a1[i][j]=obj.nextInt(); //input in array variable.

}

}

System.out.println("Matrix you insert :"); //message

// loop for display array.

for(i=0; i<a1.length;i++)  

{

for(j=0; j<a1[i].length;j++)  

{

System.out.print(a1[i][j]+" "); //print matrix

}

System.out.print("\n");

}

int[][] result = transpose(a1); //define result array variable that holds function value.

System.out.println("Transposed matrix is :");

//use loop for print Transpose matrix.

for(i = 0;i < result.length;i++)

{

for (j = 0; j < result[i].length;j++)

{

System.out.print(result[i][j] + " "); //print matrix

}

System.out.print("\n");

}

}

}

Output:

Enter number of rows: 2

Enter number of columns: 3

Enter matrix

2

3

4

9

8

7

Matrix you insert :

2 3 4  

9 8 7  

Transposed matrix is :

2 9  

3 8  

4 7  

Explanation:

The description of the above program can be given as:

  • In the above program firstly import a package, then declare a class that is "Main" inside a class defining a transpose() function this function returns a matrix in transpose form.
  • In the main class, we define a variable and matrix that is "row, col, i, j and a1[][]".  Then we Creating a scanner class object, which is used by row, col and a1[][] variables for user input.  
  • The row and col variables are used to declare matrix size and i, j variable is used in the loop for insert and display matrix.  
  • a1[][] matrix is used for input matrix elements and passes into transpose() function as an argument that returns a value that is held in the result variable. This is used as a loop for the print transpose matrix.

5 0
3 years ago
Other questions:
  • Consider this data sequence: "fish bird reptile reptile bird bird bird mammal fish". let's define a singleton to be a data eleme
    5·1 answer
  • Develop a program that will calculate the area and perimeter of a rectangle. The length and width can be given as constant.(LENG
    8·1 answer
  • In computer logic what is order of instructions
    13·1 answer
  • What is a characteristic of maintaining logs in a system? A. Logging prevents security violations, but only deals with passive m
    10·1 answer
  • In computer science how can you define "copyright, designs and patents act 1988"?​
    8·1 answer
  • Write a program, called compute_stats.c, which opens a data file, called numbers.txt, which contains of a list of positive integ
    10·1 answer
  • What does it mean to prioritize tasks?
    12·2 answers
  • Match the parts of the website address with its correct explanation. http://www.usa.gov/Agencies/federal.shtm/​
    5·2 answers
  • A man inside water, the pressure which acts on him is
    13·1 answer
  • Sharon's company has written a new computer program, and she has been asked to find a way to prevent people from copying the sof
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!