Write a function named minMax() that accepts three integers arguments from the keyboard and finds the smallest and largest integers. Include the function minMax() in a working program. Make sure your function is called from main().Test the function by passing various combinations of three integers to it.

Answers

Answer 1

Answer:

public class Main

{

public static void main(String[] args) {

 minMax(1, 2, 3);

 minMax(100, 25, 33);

 minMax(11, 222, 37);

}

public static void minMax(int n1, int n2, int n3){

    int max, min;

    if(n1 >= n2 && n1 >= n3){

        max = n1;

    }

    else if(n2 >= n1 && n2 >= n3){

        max = n2;

    }

    else{

        max = n3;

    }

   

    if(n1 <= n2 && n1 <= n3){

        min = n1;

    }

    else if(n2 <= n1 && n2 <= n3){

        min = n2;

    }

    else{

        min = n3;

    }

    System.out.println("The max is " + max + "\nThe min is " + min);    

}

}

Explanation:

*The code is in Java.

Create a function named minMax() that takes three integers, n1, n2 and n3

Inside the function:

Declare the min and max

Check if n1 is greater than or equal to n2 and n3. If it is set it as max. If not, check if n2 is greater than or equal to n1 and n3. If it is set it as max. Otherwise, set n3 as max

Check if n1 is smaller than or equal to n2 and n3. If it is set it as min. If not, check if n2 is smaller than or equal to n1 and n3. If it is set it as min. Otherwise, set n3 as min

Print the max and min

Inside the main:

Call the minMax() with different combinations


Related Questions

When the body of a function is implemented temporarily with just a printf call that displays a message reporting that the function was entered, the programmer is using __________.

Answers

Answer:

The answer is "a stub".

Explanation:

A stub seems to be the feature only with expected signatures, that is a name and agreed arguments, however, the execution is incomplete. This function is used as a set, which allows the code to be evaluated before another method call is fully written. This method used in the development of software is a type of hardware, which is used to support certain programming functions.

This is science I just couldn’t find it

Answers

Answer:

69

Explanation:

It is 69 because it is the most for that degree.

If after a call to fork, we want any updates to memory by the parent process to be visible to the child process, and vice-versa, what flag should be included in the fourth argument of mmap?

Answers

Answer:

MAP_SHARED

Explanation:

The MAP_SHARED should be included in the 4th argument of map. When we have a MAP_SHARED set, then we have it that it is preserved across a fork2 system call.

It is visible immediately in every parent, siblings or child processes. This is to say that any change that is made to this mapping is immediately seen by readers.

Bibliography
There are some formatting errors in this bibliography
page. Which corrections should be made? Check all
that apply
O The title should be in bold.
O There should be a double space between each
citation
Amber, Claire. "How Would Gandhi Respond?"
The World Post. TheHuffington Post.com,
16 Sept. 2011. Web. 28 Feb. 2014.
Wilkinson, Philip. Gandhi: The Young Protester
Who Founded a Nation. Washington, DC:
National Geographic Society, 2005. Print.
Eknath, Easwaran. Gandhi the Man: How One
Man Changed Himself to Change the World.
Tomales, CA: Nilgiri, 2011. Print.
O The citation entries should be in alphabetical order.
The web sources should be listed first.
The second and third lines of the last entry should
be indented

Answers

Answer:

There should be a double space between each citation

The citation entries should be in alphabetical order.

The second and third lines of the last entry should be indented

Explanation:

The bibliography page contains some formatting errors which should be corrected before it is standard and acceptable.

First of all, in MLA (and most other styles), it is important to double space each citation to make them easily readable and eliminate errors.

Next, the citation entries needs to be in alphabetical order and not random which makes it easy to find a source.

Also, there needs to be indentation in the second and third lines of the last entry.

Answer:

B,C,E is the answer

Explanation:

I got it right on test...

sorry if its too late

Hope it helps someone else :D

Write a program to prompt the user for hours and rate per hour using input to compute gross pay. Pay the hourly rate for the hours up to 40 and 1.5 times the hourly rate for all hours worked above 40 hours. Use 45 hours and a rate of 10.50 per hour to test the program (the pay should be 498.75). You should use input to read a string and float() to convert the string to a number. Do not worry about error checking the user input - assume the user types numbers properly.​

Answers

I've included my code in the picture below. Best of luck.

