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
aleksley [76]
3 years ago
11

Given two 2x3 (2 rows, 3 columns) arrays of integer , x1 and x2, both already initialized , two integer variables , i and j, and

a boolean variable x1rules. write the code that is necessary for x1rules to be true if and only if every element in x1 is bigger than its corresponding element in x2 and is false otherwise
Computers and Technology
1 answer:
Gnesinka [82]3 years ago
7 0
JAVA programming was employed...

What we have so far:
* Two 2x3 (2 rows and 3 columns) arrays. x1[i][j] (first 2x3 array) and x2[i][j] (second 2x3 array) .
* Let i = row and j = coulumn.
* A boolean vaiable, x1rules

Solution:

for(int i=0; i<2; i++)
{
   for(int j=0; j<3; j++)
   {
      x1[i][j] = num.nextInt();
   }
}// End of Array 1, x1.

for(int i=0; i<2; i++)
{
   for(int j=0; j<3; j++)
   {
      x2[i][j] = num.nextInt();
   }
}//End of Array 2, x2
This should check if all the elements in x1 is greater than x2:

x1rules = false;
if(x1[0][0]>x2[0][0] && x1[0][1]>x2[0][1] && x1[0][2]>x2[0][2] && x1[1][0]>x2[1][0] && x1[1][1]>x2[1][1] && x1[1][2]>x2[1][2])
{
   x1rules = true;
   system.out.print(x1rules);
}
else
{
   system.out.print(x1rules);
}//Conditional Statement
You might be interested in
What is a cookie? *
creativ13 [48]

Answer:

stores the password of the user

8 0
3 years ago
Read 2 more answers
How do I connect my CSS file and HTML page together? it's just not wanting to work for me. 
kiruha [24]
In the <head> part of your HTML, you reference the CSS like this:

<link<span> rel="stylesheet" type="text/css" href="thecss.css"</span><span>>
</span>
If it is still not working, there could be many kinds of mistakes. Take it one step at a time and start simple, or share your HTML and CSS so we can have a look.
4 0
3 years ago
What is ‘validation’?
jeka94

Talking about models, validation is the process by the model is corroborated and its outputs are compared with experimental results. From validation, it can be seen how quantitative and qualitative accurate the model is, and it can be confirmed model fidelity to the real world.

3 0
3 years ago
Using the employment websites, search for part-time jobs that relate to the career fields you are interested in pursuing or to y
arsen [322]

In order to start a part time job first we have to do some research in particular criteria they are Research your degree and occupational information and industry information.

Explanation:

There are many part- time jobs, they are web developer, sales representative, interpreter and translator and content writer.

There are various websites for this kind of jobs. For example in Quicker, Monster and indeed .com are some of the websites.

The we developer job is creating website for the customer based on the requirements. Example school management, library management.

Then comes data entry job it is a simple job that is to enter the captcha and correcting errors in files and copy pasting job.

Content writer is a job in which the different types of questions are answered for the U.S based companies.

7 0
3 years ago
Read 2 more answers
1. Create an array of ints with 20 elements. With a random number generator, seeded with time, assign a random number between 1
nikdorinn [45]

Answer:

#include <iostream>

#include<time.h>

using namespace std;

void sort(int a[20],int n)   //selection sort

{

   int i,j,temp;

   for(i=0;i<n;i++)        

   {

       for(j=i+1;j<n;j++)  //finds minimum element

       {

           if(a[i]>a[j])     //swaps minimum element to its right place

           {

               temp=a[i];

               a[i]=a[j];

               a[j]=temp;

           }

       }

   }

}

int main()

{

   srand(time(NULL));

   int arr[20],n=20,i;

   for(i=0;i<n;i++)

       arr[i]=rand() % 100 + 1;    //assigns random number to each array element

   cout<<"Before sorting\n";

   for(i=0;i<n;i++)

       cout<<arr[i]<<" ";   //prints array before calling sort func

   sort(arr,20);     //sort the passed array

   cout<<"\nAfter sorting\n";

   for(i=0;i<n;i++)

       cout<<arr[i]<<" ";  //prints array after sorting

   return 0;

}

OUTPUT :

Please find the attachment below.

Explanation:

The program above first assigns random number from 1 to 100 to each element of array using rand(). srand(time(NULL)) is used to generate new number every time otherwise same random number will be produced at a time. Then sorting method is called in which selection sort algorithm is used.

Selection sort algorithm finds the minimum element in each pass and place it into its right position. For example - 34,54,12,5 is passed

After Pass 1 - 5  54  12  34

After Pass 2 - 5  12  54  34

After Pass 3 -  5  12  34  54

5 0
3 years ago
Other questions:
  • Which three phrases describe a wireframe
    12·1 answer
  • What are the 21St century competencies or skills required in the information society?<br>​
    15·1 answer
  • Tim has an old server computer that his company uses as a backup. One of the hard drives has gone bad and needs to be replaced.
    13·1 answer
  • Print a countdown from n to 1 The function below takes one parameter: an integer (begin). Complete the function so that it print
    8·1 answer
  • rray testGrades contains NUM_VALS test scores. Write a for loop that sets sumExtra to the total extra credit received. Full cred
    5·1 answer
  • Lol who look at this so funny
    6·1 answer
  • You can count on everything online to be 100% accurate. <br> A. FALSE <br> B. TRUE
    11·2 answers
  • Write a program to read a list of exam scores given as integer percentages in the range 0-100. Display the total number of grade
    10·1 answer
  • Alexi is writing a program which prompts users to enter their age. Which function should she use?
    6·2 answers
  • What is closeable interface in java.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!