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
Good keyboarding technique includes ________
Svetlanka [38]

Answer:

Keeping you hands on the homerow keys

Explanation:

3 0
2 years ago
Read 2 more answers
A network administrator identifies sensitive files being transferred from a workstation in the LAN to an unauthorized outside IP
Sav [38]

Answer:

D. Zero-day

Explanation:

It is clearly stated that the antivirus is still up-to-date on the workstation, and there has been no alterations to the firewall. Hence, this means the software is functional and up-to-date with all known viruses. This shows that this attack is unknown to the manufacturer of the antivirus software and hence no virus definition or patch fixing this problem has been developed yet. In this light, it is a zero-day.

A zero-day is a type of vulnerability in a software that is not yet known to the vendor or manufacturer, hence this security hole makes the software vulnerable to attackers or hacker before it is been fixed.

4 0
3 years ago
SMART PEOPLE NEEDED
mario62 [17]
D doesn't make much sense, it's valid, but not what we're looking for. B also has a correlation with D, same reasoning applies. As for A, it seems pretty legit, but I don't believe that's what we're looking for.

Choice C is the most obvious one though. We're talking about a network and as may or may not know it's a wireless one in a manner of speaking. A <span>couple of computers in the network that have trouble maintaining a signal will indefinitely lead to failure of a network since both the links and nodes of certain computer systems are incapable of maintaining a signal. </span>
6 0
2 years ago
Help me guys pleassssssssse​
Readme [11.4K]

Answer:

is there a word bank??

Explanation:

8 0
2 years ago
g Suppose the vertex data is stored in an array named verts and each vertex uses a list to store the coordinates. Write the code
kodGreya [7K]

Answer:

function createAndFillBufferObject(gl, data) {

 var buffer_id;

 // Create a buffer object

 buffer_id = gl.createBuffer();

 if (!buffer_id) {

   out.displayError('Failed to create the buffer object for ' + model_name);

   return null;

 }

 // Make the buffer object the active buffer.

 gl.bindBuffer(gl.ARRAY_BUFFER, buffer_id);

 // Upload the data for this buffer object to the GPU.

 gl.bufferData(gl.ARRAY_BUFFER, data, gl.STATIC_DRAW);

 return buffer_id;

}

3 0
3 years ago
Other questions:
  • What is secondary exchange ? - Apex
    14·1 answer
  • If a company's IS-related programs are not developed in-house, then the development group of the IS department will be staffed p
    6·1 answer
  • You are working in the media industry, and you have created a web application where users will be able to upload photos they cre
    5·2 answers
  • If you have a field that needs a unique number that's one greater than the last field entry, what field type would you typically
    6·1 answer
  • Melanie needs to ensure that readers are able to locate specific sections within a document easily. What should she include in
    8·1 answer
  • If you are going to refer to a few dozen classes in your application, how do<br> you do it?
    6·1 answer
  • Which one is the answer for the question.
    11·1 answer
  • Rebbeca has finished with the research and outline portion of her slide presentation. Now, the next logical step is to begin wor
    11·1 answer
  • What will be the result from running the following program?
    6·1 answer
  • State four input device that are used for playing gaming programs​
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!