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
viktelen [127]
2 years ago
6

Given five positive integers, find the minimum and maximum values that can be calculated by summing exactly four of the five int

egers. Then print the respective minimum and maximum values as a single line of two space-separated long integers.
Computers and Technology
1 answer:
Aloiza [94]2 years ago
8 0

Using the knowledge in computational language in JAVA it is possible to write a code that  print the respective minimum and maximum values as a single line

<h3>Writting the code in JAVA:</h3>

<em>import java.io.*;</em>

<em>import java.util.*;</em>

<em>import java.text.*;</em>

<em>import java.math.*;</em>

<em>import java.util.regex.*;</em>

<em />

<em>public class Solution {</em>

<em>    public static void main(String[] args) {</em>

<em>        Scanner in = new Scanner(System.in);</em>

<em>        long sum = 0;</em>

<em>        long max = Long.MIN_VALUE;</em>

<em>        long min = Long.MAX_VALUE;</em>

<em>        for (int i = 0; i < 5; i++){</em>

<em>            long n = in.nextLong();</em>

<em>            sum += n;</em>

<em>            max = Math.max(max, n);</em>

<em>            min = Math.min(min, n);</em>

<em>        }</em>

<em>        System.out.println((sum - max) + " " + (sum - min));</em>

<em>    }</em>

<em>}</em>

See more about JAVA at brainly.com/question/12974523

#SPJ1

You might be interested in
Given six memory partitions of 300 KB, 600 KB, 350 KB, 200 KB, 750 KB, and 125 KB (in order), how would the first-fit, best-fit,
Inga [223]

Answer:

In terms of efficient use of memory: Best-fit is the best (it still have a free memory space of 777KB and all process is completely assigned) followed by First-fit (which have free space of 777KB but available in smaller partition) and then worst-fit (which have free space of 1152KB but a process cannot be assigned). See the detail in the explanation section.

Explanation:

We have six free memory partition: 300KB (F1), 600KB (F2), 350KB (F3), 200KB (F4), 750KB (F5) and 125KB (F6) (in order).

Using First-fit

First-fit means you assign the first available memory that can fit a process to it.

  • 115KB will fit into the first partition. So, F1 will have a remaining free space of 185KB (300 - 115).
  • 500KB will fit into the second partition. So, F2 will have a remaining free space of  100KB (600 - 500)
  • 358KB will fit into the fifth partition. So, F5 will have a remaining free space of 392KB (750 - 358)
  • 200KB will fit into the third partition. So, F3 will have a remaining free space of 150KB (350 -200)
  • 375KB will fit into the remaining partition of F5. So, F5 will a remaining free space of 17KB (392 - 375)

Using Best-fit

Best-fit means you assign the best memory available that can fit a process to the process.

  • 115KB will best fit into the last partition (F6). So, F6 will now have a free remaining space of 10KB (125 - 115)
  • 500KB will best fit into second partition. So, F2 will now have a free remaining space of 100KB (600 - 500)
  • 358KB will best fit into the fifth partition. So, F5 will now have a free remaining space of 392KB (750 - 358)
  • 200KB will best fit into the fourth partition and it will occupy the entire space with no remaining space (200 - 200 = 0)
  • 375KB will best fit into the remaining space of the fifth partition. So, F5 will now have a free space of 17KB (392 - 375)

Using Worst-fit

Worst-fit means that you assign the largest available memory space to a process.

  • 115KB will be fitted into the fifth partition. So, F5 will now have a free remaining space of 635KB (750 - 115)
  • 500KB will be fitted also into the remaining space of the fifth partition. So, F5 will now have a free remaining space of 135KB (635 - 500)
  • 358KB will be fitted into the second partition. So, F2 will now have a free remaining space of 242KB (600 - 358)
  • 200KB will be fitted into the third partition. So, F3 will now have a free remaining space of 150KB (350 - 200)
  • 375KB will not be assigned to any available memory space because none of the available space can contain the 375KB process.
8 0
3 years ago
Explain one thing you will start doing as a passenger.
Diano4ka-milaya [45]

By definition we have to:

The passenger is every human being transported in a means of transport. (Except for the driver.)

Passengers can carry suitcases, bags or backpacks to carry their belongings from one place to another on their trip.

For safety, the first thing passengers must use in any means of transport is the safety belt.

This protects you from accidents that may occur during the trip.

Answer:

As a passenger, the first thing you would do is wear a seatbelt.

5 0
3 years ago
Read 2 more answers
Jeff wants to print quickly so he presses the Ctrl and the P. Jeff used a _____. macro invoice template shortcut
Allushta [10]
He used a keyboard shortcut.
3 0
4 years ago
Jim has entered the age of each of his classmates in cells A1 through A65 of a spreadsheet.
alexandr402 [8]
The answer to this is B=MODE(A1:A65)
8 0
3 years ago
What's a good online University to attended for cyber security certificate.?
IrinaK [193]

Answer:

If your in the UK, a great university to attend is Lancaster University for a cyber security certificate.

Explanation:

8 0
3 years ago
Other questions:
  • Two electronics technicians are looking at the piece of testing equipment shown in the figure above. Technician A says that this
    10·1 answer
  • When you pass an array to a method, the method receives ______.
    7·1 answer
  • Whatisthebestlocationapp for my androidphonebesidesgoogle maps?
    9·1 answer
  • Explain how it makes you feel that you must share the road with others
    15·1 answer
  • Look at the following description of a problem domain:The bank offers the following types of accounts to its customers: saving a
    8·1 answer
  • If you wanted to buy a house that cost $150,000 and you knew you needed a down payment of five percent, how much would you need
    8·1 answer
  • What do you think will happen if you use a different file format for a certain document type?
    15·1 answer
  • When do you use FTP?
    10·2 answers
  • List 2 positive impacts of cybersecurity.
    8·2 answers
  • A _______ attack is where the input includes code that is then executed by the attacked system.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!