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
Lerok [7]
3 years ago
6

The variables xp and yp have both been declared as pointers to integers, and have been assigned values. Write the code to exchan

ge the two integers
Computers and Technology
1 answer:
shepuryov [24]3 years ago
6 0
The question is asking us to swap the values of xp and yp while not changing where they point to. Setting xp equal to yp would not work because then we couldn't change yp since the value for xp was overwritten. We can use a third variable to swap them.

int zp = xp;
xp = yp;
yp= zp;
You might be interested in
G i r l s o n l y j o i n <br> id= ons jcuv jke
Katyanochek1 [597]

Answer:

nooooooo

1.1431586352

4 0
3 years ago
Read 2 more answers
Write a method so that the main() code below can be replaced by simpler code that calls method calcMilesTraveled(). Original mai
patriot [66]

Answer:

See explanation

Explanation:

From the question, you have answered the question. However, it is poorly formatted.

<em>So, I'll help present the code properly and also give explanation using comments.</em>

import java.util.Scanner;

public class CalcMiles{

//This line defines the calcMilesTraveled method

private static double calcMilesTraveled(double milesPerhour, double minsTraveled){

//This declares hoursTraveled

double hoursTraveled;

//This declares milesTraveled

double milesTraveled;

<em>//This calculates the hoursTraveled</em>

hoursTraveled = minsTraveled/60.0;

//This calculates the milesTraveled

milesTraveled = hoursTraveled * milesPerhour;

//This returns the milesTraveled

return milesTraveled;

}

//The main method begins here

public static void main(String [] args){

//This declares and initializes milesPerhour

double milesPerhour =70.0;

//This declares and initializes minutesTraveled

double minutesTraveled = 100.0;

//This calls the calcMilesTraveled function and also prints the required result

System.out.println("Miles: "+calcMilesTraveled(milesPerhour, minutesTraveled));

}

}

<em>See attachment for program without comments</em>

Download txt
5 0
3 years ago
Write the sql command to show which tutor needs to be reminded to turn in reports.
NemiM [27]
SELECT TO_CHAR (Tutor Report.Month, 'MONTH') MONTH, Tutor Report.MatchID, Match History.MatchID, MatchHistory.Tutor.ID FROM Tutor Report, MatchID WHERE <span>Tutor Report.MatchID=Match History.MatchID AND NOT (TutorReport.Month=‘JULY’);</span>
4 0
3 years ago
What are the 6 external parts of a computer system
denis23 [38]
1. Monitor
2.C.P.U
3.Mouse
4. Keyboard
5. Printer
6. Speaker
4 0
3 years ago
What is the most recognized and widely used database of published nursing practice literature?
faust18 [17]
That would be the <span>Cumalitive Index to Nursing and Allied Health Literature.</span>
7 0
3 years ago
Other questions:
  • Assume that we have an application with a total of 500,000 instructions where 20% of them are the load/store instructions with a
    14·1 answer
  • A Windows application which demands a lot of raw processing power to execute repetitive complex calculations is a good candidate
    5·1 answer
  • When the continue statement is encountered in a loop, all the statements in the body of the loop that appear after it are ignore
    5·1 answer
  • A system administrator is selecting an operating system for use by the company’s research and development team. The team require
    15·1 answer
  • We define the following terms:
    11·1 answer
  • Java supports ________; collections of related methods that typically enable you to tell objects what to do, but not how to do i
    12·1 answer
  • Which of the following tools helps ensure your document will open in older versions of word
    13·1 answer
  • Cómo se llaman los robots que se utilizan para la exploración espacial, en medicina, en la industria, en la agricultura, los que
    13·1 answer
  • In this exercise, you are asking the user to set a alpha numeric password for any website. Put some conditions.
    8·1 answer
  • In a selection, the else clause executes ______________. a. always b. when the tested condition is false c. when the tested cond
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!