How long will it take to transfer 1GB data on USB 2.0, on USB 3.0

Answers

Answer:

Have a great day, Here is the answer to your question:

It will take around 18 seconds

Explanation:

So in principle 1GB of data to be uploaded running at peak speed is suggested to take around 18 seconds but in fact, DCD test results show USB 2.0 takes 3 minutes 18 seconds to complete a 1GB switch. Whereas USB 3.0 can accommodate up to 5gbps of data transferred-more than 10 times faster than its predecessor.

answer the 1 question for 10 points plz dont get it wrong. HAVE A GREAT DAY

Answers

Answer:

3rd one

Explanation:

Are Dogs are better than video games?

Answers

sometimes bc dogs are very lovey but video games also have there moments

Answer:

In some cases yes.

Explanation:

Some days I really enjoy my video games and other days I enjoy being with my dog but sometimes they are annoying especially if they have way more energy than you

What is an example of an absolute cell reference? 52% D2 $B$5 !90!

Answers

Answer:

$B$5 is an example of absolute cell reference

Explanation:

There are two types of referencing in MS Excel.

1. Relative

2. Absolute

Relative cell referencing changes according to the corresponding new cells when it is copied in other cells. MS Excel uses relative cell referencing by default.

Absolute cell referencing uses dollar sign with the row number and column name. When any formula with absolute referencing is copied, the cell addresses used remain the same.

From the given choices in question,

$B$5 is an example of absolute cell reference

An example of an absolute cell reference is "$B$5".

Thus, option (C) is correct.

Cell references can be either relative or absolute.

A relative cell reference changes when it is copied to another cell.

For example, if you have a formula in cell C2 that references cell A2 as "=A2+1", and you copy this formula to cell C3, it will automatically adjust to "=A3+1".

An absolute cell reference remains constant, regardless of where it is copied. When a cell reference is made absolute, the dollar sign ($) is used to indicate this.

For example, if you have a formula in cell C2 that references cell B5 as "=B$5+1", and you copy this formula to cell D3, it will still refer to cell B5 as "=B$5+1". The row and column references remain fixed.

Therefore, "$B$5" is an absolute cell reference.

Thus, option (C) is correct.

Learn more about Cell Reference here:

https://brainly.com/question/30714866

#SPJ6

What was that show where lowe’s were based off eye colors and the main character had orange eyes that let her mind control people. It was either on netflix or hulu

Answers

The Innocents on Hulu i think

Answer:Raising Dion?

Explanation:

Was it Raising Dion?

Which Packet Tracer feature do you think will be most helpful for you in learning how to manage a network

Answers

Answer:

Its ability to sniff and analyze packets in a network.

Explanation:

Network administrators require advanced skills and tools to manage a large network, to analyze packets as they are transmitted across the network.

Packet tracer helps to monitor the network connection and packet transfer. It informs the administrator of a dropped connection, slow transmission due to a bottle-neck, and many more packet related issues

What special responsibilities do computer professionals have with respect to understanding and protecting the privacy rights of their fellow citizens?

Answers

Explanation:

There are ethical responsibilities that must be linked to the use of technological systems by computer professionals in relation to the protection of the privacy rights of their fellow citizens.

Exercising ethical behavior is essential for computing to be used for its central benefits, which is to make life and tasks simpler and more dynamic, and not for technical knowledge about computer science to be used for personal or other benefits. , therefore, it is ideal that there is ethical responsibility for computer professionals so that ethical decisions are taken so that knowledge is used for the benefit of society and not to commit illegal acts.

Let g(x) = cos(x/2) - 3x. Let f(x) = 2x + 5. What is g(f(x))?​

Answers

Answer:

f = 2

Explanation:

g(x) = cos(x/2) - 3x=w where w=-3.5 or -1 or -38.5

13– (13/2)-3*13=-3.5 (1st d value of g(x))

-1-(-1/2)-3*(-1)=-1 (the 2nd possible value)

g(x) = cos(x/2) - 3x=-1 where the first x=13 and the 2nd one=-1

where the first x=-1 and the 2nd one=-38.5 (the 3rd value)

g(x) = cos(x/2) - 3x)=0 where cos(x/2=-3.5

g(f(x)) = cos(f(x)/2) - 3 aka 0.5 f(x) = cos(2x+5 aka 7x) (x/2 - 3 =aka -1 );

(2x+5) = 7x by definition but the equation has to be set to 7 to find x)

