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
A bakery collects data on sales. Each sales record includes the date of the sale and some metadata about the items that were par
professor190 [17]

Answer:

B. Which customer most frequently purchases bread.

Explanation:

As per the scenario, the data we are receiving from the sales record of the bakery is :

The date on which the items are sold

Each items name which are sold

The number of each item sold and

The price of each item sold  

These data are required to estimate how much the company has earned the profit during a given period of time.

So from the above scenario, there is no data given about the customer i.e customer name, customer number, etc. So there is no chance to track the details of a customer purchase history.

Therefore, the most appropriate answer is option B

6 0
3 years ago
I am doing keyboarding keyboarding is very boring and yeah
Bingel [31]

Answer:

yes I agree with you

Explanation:

I have been keyboarding for the past 7 hours.

7 0
3 years ago
Read 2 more answers
This image shows a web designer's grids for different pages on a website. The uppermost box on each page is the website's identi
allsm [11]

Answer: d

Explanation: hope this helps

6 0
3 years ago
Read 2 more answers
Describe it the impact of computer in office?​
krok68 [10]

Answer:

Computers in the office environment significantly enhance productivity. According to the Reference for Business Web site, computers in the office increase productivity not only in areas such as word processing, data management and information access, but also in information creation, collation and ultimately storage. The amount of time most office workers spend at the computer has, however, given rise to a number of repetitive strain health problems on eyes, wrists and hands

hope it helps (^^)

# Cary on learning

7 0
2 years ago
You are flying on an ifr flight plan at 5500 feet with a vfr on top clearance when you encounter icing. you know there is clear
zepelin [54]

Answer:

A. Yes, you are still IFR with VFR-on-top clearance

Explanation:

Instrument Flight Rules (IFR) and Visual Flight Rules (VFR) are regulations controlling the operations of civil aviation. Pilots use these terms as well to describe their flight plan.

When your request is rejected to fly 9500 feet from atc, your VFR-on-top clearance is still active and you are still IFR.

8 0
3 years ago
Other questions:
  • Computer World sells laptops separately from accessory products like docking stations, anti-virus software, and external hard dr
    6·1 answer
  • Which type of multiplexing divides transmission opportunities into slots of 125 microseconds with position inside each slot rese
    10·1 answer
  • If you want to tune into a radio station that is carried by a signal with wavelength 3.0 meters, what channel would you choose?
    12·1 answer
  • Which course must first-time drivers in Florida take to be eligible for their Learner License?
    11·1 answer
  • Seth is considering advertising his business using paid search results.What do you think makes paid search advertising so effect
    11·2 answers
  • When storing used oil, it needs to be kept in ___________ containers.
    12·1 answer
  • jeff wants to create a website with interactive and dynamic content. Which programming language will he use?
    11·2 answers
  • Hey guys. Can u help me pls? I need to add number1 and number2 together on Python, I don't know what I'm doing wrong. Thx for yo
    7·2 answers
  • Karl comes across confidential information. What should he do with it? A. Manipulate the information in his favor B. Sell the in
    12·1 answer
  • Difference between statement x=+5 and x+=5​
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!