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
In-s [12.5K]
3 years ago
12

Write a program whose input is two integers and whose output is the two integers swapped. Ex: If the input is: 3 8 then the outp

ut is: 8 3 Your program must define and call a function. SwapValues returns the two values in swapped order. void SwapValues(int* userVal1, int* userVal2)
Computers and Technology
1 answer:
Ainat [17]3 years ago
4 0

Answer:

public class num3 {

   public static String swapValues(int userVal1, int userVal2){

       int temp = userVal2;

       userVal2 = userVal1;

       userVal1 = temp;

       return(userVal1+", "+userVal2);

   }

   public static void main(String[] args) {

       int val1 = 5;

       int val2 = 8;

       System.out.println("Original values");

       System.out.println(val1+", "+val2);

       System.out.println("Swapped Values");

       System.out.println(swapValues(val1,val2));

   }

}

Explanation:

  • The problem is solved with Java programming language
  • Define the method swapValues() to accept two ints and return a String
  • Within the method body, create a temp variable to hold the value of userVal2 temporary
  • Do the following re-assignment of values userVal2 = userVal1; userVal1 = temp;
  • Return the concatenated String userVal1+", "+userVal2
  • Create two variables and initialize them in the main method
  • Output their values
  • Call swapValues() aand output the swapped values
You might be interested in
What is the meaning of antimonographycationalis​
Oliga [24]

Answer:

Although this word was made up in order to be a contender for the longest word in English, it can be broken down into smaller chunks in order to understand it.

Anti- means that you are against something; monopoly means the exclusive control over something; geographic is related to geography; and the remaining part has to do with nationalism.

So this word means something like 'a nationalistic feeling of being against geographic monopoly,' but you can see that it doesn't have much sense.

(answer copied from  Kalahira just to save time)

3 0
3 years ago
Read 2 more answers
Multiple Intelligence Theory explains that...
Alex

Answer:

A. We all learn differently (edge 2020)

Explanation:

4 0
3 years ago
Read 2 more answers
______ define the primary functions of a server. A server with the Web Server (IIS) role installed is colloquially referred to a
3241004551 [841]

Answer:

The correct answer to the following question will be "Roles" and "Web server"

Explanation:

A web server seems to be a device that keeps software from the server as well as the feature or component folders from a website. This is hooked up to the web and facilitates the sharing of stored information with certain network linked computers.

  • Application roles apply to the functions the server or software will perform on your network— functions including a web server, a DHCP, file server or a DNS.
  • A website built with either the IIS function is responded to as either Web server in technical or common terms.

4 0
4 years ago
Create a python program that display this
aleksley [76]

Answer:

vxxgxfufjdfhgffghgfghgffh

4 0
3 years ago
Write some difference between the third and fourth generation of computer?​
Whitepunk [10]

Answer:

<em>third generation of computer are larger than fourth generation. they are slower than fourth generation. IC chips were used whereas in fourth generation microprocessor were used. fourth generation consumed less electricity than third generation.</em>

<h3>I HOPE THIS WILL HELP YOU IF NOT THEN SORRY</h3>

HAVE A GREAT DAY :)

4 0
3 years ago
Read 2 more answers
Other questions:
  • 50 pts
    12·2 answers
  • Which combination of factors would result in the lowest monthly mortgage payment?
    9·2 answers
  • A _____ is a group of two or more devices/computers connected together to allow for the exchange and information and for the sha
    5·2 answers
  • Where should i go if i want to begin learning how to code a video game. What are your recommendations to a 16 yr old to learn co
    13·1 answer
  • Design and implement a program (name it Youth) that reads from the user an integer values repressing age (say, age). The program
    6·1 answer
  • 6. How might you go about securing an internship or job on LinkedIn?
    14·2 answers
  • In which of the following careers are you most likely to do an apprenticeship?
    14·2 answers
  • Which of the following Web sites would be MOST credible?
    6·1 answer
  • What is one potential problem with the following loop? System.out.print("Enter integers. Enter -1 to exit."); System.out.println
    12·1 answer
  • How much time does a computer take to big calculations ?​
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!