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
babunello [35]
3 years ago
5

Which of the following method calls are legal?a. mathMethod(x);b. mathMethod(y);c. mathMethod(x, y);d. mathMethod(x + y);e. math

Method(12L);f. mathMethod(12);g. mathMethod(12.2);h. mathMethod();i. mathMethod(a);j. mathMethod(a / x);
Computers and Technology
1 answer:
Roman55 [17]3 years ago
7 0

Answer:

Option a, b, d, f, and j is legal method calls.

Explanation:

In the given question some information is missing, that is the method definition which can be described as follows:

Method definition:

int x =2, y=3; //defining integer variable

int mathMethod (int x)  //method definition

{//method body

int z=x+y; //calculate value

return z;  //return value

}

In the given question option a, b, d, f, and j  is legal, because these options follow the correct syntax, and other option were incorrect which can be defined as follows:

  • In option c, It is illegal because it accepts only one parameter.
  • In option e, It is accepts long number, that's why it is illegal.
  • In option g, It accepts float value, that's why it is illegal.
  • In option h, It doesn't accepts any parameter.
  • In option i, It isn't use in method.
You might be interested in
write a pseudo code and flow chart that take a number as input and prints multiplication table up to 10
Troyanec [42]

PSEUDOCODE:

1. DECLARE number: INTEGER

2. DECLARE multiple: INTEGER

3. INPUT number  

4. FOR counter FROM 1 TO 10 DO

5.     multiple <-- number * counter

6.     PRINT number, " * ", counter, " = ", multiple

7. ENDFOR


<em>1. declaring a variable "number" as an Integer</em>

<em>2. declaring a variable "multiple" as an Integer</em>

<em>3. The user inputs the value of number</em>

<em>4. FOR loop where variable "counter" increments by 1 after every iteration</em>

<em>5. sets the value for variable "multiple" as the value of number * counter</em>

<em>6. prints out for example "3 * 1 = 3" and will continue till counter reaches 10</em>

<em>7. Ends the for loop</em>

FLOWCHART below

hope it helped

8 0
3 years ago
What is the name of the nearest major galaxy to Milky-Way ?
nika2105 [10]
The Andromeda Galaxy would be my answer.
3 0
3 years ago
What are voter purges
diamong [38]

Answer:

Voter registration lists, also called voter rolls, are the gateway to voting because a citizen typically cannot cast a vote that will count unless his or her name appears on the voter registration rolls. State and local officials regularly remove—or purge—citizens from voter rolls. In fact, 39 states and the District of Columbiareported purging more than 13 million voters from registration rolls between 2004 and 2006.

Explanation:

7 0
3 years ago
Declare a structure with a type name: Car containing:
OLga [1]

Answer:

C++ code is given below

Explanation:

#include <iostream>

#include <cctype>

#include <string.h>

#include <cstring>

#include <sstream>

using namespace std;

struct Car {

public:    

char reportingMark[5];    

int carNumber;

string kind;

bool loaded;

string destination;

};

void input(Car *);

void output(Car *);

int main() {

Car *T = new Car;    

input(T);

output(T);    

delete T;    

return 0;

}

void input(Car *T)

{

string str, s;

cout << " Enter the reporting mark as a 5 or less character uppercase string: ";

cin >> str;

for (int i = 0; i < str.length(); i++)

T->reportingMark[i] = toupper(str[i]);

cout << " Enter the car number: ";

cin >> T->carNumber;

cout << " Enter the kind: ";

cin >> T->kind;

cout << " Enter the loaded status as true or false: ";

cin >> s;    

istringstream(s) >> boolalpha >> T->loaded;    

if (T->loaded == true) {

cout << " Enter the destination: ";

cin.ignore();

getline(cin, T->destination);

}

else

T->destination = "NONE";    

}

void output(Car *T)

{

cout << " Reporting Mark: " << T->reportingMark;

cout << " Car Number: " << T->carNumber;    

cout << " Kind: " << T->kind;

cout << " Loaded Status: " << boolalpha << T->loaded;

cout << " Destination: " << T->destination << " ";

}

7 0
3 years ago
A program that performs handy tasks, such as computer management functions or diagnostics is often called a/an ____________.
Elodia [21]

Answer:

DOS

Explanation:

Disk operating

4 0
2 years ago
Other questions:
  • You have already learned about the various types of lenses. Now, conduct online research and mention as many possible types of l
    9·1 answer
  • What command would you use to list the text files in your
    7·1 answer
  • If a secret key is to be used as a _________ for conventional encryption a single number must be generated.
    13·1 answer
  • Write a method printshampoolnstructions0, with int parameter numCycles, and void return type. If numCycles is less than 1, print
    8·1 answer
  • Working with text in presentation programs is similar to using text in other applications
    9·2 answers
  • Gabriel's sister called him about a message that suddenly appeared on her screen that says her software license has expired and
    11·1 answer
  • What is the condition for setting an alarm clock
    11·1 answer
  • Alexa it is olewi.............................................
    15·2 answers
  • What kind of skill is persuasion?
    7·1 answer
  • SUSSY SUSSY SUSSY SUSSY SUSSY SUSSY SUSSY SUSSY SUSSY SUSSY SUSSY SUSSY SUSSY SUSSY SUSSY SUSSY SUSSY SUSSY SUSSY SUSSY SUSSY SU
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!