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
Strike441 [17]
3 years ago
5

Given the integer variables x and y, write a fragment of code that assigns the larger of x and y to another integer variable max

.
Computers and Technology
1 answer:
Sidana [21]3 years ago
7 0

Answer:

if ( x > y ) {

    max = x;

}

else {

    max = y;

}

Explanation:

Assumptions:

(i) Variables x, y and max have been defined.

(ii) Since the question does not specify what to do if x and y are equal, I have assumed no such case exists. i.e x and y are never equal.

PS : The code has been written in Java.

According to the question, the larger of variables <em>x</em> and <em>y</em> is assigned to another variable, <em>max.</em>

To check which of x and y is greater, we could use an <em>if...else</em> statement like so;

if ( x > y ) {      // check if x is greater than y

  max = x;      // if yes, assign the value of x to max

}

else {             // then y is greater

 max = y;      // assign the value of y to max

}

You might be interested in
Design and implement a set of classes that define various types of reading material: books, novels, magazines, technical journal
tino4ka555 [31]

Answer:

Following are the code to this question:

please find the attached file.

Explanation:

In this code, four class "novels, magazines, technical journals, and textbooks", is defined, in which it holds their respective default constructor and the get and set method to hold the string and integer value, and in the book class the main method is defined, that creates its object and a switch to for search value and print its value.

6 0
3 years ago
How does the action affect the end result of what you want to accomplish?
suter [353]

Whichever action you take to complete a task will inevitably affect the end result of whatever would need to be accomplished; whether this impact the task in a positive or a negative way.

3 0
2 years ago
To remove the field list when working on a report in Design view, tap or click the ____ button on the REPORT DESIGN TOOLS DESIGN
Rudiy27

Answer:

The correct answer to the following question will be "Remove".

Explanation:

A report consists of information taken from tables or queries and information stored in the design of the report such as names, heading, and graphics. Also known as the source of the report are tables or queries that provide the underlying data.

The majority of reporting tools provide only a standard report layout where the report developer may not construct a custom layout with elements positioned in certain areas.

And, If we want to remove any field while working in Design view on a report then we have to click on the remove button for such tasks,

Therefore, the Remove button is the correct answer.

6 0
3 years ago
Can someone help me explain Nvm scheduling in operating systems?
Marat540 [252]

Low-power and short-latency memory access is critical to the performance of chip multiprocessor (CMP) system devices, especially to bridge the performance gap between memory and CPU

3 0
3 years ago
Write a loop that fills a list values with ten random numbers between 1 and 100. Write code for two nested loops that fill value
Alex787 [66]

Answer:

Please look for your answer on Stack Overflow, it's way better.

Explanation:

4 0
2 years ago
Other questions:
  • During an investigation of a cybercrime, the law enforcement officers came across a computer that had the hard drive encrypted.
    5·1 answer
  • Please help i really need to turn this in already
    6·1 answer
  • Whats the Sioux City school wifi?
    15·2 answers
  • What are the benefits of using a multiview sketch?
    11·1 answer
  • Any one of the languages that people have designed for specific purposes, such as representing mathematical ideas or computer pr
    15·1 answer
  • Clunker Motors Inc. is recalling all vehicles in its Extravagant line from model years 1999-2002 as well all vehicles in its Guz
    15·1 answer
  • Elizabeth works for a local restaurant at the end of her shift she read she’s required to write in the time that she arrived in
    14·1 answer
  • Justice wrote a program and forgot to put the steps in the correct order. Which step does she need to review?
    5·2 answers
  • What is a mod in programming?<br><br> Give more Java questions
    12·1 answer
  • When you run your Windows Form application, what is the lifespan of a global variable (also known as a "field" or "class" variab
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!