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(n) __________ can include a computer's full operating system, applications, and system settings, including security and config
babymother [125]

Solution:

It is done by Operating system.

An Operating system is system software that manages computer hardware and software resources and provides common services for computer programs.

Time-sharing operating systems schedule tasks for efficient use of the system and may also include accounting software for cost allocation of processor time, mass storage, printing, and other resources.

For hardware functions such as input and output and memory allocation, the operating system acts as an intermediary between programs and the computer hardware, although the application code is usually executed directly by the hardware and frequently makes system calls to an OS function or is interrupted by it. Operating systems are found on many devices that contain a computer – from cellular phones and video game consoles to web servers and supercomputers.


5 0
3 years ago
Given the macro definition and global declarations shown in the image below, provide answers to the following questions:
galben [10]

Answer:

A. 243

B. True

C. 0

Explanation:

Macro instruction is a line of coding used in computer programming. The line coding results in one or more coding in computer program and sets variable for using other statements. Macros allows to reuse code. Macro has two parts beginning and end. After the execution of statement of quiz4 x, 4 the macro x will contain 243. When the macro is invoked the statement will result in an error. When the macro codes are executed the edx will contain 0. Edx serve as a macro assembler.

4 0
3 years ago
A computer ____ is the amount of data (measured in bits or bytes) that a cpu can manipulate at one time
garik1379 [7]

A computer BIT is the amount of data that a CPU can manipulate at one time.

8 0
3 years ago
In your own words, what is your definition of cybercrime and computer forensics?
mr_godi [17]

Answer:  

Cyber crime is also known as computer crime in which the illegal activities are done by the computer and many mobile devices. There are many types of crime but the cyber crime are associated with the computer crime by hacking personal documents and email spamming.

To resolve these type of cyber crime there is special type of police which is known as cyber cell. Data theft, cyber stalking and accessing other user data without there permission is all comes under the cyber crime.

Computer forensics is type of application that are used in investigation purpose and gathering the information from the computer.

The main aim of computer forensic is to perform and maintain the various type structured investigation and also maintain the systematic documents for the evidence.

7 0
3 years ago
Write down a description of how a magnetic had drive works
Rus_ich [418]

Answer:

This is how a magnetic hard drive works

Explanation:

The hard drive contains a spinning platter with a thin magnetic coating. A "head" moves over the platter, writing 0's and 1's as tiny areas of magnetic North or South on the platter. To read the data back, the head goes to the same spot, notices the North and South spots flying by, and so deduces the stored 0's and 1's.

Hope it helps pls mark as brainliest

5 0
3 years ago
Other questions:
  • Write a program that checks for car mileage. if the mileage is greater than 100000, display "clunker!". if not, display "buy it!
    7·1 answer
  • Given that a function receives three parameters a, b, c, of type double, write some code, to be included as part of the function
    9·1 answer
  • Which are valid double statements for java? double a = 0; double b = -1.0; double c = -425; double d = 6340; double e = -1.0; do
    12·2 answers
  • Jeff is a financial assistant. He needs to create a document for his client that tracks her stocks and calculates the loss or ga
    10·2 answers
  • To share a document in my online electronic journal, I should select the option to _____.
    14·1 answer
  • . Select the advantages of RAID-5 relative to other RAID schemes. (MAY SELECT MULTIPLE)
    7·1 answer
  • To locate all locations in a document with the word "employer" and replace it with "company," you should use the _____ function.
    8·1 answer
  • Define the function max2 that takes two integers as arguments and returns the largest of them. Then define the function max_list t
    11·1 answer
  • When you call a method with a parameter list, the arguments in the argument list Select one: a. must be coded in the same sequen
    15·1 answer
  • If anyone can help please and thank you before Nov 11th
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!