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
Studentka2010 [4]
3 years ago
9

A(n) ____ is a predefined procedure that you can call (or invoke) when needed.

Computers and Technology
1 answer:
DaniilM [7]3 years ago
8 0

A method is a predefined procedure that you can call (or invoke) when needed.  Correct answer: A

Another word for method is member function. A method belongs to classes or objects and usually expresses the verbs of the objects/class. Example: methods open and close  for an object of type Window. These methods do corresponding operations to the object they belong.

You might be interested in
Which of the following would be a valid method call for the following method? public static void showProduct (int num1, double n
Alenkinab [10]

Answer:

showProduct(int,double)

for example: showProduct(10,10.5) is the correct answer even showProduct(10,10.0) is also correct but showProduct(10.0,10.5) or showProduct(10,10) or showProduct(10.0,10) are wrong calls.

Explanation:

The code is

  1.       <em>public static void showProduct (int num1, double num2){</em>
  2. <em>       int product;</em>
  3. <em>       product = num1*(int)num2;</em>
  4. <em>       System.out.println("The product is "+product);</em>
  5. <em>       }</em>

showProduct is function which asks for two arguments whenever it is called, first one is integer and second one is of type double which is nothing but decimal point numbers. Generally, in programming languages, 10 is treated as integer but 10.0 is treated as decimal point number, but in real life they are same.

If showProduct( 10,10.0) is called the output will be 'The product is 100'.

Strange fact is that, if you enter showProduct(10,10.5) the output will remain same as 'The product is 100'. This happens because in the 3rd line of code,which is <em>product=num1*(int)num2</em>, (int) is placed before num2 which makes num2 as of type integer, which means whatever the value of num2 two is given, numbers after decimal is erased and only the integer part is used there.

This is necessary in JAVA and many other programming languages as you <u>cannot</u><u> multiply two different datatypes</u> (here one is int and another is double). Either both of them should be of type int or both should be of type double.

3 0
3 years ago
You're a ticket agent for a commercial airline and responsible for checking the identification for each passenger before issuing
algol13

Answer:

Follows are the code to this question:

import java.util.*;//import package for user input  

public class Main //defining class  

{

  public static void main(String[] as)//main method

  {

      boolean x,y,z;//defining boolean variable

      Scanner ox= new Scanner(System.in);//create Scanner class object for user input

      System.out.println("input value: "); //print message  

      x=ox.nextBoolean();//input value

      y=ox.nextBoolean();//input value

      z=ox.nextBoolean();//input value

      System.out.println("Output: ");//print message

      System.out.println(x || (y &&z));//use print method to check value and print its value  

  }

}

Output:

1)

input value:  

true

false

false

Output:  

true

2)

input value:  

false

true

true

Output:  

true

3)

input value:  

false

false

false

Output:  

false

Explanation:

In the given code, inside the class three boolean variable "x,y, and z" is declared, that uses the scanner class for input the value from the user end, and in the next print, the method is declared, that uses " OR and AND" gate for calculating the input value and print its value.

In the AND gate, when both conditions are true. it will print the value true, and in the OR gate, when one of the conditions is true, it will print the value true.  

3 0
3 years ago
Which of the given original work is protected by the copyright law
andreyandreev [35.5K]
BMW is my desion u cant copy write alot of things like books movies logos
7 0
3 years ago
Read 2 more answers
A data analyst is using the Color tool in Tableau to apply a color scheme to a data visualization. They want the visualization t
alina1380 [7]

Answer:

Color contrast is the difference in light between font (or anything in the foreground) and its background.

Explanation:

In web accessibility, how well one color stands out from another color determines whether or not most people will be able to read the information.

Contrast makes things look different and stand out

6 0
3 years ago
The Subset Sum problem is a generalization of the Knapsack problem. Group of answer choices True False g
Katarina [22]

Answer: True

Explanation:

Subset sum problem and Knapsack problem can be solved using dynamic programming.

In case of Knapsack problem there is a set of weights associative with objects and a set of profits associated with each object and a total capacity of knapsack let say C. With the help of dynamic programming we try to include object's weight such that total profit is maximized without fragmenting any weight of objects and without exceeding the capacity of knapsack, it is also called as 0/1 knapsack problem.

Similar to knapsack problem, in subset sum problem there is set of items and a set of weights associated with the items and a capacity let say C, task is to choose the subset of items such that total sum of weights associated with items of subset is maximized without exceeding the total capacity.

On the basis of above statements we can say that subset sum problem is generalization of knapsack problem.

4 0
3 years ago
Other questions:
  • There are about what licensed drivers here in Florida
    7·1 answer
  • What special member function of a class is called whenever an instance of a class is created and initialized?
    15·1 answer
  • According to the author, there are five hedging strategies organizations can pursue. One of them is: Select one: a. commit with
    5·1 answer
  • A(n ____ is used to describe the characteristics of data used in a database or other type of computer system.
    12·2 answers
  • Which professionals can benefit from an understanding of statistics? Check all of the boxes that apply. magician trying to locat
    5·2 answers
  • Is a defense of a political position an argument
    7·1 answer
  • How do i fix this to make it run ???
    9·1 answer
  • WILL GIVE BRAINLIEST! The command simplify is used if you only want the first two digits of a decimal to appear in the interpret
    13·1 answer
  • Paragraph on uses of computer 100 words plss​
    11·1 answer
  • A vlan ________.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!