(7x/2 -6x=0) -7 on both sides

x/2–6x=-7

x/2= 13

26/2=x

x=13 (these values are set up for 2x+5=7.

13-(-7)=-7

13-6+-1=-7

the 2nd x=-1

gfx=cos*2*x i.e cos*2*13 or cos*2*-1

cos*2*13=26

cos*2*(-1)=-1

cos=1

(cos*2*13)=the 1st gfx value=26 basically.

( cos*2*(-13)=-26 (the 2nd gfx value)

cos*2*(-1)=-`1 (the 3rd gfx value)

f=2

hope this helped!

Write the definition of a class Phone containing: 1. A data member named model of type string. 2. A data member named partNumber of type string. 3. A data member named retailPrice of type double 4. A void method to display the fields model, partNumber, and retailPrice on the standard output.

Answers

Answer:

class Phone(object):

   def __init__(self, model, partNumber, retailPrice):

       self.model = model

       self.part_number = partNumber

       self.retail_price = retailPrice

   def phone_specs(self):

       print( "Phone model: {}\nPart number: {}\nRetail price: {}".format( self.model, self.part_number, self.retail_price))

phone1 = Phone("Nokia", "asd234", 200.0)

phone1.phone_specs()

Explanation:

A class is a blueprint of a data structure used to create objects of the same data types and methods. The Phone class is an object that creates an instance of the phone1 object. The phone_specs method is used to display the details of the phone1 object.

Write a statement that calls the recursive method backwardsAlphabet() with parameter startingLetter.

Answers

Answer:

Explanation:

public class RecursiveCalls {

public static void backwardsAlphabet(char currLetter) {

if (currLetter == 'a') {

System.out.println(currLetter);

}

else {

System.out.print(currLetter + " ");

backwardsAlphabet(--currLetter);

}

return;

}

public static void main (String [] args) {

char startingLetter = '-';

startingLetter = 'z';

// Your solution goes here

backwardsAlphabet(startingLetter);

return;

}

}

Are dogs are dangerous. the golden retriever is a dog. there for the golden retriever is dangerous. is this argument sound or unsound?

Answers

The argument is unsound.

What is the most vulnerable information that should be protected to prevent unauthorized access to your online files and records?

Answers

Answer:

Your user ID and password.

Explanation:

The user Id and password must be protected because when it is exposed to a third party then they can get access to information, data, to things they are not supposed to.

The user Id and password is provided as an authentication measure for one to be able to gain access to a computer system, network or files. It is what grants access to online files and record as it is the case here. It has to be protected for the sake of privacy.

Shelly recorded an audio composition for her presentation. Arrange the following steps that Shelly followed in the proper order.

She added effects to her audio composition.
She saved her audio composition on an optical drive.
She connected her microphone to her computer.
She saved the audio composition in an appropriate file format.
She selected the record option in her DAW.

Answers

Answer:

The answer to this question is given below in the explanation section.

Explanation:

Shelly recorded an audio composition for her presentation. She needs to follow the following proper orders to get composition done for her presentation.

She connected her microphone to her computer.She selected the record option in her DAW.She added effects to her audio composition.She saved the audio composition in an appropriate file format.She saved her audio composition on an optical drive.

Answer:

She connected her microphone to her computer.

She selected the record option in her DAW.

She added effects to her audio composition.

She saved the audio composition in an appropriate file format.

She saved her audio composition on an optical drive.

WILL BRAINLIEST Use the drop-down menu to correctly complete these sentences about the five standard Python data types.


are numeric values in Python data types.
A
is a large and changeable list that can contain any number of Python objects.

are connected sets of characters separated by quotation marks " ".

are sets of data separated by a comma between two parenthesis ( ).

are sets of data separated by a comma between two brackets [ ].

Answers

numbers,dictionary,strings,tuples and lists. in order

Answer:

numbers,dictionary,strings,tuples and lists. in order

Explanation:

Write an if-else statement for the following:
If user_tickets is less than 5, assign 1 to num_tickets. Else, assign user_tickets to num_tickets.

Answers

In python 3.8:

if user_tickets < 5:

   num_tickets = 1

else:

   num_tickets = user_tickets

For this code to work properly, you'll have to first declare user_tickets before the if-else statements.

Write a JavaScript script that has subprograms nested three deep and in which each nested subprogram references variables defined in all of its enclosing subprograms.

Answers

Answer and Explanation:

Subprograms are nested three deep hence we would have three subprograms/functions under one program(function)

We call the program/function MotherFunction( using camel case variable naming rules)

function MotherFunction() {

var mother= 8;

console.log(mother);

function subDaughter1() {

var subDaughter1X = mother + 12;

console.log(subDaughter1X);

function subDaughter2() {

var subDaughter2X= mother + 5;

console.log(subDaughter2X);

function subDaughter3() {

var subDaughter3X= mother + 3;

console.log(subDaughter3X);

alert("sum="+subDaughter1X+subDaughter2X+subDaughter3X);

}

}

}

}

MotherFunction();

We created the first function and nested subfunctions under it, adding up the variable from the parent function(mother function) to its subfunctions and then alerting the total value of all the subfunction variables summed in the last/third subfunction. We then called the function after defining it.

what program we write for nested if in c++ to print something after else part but before inner if else
if(condition){
}
else
//something we want to print
if(condition){
}
else{
}

Answers

Answer:

if(condition){

}

else  {

  // something we want to print

  if(condition) {

     // ...

  }

  else {

     // ...

  }

}

Explanation:

Create code blocks using curly braces { ... }.

Use proper indentation to visibly make it clear where code blocks start and end.

principle of rocket propulsion is based on _​

Answers

Answer: Newton’s third law of motion
Explanation: The propulsion of all rockets, jet engines, deflating balloons, and even squids and octopuses is explained by the same physical principle—Newton's third law of motion.

What is the benefit of encapsulation?

A. To rename variables
B. To reuse code
C. To make all members public
D. To make all members protected

Answers

Answer:

B. To reuse code

Based on the data definition classes identified below, assume you wish to create a Dictionary class that inherits from the Book class. In addition to title and cost, the Dictionary class must also store the number of words present in the dictionary. Write the code that will create a constructor in the dictionary class that passes in and sets the dictionary's title, cost, and number of words.

public class Book {
private String title;
private double cost;

public Book(String title) {
this(title, 0.00);
}

public Book(String title, double cost) {
this.title = title;
this.cost = cost;
}

public String getTitle() { return this.title; }
public double getCost() { return this.cost; }
}

public class Dictionary extends Book {
private double numWords;

// Create Contructor

}

Answers

Answer:

//==============================

// Book class

//==============================

public class Book {

private String title;

private double cost;

public Book(String title) {

 this(title, 0.00);

}

public Book(String title, double cost) {

 this.title = title;

 this.cost = cost;

}

public String getTitle() {  

 return this.title;  

}

public double getCost() {  

 return this.cost;  

}

}

//==============================

// Dictionary class

//==============================

public class Dictionary extends Book {

private double numWords;

// Create Contructor

public Dictionary(String title, double cost, double numWords){

 super(title, cost);

 this.numWords = numWords;

}

}

Explanation:

The actual response to this question is shown in bold face in the above.

Line 1:

public Dictionary(String title, double cost, double numWords){

Here the header for the constructor for the Dictionary class is written which takes in three parameters - title, cost and numWords. These parameters will be used to set the values of the instance variables of the Dictionary class.

Remember that the Dictionary class extends from the Book class. Therefore, in addition to its numWords attribute, the Dictionary class also has the title and cost attributes.

Line 2:

super(title, cost)

Here, since the Dictionary class inherits from the Book class, it can also call the constructor of Book class to initialize two of its three variables which are title and cost. Hence the need for the super() method keyword. In other words, the super() in the Dictionary class is the constructor from the parent class and it is used here to set the dictionary's title and cost attributes.

Line 3:

this.numWords = numWords;

Here, the only attribute left to be set is the numWords. Therefore, the 3rd line sets this attribute to the parameter passed into the constructor in line 1.

Line 4:

}

Here, the block containing the Dictionary class constructor is being closed.

What are some applications of a Router?

Answers

Applications of Routers. Routers are the building blocks of Telecom service providers. They are used for connecting core hardware equipment such as MGW, BSC, SGSN, IN and other servers to remote location network. Thus work as a backbone of Mobile operations.

Select the correct answer.
Sandra has composed a draft of her essay in Microsoft Word. She now wants to revise the essay. Which tool can she use to store the document with a different name and makes changes in the new document?

A.
Share
B.
Download
C.
Make a copy
D.
Save As

Answers

Answer:

I think make a copy maybe

Explanation:

Answer:

D

Explanation:

She can save and store the doc, change the name when saving, and make changes to revise once saved.

Let f(w) = 2w^3 - 5. Let z = 2. What is f(z)?​

Answers

Answer:

Hence f(z)=11

*This is what i think*

Assume a file containing a series of integers is named numbers.txt and exists on the computer’s disk. Write a program that calculates the average of all the numbers stored in the file.

Answers

Answer:

Explanation:

The following code is written in Java. It assumes that the numbers.txt file is in the same folder as the Java file and the numbers are separated one on each line. It reads the file, adds all the numbers to an array, then adds the numbers into a single variable and finally divides by the total amount of numbers in order to get the average.

public static void main(String[] args) {

       ArrayList<Integer> numbers = new ArrayList();

       try {

           File myObj = new File("numbers.txt");

           Scanner myReader = new Scanner(myObj);

           while (myReader.hasNextLine()) {

               String data = myReader.nextLine();

               numbers.add(Integer.parseInt(data));

           }

           myReader.close();

       } catch (FileNotFoundException e) {

           System.out.println("An error occurred.");

           e.printStackTrace();

       }

       int average = 0;

       for (int x:numbers) {

           average += x;

       }

       average = average / numbers.size();

       System.out.println(average);

   }

what are the components of internet for class 5th​

Answers

Answer:

world wide web

Explanation:

they provide discussion forum like this of brainly which people ask questions which others can respond to

Other Questions
Solve the quadratic equation and give both solutions.14x^2 29x 15 = 0 Please help! I'll give brainliest!Question: Choose the correct definite article for the following noun.dicionarios (For some reason brainly thinks this is a bad word, that's why it's mispelled.)Answers:ellaloslas(It might take me a bit to give brainliest, this is quite a long assignment.) __________ are a type of limited-function wholesaler that owns products they sell, but do not actually handle, stock, or deliver them. A. Rack jobbers B. Catalog wholesalers C. Drop-shippers D. Truck wholesalers E. Cash-and-carry wholesalers If on a scale drawing 100 feet are represented by 15 inches, then a scale of 1/2 inches represents how many feet If f(x)=3, what is the value of f(-7)? Which big-picture idea comes logically from these details? 1. Oranges contain vitamin C, a nutrient that helps the body fight off germs. 2. Carrots contain vitamin A, a nutrient that helps support vision. 3. Avocados contain vitamin E, a nutrient that helps heal damaged skin. Fruits and vegetables are part of a healthful diet. Many children are more willing to eat fruits than vegetables. Any fruit or vegetable contains several types of nutrients. People get sick because they do not eat enough oranges. HELPPPP ME ASAPPPPPPPP(NO NONSENSE ANSWERS!!!)SLIDE 1 OPTIONS$157.25$185$210$212.75SLIDE 2 OPTIONS$5.80$6.35$7.11$12.55SLIDE 3 OPTIONS5185127136SLIDE 4 OPTIONS 25%30%35%40%25%30%40%SLIDE 5 OPTIONS which was a condition of surrender agreed to by general lee and general grant A 50 N girl climbs the flight of stairs in 3 seconds. How much work does sheperform? How much power does she use? * Sydney wrote the equation y+1=12(x3).Explain her error and then write the correct equation in point-slope form. x-12 y39 Boris buys candy that costs $7 per pound. He will spend at least $63 on candy. What are the possible numbers of pounds he will buy? 10 (2.5 + 13.5)Pleace hurry In class we play _______ football? *FlagTwo-hand touch HELP PLEASE 2x+2 PLEASE HELP Due Today!Find the distance between A and B Describe how to prevent being scammed (in your own words) zoom in the pic if cant see i dont wan these points so take them hbjdnfjerhbgdf Britain recognizedthe independence of theUnited States.All British troopswould be withdrawn fromthe United States.?U.S. agreed to payall existing debts owedto Great Britain.Opened the Mississ-ippi River to citizens of theU.S. and Great Britain.Which of the following best completes the diagram?O Declaration of IndependenceArticles of ConfederationProclamation of 1763O Treaty of Paris of 1783 Energy can move out of a cell.TrueO False