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]
4 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]4 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
13. Place where names, addresses and email information<br> is stored
yanalaym [24]

Answer in ur email

Explanation:

8 0
3 years ago
Choose all statements that identify the benefits of programming design.
Lubov Fominskaja [6]

Answer:

yes

Explanation:

it provides a design approach to a specific type of problem

4 0
3 years ago
Read 2 more answers
Which form of currency is not backed by gold today
Len [333]
I think it might be the USD but I'm not sure. 
5 0
4 years ago
A data analyst creates a data frame with data that has more than 50,000 observations in it. When they print their data frame, it
Alexandra [31]

A list is an R-object that can have a wide range of different items inside of it, including vectors, functions, and even another list.

The head() function lets you display the first observations in a data frame. The method tail() prints the final observations in your data collection in a manner similar to that. Both head() and tail() print a top line called the 'header', which contains the names of the distinct variables in your data collection. The R language's transform() function is used to alter data. The first parameter is transformed into a data frame. A suitable variable name comprises of letters, numbers and the dot or underline characters. The variable name does not begin with a number but rather with a letter or a dot.

Learn more about variable here-

brainly.com/question/13544580

#SPJ4

7 0
1 year ago
7. Explain the steps for formatting a shape ?
alisha [4.7K]

Answer:

To begin, select the shapes you want to format. To select more than one, press and hold the Shift key. When you select one or more shapes, a new Drawing Tools tab appears. Here, you can select Shape Fill to fill the selected shapes with a solid color, gradient, texture, or picture.

Explanation:

3 0
3 years ago
Other questions:
  • A local area network works as a ____ network in that clusters of workstations are connected to a central point (hub or switch) t
    6·1 answer
  • GIVING BRAINLIEST What does output allow a computer to do? Display information Receive information Do complex math problems Do m
    6·2 answers
  • All computers perform disk optimization utilizing the same software.<br><br> true <br> false
    11·1 answer
  • What factor(s) should be considered when determining whether a business is too far based on the query and the user location? Sel
    10·1 answer
  • write a script that creates and calls a stored procedure named insert_category. first, code a statement that creates a procedure
    10·1 answer
  • What's the average value of an ac voltage that has a maximum Peak voltage of 80 VAC
    13·1 answer
  • What does SFA software provides tools for
    11·2 answers
  • HELP !!! Prompt <br> What is formatting text?
    7·2 answers
  • Cloud-based services can open doors to leveraging Artificial Intelligence (AI) without dramatically increasing risk. Which clien
    9·1 answer
  • Normalization works through a series of stages called normal forms. For most purposes in business database design, _____ stages
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!