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
zaharov [31]
3 years ago
13

Given two double variables, best value and second best value, write some code that swaps their values. declare any additional va

riables as necessary.
Computers and Technology
1 answer:
nikitadnepr [17]3 years ago
4 0
As I say to any people requesting programming help on these forums, I always suggest that you include what language you're using in the question, otherwise you may not get the answer you're looking for.

Here's an example in C++, and note that I'm only showing the function, and not the entire code:


static void swap(double& one, double& two)
{
    double temp = one;
    one = two;
    two = temp;
}
You might be interested in
The 'client area' of a window is the area used to display the contents of the window (thus a title bar or border would lie outsi
Lady_Fox [76]

Answer:

<u>Window.java</u>

  1. public class Window {
  2.    int width;
  3.    int height;
  4.    public Window(int width, int height){
  5.        this.width = width;
  6.        this.height = height;
  7.    }
  8.    public int getWidth(){
  9.        return width;
  10.    }
  11.    public int getHeight(){
  12.        return height;
  13.    }
  14.    public int getClientAreaHeight(){
  15.        return getHeight();
  16.    }
  17. }

<u>Main.java</u>

  1. public class Main {
  2.    public static void main (String [] args) {
  3.        Window win1 = new Window(12, 15);
  4.        System.out.println(win1.getClientAreaHeight());
  5.    }
  6. }

Explanation:

<u>Window.java</u>

There is a Window class with two int type attributes, width and height (Line 1 - 3).

The constructor of this class will take two inputs, width and height and set these input to its attributes (Line 5 - 8). There are two methods getWidth and getHeight which will return the value of attributes width and height, respectively (Line 10 - 16).

The required new method getClientAreaHeight is defined in line 18 -20. This method will call the getHeight method to return the height value of the window (Line 19).

<u>Main.java</u>

We test the Window class by creating one Window instance and call the getClientAreaHeight method and print the return output (Line 1 -6).

We shall see 15 is printed.

4 0
3 years ago
In which of the following situations would you want to use a word processing template?
creativ13 [48]
<h2>Answer:</h2>

<u>The correct answer is A. </u><u>You need to write a letter to a company you’d like to work with, and have specific questions to ask.</u>

<h2>Explanation:</h2>

Applying for a job is a very formal type of document which contains all the required and necessary information about a person who wants to apply. So a letter is typed in Microsoft word format to keep the document aligned and beautiful. Word template can make it professional which otherwise becomes hard to apply for a job in the absence of quality editing.

5 0
3 years ago
Read 2 more answers
Differences between windows xp and windows vista
krek1111 [17]
Well since Windows XP runs on Windows 2000 technology,it would be "slow".Also that Windows XP had MSN,which expired 15 years ago,but the good thing about Windows XP is that it can connect to the internet via WiFi without the computers hardware used for WiFi(PC only).Also that Windows XP has a logo on the start-up screen.Windows Vista on the other hand, doesn't have a logo on the start-up screen,but shows a Windows Vista animated logo atfer the start-up screen.Also that some people named Windows Vista "The first Windows 7".But somewhat,Windows Vista ran faster than Windows XP at starting up.Windows Vista was old,but it sold better than Windows XP.
6 0
3 years ago
Generally, what is the term for storage locations in a processor?
oksano4ka [1.4K]

Answer: Registers

Explanation:

Registers are small storage locations identified by different types of registers. The function of the register is to provide data for immediate processing to the CPU. These registers hold data temporarily and provide easy access of data to the processor.

6 0
3 years ago
Select the correct statement below about database services or database instances:
Zigmanuir [339]

The correct statement about database services or database instances is

( B).<u>An instance of the cloud database operates as a service that handles all application requests to work with the data in any of the databases managed by that instance.</u>

<u />

Explanation:

An instance of the Database Engine can be defined as a service that <u>all application requests to work with the data in any of the databases managed by that instance.The data can be on the same system or can be on another system </u>

So in case of a Cloud based database engine

( B).<u>An instance of the cloud database operates as a service that handles all application requests to work with the data in any of the databases managed by that instance.</u>

<u />

8 0
3 years ago
Other questions:
  • I need some cool things to do with windows command prompt.
    13·1 answer
  • What are the uses of joystick​
    13·1 answer
  • What is a VIN and what role does it play during a criminal investigation? Explain how a VIN could help in a bomb and/or arson ca
    12·1 answer
  • Write a program that asks the user to enter a whole number then outputs a 0 if the number is even or a 1 if the number is odd. (
    14·1 answer
  • Which of the following laptop features allows users to overcome keyboard size restrictions?
    11·1 answer
  • If wire rope guard rails are used what must also be done?
    10·1 answer
  • 6 external parts of computer
    10·2 answers
  • How do I give Brainliest? Will give brainliest when I figure out how
    8·2 answers
  • Vannevar Bush imagined a desktop computing machine that would allow people to access data stored in various information centers
    13·1 answer
  • Define CPU and its functions​
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!