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
iVinArrow [24]
3 years ago
11

printLarger is a method that accepts two int arguments and returns no value. Two int variables, sales1 and sales2, have already

been declared and initialized. Write a statement that calls printLarger, passing it sales1 and sales2. Assume that printLarger is defined in the same class that calls it.
Computers and Technology
1 answer:
gizmo_the_mogwai [7]3 years ago
6 0

Answer:

<em>public static void printLarger(double sales1, double sales2){</em>

<em>        if (sales1>sales2){</em>

<em>            System.out.println(sales1+" is larger");</em>

<em>        }</em>

<em>        else {</em>

<em>            System.out.println(sales2+" is larger");</em>

<em>        }</em>

<em>    }</em>

<em>A complete code calling the printLarger method is given below</em>

Explanation:

<em>public class Larger{</em>

<em>    public static void main(String[] args) {</em>

<em>        int sales1 = 100;</em>

<em>        int sales2 = 120;</em>

<em>        printLarger(sales1,sales2);</em>

<em>    }</em>

<em>public static void printLarger(int sales1, int sales2){</em>

<em>        if (sales1>sales2){</em>

<em>            System.out.println(sales1+" is larger");</em>

<em>        }</em>

<em>        else {</em>

<em>            System.out.println(sales2+" is larger");</em>

<em>        }</em>

<em>    }</em>

}

You might be interested in
8. Given the array String[] words, which already contains 1 or more values, write a block of code which counts and returns the n
Vikentia [17]

Answer:

Following are the code to this question:

public class Main//defining a class

{

public static void main(String[] arg)//defining main method

{

  String[] words={"Key","day", "Know", "kind"};//defining array of String words

  int x=0;//defining integer variable for count value

  for(int i=0;i<words.length;i++)//defining for loop for count value

  {

 if(words[i].startsWith("k")||words[i].startsWith("K"))//use if block to check word start from k

  x=x+1;//increment the value of x

  }

System.out.print("The number of letters which starts from k is: "+ x);//print value with message

}

}

Output:

The number of letters which starts from k is: 3

Explanation:

In this code, inside the main method an array of String "words" is defined that hold a value, and in the next step an integer variable "x" is defined, which is used to count the letters, which starts from k.

For this, a for loop is used that counts the value and in this an, if block is defined that uses the "startsWith" method to check the value and increment the value of x and at the last, it prints its value.

7 0
3 years ago
Ms. Myers commented that _____ she slept in at the hotel was better than _____ she slept in at home.
nirvana33 [79]
The bed/ the bed is the answer
6 0
3 years ago
In a clustered column chart, the names of each column are part of the ____ series. select one:
Ratling [72]
Data.......;...............;.........;......;.
4 0
3 years ago
Read 2 more answers
PLEASE HELP ITS EASY I JUST BIG STOOPYHEAD!!!!
marishachu [46]

Answer:

D

Explanation:

Because a mobile phone would allow you to tilt it in any direction.

6 0
4 years ago
Read 2 more answers
Define a function dice(n) that returns the sum of a random roll of n 6-sided dice. Example output in photo. Thank you
leonid [27]

Answer:

code (in python) is in the explanation

Explanation:

import random

def dice(n):

   count = 1

   t = list()

   while count <= n:

       i = random.randint(1,6)

       t.append(i)

       count += 1

   print(sum(t))

Hope this helps!

6 0
3 years ago
Other questions:
  • Emma opened a new document a Microsoft word and typed her assignment. She is now planning to save the documents for the first ti
    11·1 answer
  • software that instructs the computer how to run applications and controls the display/keyboard is known as the
    11·1 answer
  • business ethics chapter 7 jordan, a software engineer, is responsible for maintaining the private piece of his company's interne
    15·1 answer
  • Which of the following mountain ranges stretches from Alabama to Canada?
    10·1 answer
  • Select the answers that best describe showing respect for confidential data. Check all of the boxes that
    10·1 answer
  • 3 applications of cumulative probability distribution in medical field?​
    9·1 answer
  • Suppose that a is a one-dimensional array of ints with a length of at least 2. Which of the following code fragments successfull
    8·1 answer
  • What happens if i unplug my alarm system?
    11·1 answer
  • I umm… really need helpp<br> Can someone help me out <br> I’ll even mark u as brainiest !
    12·1 answer
  • Write the names of different types of communication.​
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!