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
Nuetrik [128]
2 years ago
14

Write a static method named contains that accepts two arrays of integers a1 and a2 as

Computers and Technology
1 answer:
pashok25 [27]2 years ago
5 0

Answer:

Sew explaination foe code

Explanation:

import java.lang.*;

import java.util.*;

import java.io.*;

class Main

{

public static Boolean checkSubset(int[] list1, int[] list2)

{

int l = list2.length;

for(int i = 0; i<list1.length-l; i++)

{

Boolean flag = true;

for(int j = 0; j<list2.length; j++)

{

if(list1[i+j] != list2[j])

{

flag = false;

break;

}

}

if(flag) return true;

}

return false;

}

public static void main(String args[])

{

int[] l1 = {1,6,2,1,4,1,2,1,8};

int[] l2 = {1,2,2};

System.out.println(checkSubset(l1,l2));

}

}

You might be interested in
Lindsey also needs to calcite the commissions earned each month. If the company earns $200,000 or more in a month, the commissio
IrinaK [193]

Answer:

srry dont know

Explanation:

8 0
2 years ago
You listened to a song on your computer. did you use hardware or software? explain.
scZoUnD [109]
Software, unless you planned on permanently downloading the Music Album or Song to your computer's Hard Drive. i.e, you would use whatever Music or Media player you have installed on your computer, and that simply counts as Software. 
4 0
3 years ago
Difference between switch case and if else statement.​
ser-zykov [4K]

Answer:

<h3><em>SWITCH</em><em> </em><em>CASE</em><em>:</em></h3>

<em>☆</em><em> </em><em>STATEMENT</em><em> </em><em>WILL</em><em> </em><em>BE</em><em> </em><em>EXECUTED</em><em> </em><em>IS</em><em> </em><em>DECIDED</em><em> </em><em>BY</em><em> </em><em>USER</em><em>. </em>

<em>☆</em><em> </em><em>SWITCH</em><em> </em><em>STATEMENT</em><em> </em><em>EVALUATES</em><em> </em><em>ONLY</em><em> </em><em>CHARACTER</em><em> </em><em>《</em><em>OR</em><em> </em><em>》</em><em>INTEGER</em><em> </em><em>VALUE</em><em>. </em>

<em>☆</em><em> </em><em>IT</em><em> </em><em>USING</em><em> </em><em>SINGLE</em><em> </em><em>EXPRESSION</em><em> </em><em>FOR</em><em> </em><em>MULTIPLE</em><em> </em><em>CHOICES</em><em>. </em>

<h3><em>IF</em><em> </em><em>-</em><em> </em><em>ELSE</em><em> </em><em>STATEMENT</em><em>. </em></h3>

<em>☆</em><em> </em><em>STATEMENT</em><em> </em><em>WILL</em><em> </em><em>BE</em><em> </em><em>EXECUTED</em><em> </em><em>DEPEND</em><em> </em><em>UPON</em><em> </em><em>THE</em><em> </em><em>OUTPUT</em><em> </em><em>OF</em><em> </em><em>THE</em><em> </em><em>EXPRESSION</em><em> </em><em>INSIDE</em><em>. </em>

<em>☆</em><em> </em><em>IF</em><em> </em><em>THE</em><em> </em><em>STATEMENT</em><em> </em><em>EVALUATES</em><em> </em><em>INTEGER</em><em>, </em><em>CHARACTER</em><em>, </em><em>POINTER</em><em>《</em><em> </em><em>OR</em><em> </em><em>》</em><em>FLOATING-</em><em> </em><em>POINT</em><em> </em><em>TYPE</em><em> </em><em>《</em><em> </em><em>OR</em><em> </em><em>》</em><em>BOOLEAN</em><em> </em><em>TYPE</em><em>. </em>

<em>☆</em><em> </em><em>IF</em><em> </em><em>USING</em><em> </em><em>MULTIPLE</em><em> </em><em>STATEMENT</em><em> </em><em>FOR</em><em> </em><em>MULTIPLE</em><em> </em><em>CHOICES</em><em>. </em>

<em>HOPE</em><em> </em><em>IT</em><em> </em><em>HELP</em><em>.</em><em>.</em><em>.</em><em>.</em><em /><em /><em />

7 0
2 years ago
To define an additional field in Datasheet view, tap or click the ____ column heading.
Ksenya-84 [330]
The correct answer for the question that is being presented above is this one: "D) click to add." To define an additional field in Datasheet view, tap or click the<span> click to add </span>column heading.
Here are the following choice:
A) insert field
B) blank field
C) new field
D) click to add
3 0
3 years ago
Output each floating-point value with two digits after the decimal point, which can be achieved as follows:
sdas [7]

Answer:

The modified program in Python is as follows:

import math

paint_colors = {'red': 35,'blue': 25,'green': 23}

wall_height = int(input('Enter wall height (feet):\n'))

wall_width = int(input('Enter wall width (feet):\n'))

area = wall_height*wall_width

print('Wall area:',area,'square feet')

paint_needed = area/350.0

print('Paint needed: {:.2f} gallons'.format(paint_needed))

print('Cans needed:',round(paint_needed),'can(s)')

color = input("Choose a color to paint the wall: ")

print("Cost of purchasing", color, "paint: $",paint_colors[color])

Explanation:

The italicized are given from the question [unchanged]

<em>import math</em>

<em> paint_colors = {'red': 35,'blue': 25,'green': 23} </em>

<em>wall_height = int(input('Enter wall height (feet):\n')) </em>

This gets input for width

wall_width = int(input('Enter wall width (feet):\n'))

Calculate the wall area

area = wall_height*wall_width

Print the calculated wall area

print('Wall area:',area,'square feet')

Calculate the amount of paint needed

paint_needed = area/350.0

Print the amount of paint needed to 2 decimal places

print('Paint needed: {:.2f} gallons'.format(paint_needed))

Print the amount of can needed to nearest integer

print('Cans needed:',round(paint_needed),'can(s)')

Prompt user for color of paint [here, we assume the user input is correct]

color = input("Choose a color to paint the wall: ")

Prints the corresponding amount for the color

print("Cost of purchasing", color, "paint: $",paint_colors[color])

3 0
2 years ago
Other questions:
  • Only the _________ can add users with passwords and limit user access to selected areas.
    5·1 answer
  • NEED ASWERS FAST
    12·1 answer
  • What is a benifit of having a client/server network?
    6·1 answer
  • Fact Pattern: A sales transaction record designed to contain the information presented below. Column Information 1-10 Customer a
    13·1 answer
  • ________ programming is a method of writing software that centers on the actions that take place in a program.
    8·1 answer
  • Which of the following is the best definition of a workplace policy?
    13·1 answer
  • What is it called to persist in trying to multitask can result in this; the scattering bits of one’s attention among a number of
    9·1 answer
  • Can someone please find the IP address of a 3630 hp printer?
    8·1 answer
  • 2. What is MOST TRUE of a mature technology?
    7·1 answer
  • Which website offers guidance on putting together a checklist to provide guidance on configuring and hardening operating systems
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!