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
Many company websites are now designed to do more than just sell a product. These​ websites, known as​ __________ websites, atte
Zinaida [17]

Answer:

brand community

Explanation:

Many company websites are now designed to do more than just sell a product. These​ websites, known as​ brand community websites, attempt to build closer customer relationships and generate engagement with and between the brand and its customers. These online communities bring together consumers who have shared interests in a brand or product. One advantage of online brand communities is that they reduce customer support costs as the business has more engagement with their customers.This also helps the business to retain customers through brand improvement centered around the customer's actual needs.

5 0
3 years ago
What does the acronym OSHA stand for? A. Occupational Safety and Health Administration B. Occupational Safety and Human Activiti
poizon [28]
The answer is A. Occupational Safety and health Administration.
4 0
3 years ago
Read 2 more answers
PART 2 - Exercise 2 - Programming Assignment
Oliga [24]

Suppose that a linked list is used as a data structure for the hash table, create a program that includes steps his application counts the number of phrases in documents decided on via way of means of the user #include.

<h3>What is Programming?</h3>

It is the manner of making hard and fast commands that inform a pc the way to carry out a task. Programming may be finished the usage of lots of pc programming languages, inclusive of JavaScript, Python, and C++.

  1. This application counts the quantity of phrases in documents decided on via way of means of the user.
  2. #include
  3. #include
  4. #include the usage of namespace std; //Function 1 int count(string word)go back word.size();
  5. }
  6. //Function 2
  7. int vowel(string word)> filename;
  8. //Open the {input|enter">enter file.
  9. inputfile.open(filename.c_str()); cout<<"nWord listing after format";
  10. cout<<"n____nn"; //If the file succesfully opened, process it.if (inputfile).

Read more about program :

brainly.com/question/1538272

#SPJ1

5 0
2 years ago
Your corporation hosts a Web site at the static public IP address 92.110.30.123.
ivann1987 [24]

Answer:

Check the explanation

Explanation:

In line with the question, we can now derive that:

The router's outside interface IP address will be 92.110.30.65.

The router's inside interface IP address will be 192.168.11.254.

The Web site's IP public IP address will be 92.110.30.123.

The private IP address of the backup Web server will be 192.168.11.110.

and when we say IP address, it stands for Internet Protocol, it is a set of usual predefined rules which are utilized to administrate the manner to which data packets are sent over the internet. An IP address, which is typically just identified as an IP, is a sequence of figures used to uniquely recognize a computer/device on a particular network or on the internet space.

7 0
3 years ago
Which tool helps a project manager identify the task that have been completed and the ones that are still outstanding
vodka [1.7K]

Answer:

timeline please make me branliest

4 0
2 years ago
Other questions:
  • How do you transfer music from external hard drive to a laptop?
    13·1 answer
  • What is Least effective at preventing a computer virus
    10·1 answer
  • Heavy use of computers, combined with information overload and 24/7 accessibility via technology, can lead to
    6·1 answer
  • Which computer device is used to capture or copy a photograph to place in a report?
    14·1 answer
  • Why do TV shows/Movies from the 90's and early 2000s look so much different compared to today?
    7·1 answer
  • I keep getting this error: postfix.cpp: In function ‘double RPN_evaluation(std::string)’: postfix.cpp:42:26: error: cannot conve
    7·1 answer
  • What is the ethical danger of using agents in negotiation?
    15·1 answer
  • Easy coding question, please help.
    13·1 answer
  • What is used to accurately position objects on the slide using a single horizontal and vertical line that intersects in the cent
    12·2 answers
  • Which of the following tabs on the Ribbon contains the commands for adding tables, pictures and shapes into a publication? Quest
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!