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]
4 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]4 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
Write a function "hailstone"that takes an int "n2"and prints the hailstone sequence. Hailstone Numbers:This sequence takes the n
givi [52]

Answer:

Here is the C program    

#include<iostream>  //for input output functions

using namespace std;   //to identify objects like cin cout

int Hailstone(int n2);   //function declaration of function Hailstone

int main()  {  // start of main() function body

int num;   // stores number entered by user

cout<<"Enter a number: ";  // prompts user to enter a number

cin>>num;   // reads the input number

while(num!=1) {  // loop continues until the value of num becomes 1

 num = Hailstone(num);  // calls hailstone method and passes num to it

cout<<num<<"\n";  }   }  // prints the hailstone sequence

int Hailstone(int n2)  {  //function takes int n2 and prints hailstone sequence

if(n2 % 2 == 0) {  // if the number is even

return n2 /=2;  }  // divide the n2 by 2 if n2 value is even

else {  // if n2 is odd

return n2 = (3 * n2) + 1;  }  }  // multiply n2 by 3 and  add 1 if n2 is odd

 

Explanation:

The function Hailstone() takes as parameter an integer which is int type and is named is n2. This function prints the hailstone sequence. The function has an if statement that checks if the number n2 input by the user is even or odd. If the value of n2 is even which is found out by taking modulus of n2 by 2 and if the result is 0 this means that n2 is completely divisible by 2 and n2 is an even number. So if this condition evaluates to true then n2 is divided by 2. If the condition evaluates to false and the value of n2 is odd then n2 is multiplied by 3 and 1 is added.

In the main() function the user is prompted to enter a number and the  Hailstone() function is called which keeps repeating until the value of n2 reaches 1.

4 0
3 years ago
A software programâs _________ indicates what can legally be done with that program.]
xxMikexx [17]
A software license indicates what can be done with that program, in terms of its use, modification and distribution.

For example, Linux has a software license that allows users to modify and even distribute the operating system. It is open source.
7 0
4 years ago
What does limited access to a document mean?
Vlad [161]

Answer:

D. It does not reflect any changes made in the document

Explanation:

A limited access is usually done by middle level and top level managers in an organisation to prevent other staff member to edit or make changes to confidential documents when they are out of the office, though the staff can read it, they can not make changes to it.

6 0
3 years ago
Read 2 more answers
The =COUNT function calculates what value?
Valentin [98]

The correct answer is letter c


8 0
4 years ago
Read 2 more answers
When creating an electronic slide presentation, Eliza should ensure that her presentation contains
kondor19780726 [428]

Answer: C) only one main idea on each slide.

Eliza needs to be able to use her electronic slide presentation to convey what the purpose of the presentation is. By providing one main idea on each slide, this would show the audience of Eliza exactly what she wants to convey to them. This would also help her audience get on board of what the whole idea of the presentation is.

8 0
3 years ago
Other questions:
  • During the Requirements Definition stage of a systems development​ project, the employees who will be the primary users of the n
    15·1 answer
  • Where can I easily find an easy app or program to use for making/editing videos?
    13·1 answer
  • Which of the following is a bad password? Select one: a. The acronym for the title of your favorite song plus the year it came o
    11·1 answer
  • How do you view a presentation as your audience would see it?
    14·2 answers
  • A SmartArt graphic consists of two parts: the SmartArt graphic itself and a(n) ____ pane.
    5·1 answer
  • Before creating a brief to design a product, what is needed
    8·1 answer
  • As long as you have great skills and references, you don't have to worry about how well you package that information.
    5·1 answer
  • It is for employees to make mistakes that compromise the security of an organization’s computer devices and sensitive informatio
    10·2 answers
  • According to the video, which tasks do Police Patrol Officers perform? Select all that apply.
    15·2 answers
  • Create a list of 5 potential jobs that students of computer science can obtain.
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!