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
dsp73
3 years ago
7

Write a program whose input is two integers and whose output is the two integers swapped. Place the values in an array, where x

is position 0 and y is position 1.Ex: If the input is: 3 8 then the output is: 83 Your program must define and call a method: public static void swapValues (int[] "values) LabProgram.java 1 import java.util.Scanner; 23 public class LabProgram 4 5 /* Define your method here 6 7 public static void main(String[args) { 8 /* Type your code here. / 9 } 10 } 11
Computers and Technology
1 answer:
allochka39001 [22]3 years ago
8 0

Answer:

import java.util.*;

import java.lang.*;

import java.io.*;

class Codechef

{ public static void swapValues(int[] values)

{int temp= values[0];

values[0]=values[1];

values[1]=temp;

System.out.print(values[0]+" "+values[1]);}

public static void main (String[] args) throws java.lang.Exception

{

Scanner sc= new Scanner(System.in);

int A[] = new int[2];

A[0] = sc.nextInt();

A[1]= sc.nextInt();

swapValues(A);

}

}

Input:-

3   8

Output:-

8   3

Input:-

1    2

Output:-

2   1

You might be interested in
A location in memory which stores a value, the value can change as the program is running is
sergejj [24]

Answer:

A location in memory which stores a value, the value can change as the program is running is known as a variable.

8 0
3 years ago
What do you understand by main document and data source
Oksana_A [137]

Answer:

The data source is a document, spreadsheet or database that contains personalized information such as names, addresses, and phone numbers. The Main Document can be a Form Letter, Labels, Email, or Directory.

<h2>Please mark me as brainliest</h2>

6 0
3 years ago
What are the 3 symbols that can’t be used when saving a document? (From Microsoft Word 2016) (pls helped me!)
Charra [1.4K]

Answer:

\, /, -

Explanation:

The three symbols are forward slash, backward slash, and the hyphen. These were allowed in previous versions of the MS Word. However, since the MS Word 2016 and a little earlier, these three symbols have been banned. And you will immediately get a message if you use these, to correct, and only then the file will be saved with that new name, and that must not have the forward or backward slash or the hyphen.

6 0
4 years ago
Write a statement to add the key Tesla with value USA to car_makers. Modify the car maker of Fiat to Italy. Sample output for th
shutvik [7]

Answer:

car_makers = {'Acura':'Japan','Fiat':'Egypt'}

car_makers['Tesla'] = "USA"

car_makers['Fiat'] = "Italy"

print("Acura made in",car_makers['Acura'])

print("Fiat made in",car_makers['Fiat'])

print("Tesla made in",car_makers['Tesla'])

Explanation:

The first line is a define object in the python code, containing two entries of Acura and Fiat and their respective countries.

The python code adds an entry to the object "car maker" using the bracket notation, the tesla car from USA.

The country of the Fiat car is changed from Germany to Italy, using the bracket notation.

The output of the complete object and the individual cars is given.

output of the python code:

{'Acura': 'Japan', 'Fiat': 'Italy', 'Tesla': 'USA'}

Acura made in Japan

Fiat made in Italy

Tesla made in USA.

4 0
3 years ago
To create an effective study schedule, a student must guess the amount of time needed for studying. write down all activities an
Inessa [10]

Answer:

B) write down all activities and commitments

Explanation:

It seems the most logical.

3 0
3 years ago
Read 2 more answers
Other questions:
  • What symbol following a menu command lets you know that a dialog box will be displayed?
    14·1 answer
  • PLEASE HELP!!!!!!!!!!!
    7·1 answer
  • Whats the agenda for annual general meeting ??
    10·1 answer
  • 2min speech on can teachers be replace by technology​
    5·1 answer
  • Since we know that this particular instance of the AppMaker implements a customer-facing store that processes financial transact
    6·1 answer
  • In a sport like baseball, which of the following could be considered a “rule”?
    12·1 answer
  • A boundary marks the inside and outside of a system and sets the system apart from its environment.
    11·1 answer
  • Which of the following You tubers uses the word "flip" as a curse word
    8·2 answers
  • NAT addresses concerns over the dwindling IPv4 address space by ___________________. 1 point allowing networks to use fewer IP a
    15·1 answer
  • Which of the following variables are string types?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!