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
Elanso [62]
3 years ago
9

Create a program named Reverse3 whose Main() method declares three integers named firstInt, middleInt, and lastInt. Assign the f

ollowing values to the integers: 23 to firstInt 45 to middleInt 67 to lastInt Then display the values and pass them to a method named Reverse that accepts them as reference variables, places the first value in the lastInt variable, and places the last value in the firstInt variable.
Computers and Technology
1 answer:
Elodia [21]3 years ago
7 0

This question is incomplete. The complete question is given below:

Create a C# Console program named Reverse3 whose Main() method declares three integers named firstInt, middleInt, and lastInt.

Assign the following values to the integers:

23 to firstInt

45 to middleInt

67 to lastInt

Then display the values and pass them to a method named Reverse that accepts them as reference variables, places the first value in the lastIntvariable, and places the last value in the firstInt variable.

In the Main() method, display the three variables again, demonstrating that their positions have been reversed.

using static System.Console;

class Reverse3

{

static void Main()

{

// Write your main here

}

public static void Reverse(ref int a, ref int b, ref int c)

{

}

}

Answer:

using static System.Console;

class Reverse3

{

      static void Main()

       {

           int firstInt = 23;

           int middleInt = 45;

           int lastInt = 67;

           Console.WriteLine("Before reversing: firstInt: " + firstInt + ", middleInt: " + middleInt + ", lastInt: " + lastInt);

           Reverse(ref firstInt, ref middleInt, ref lastInt);

           Console.WriteLine("After reversing: firstInt: " + firstInt + ", middleInt: " + middleInt + ", lastInt: " + lastInt);

       }

       public static void Reverse(ref int a, ref int b, ref int c)

       {

           int temp = c;

           c = a;

           a = temp;

       }

}

Explanation:

Inside the main() method, initialize the variables firstInt, middleInt, lastInt with 23, 45 and 67 respectively. Then print the values of all these variables on the console. Call the Reverse method and pass these variables as references. Print the updated values of all these variables on the console.

Inside the Reverse method, swap the values of firstInt with the lastInt by initializing the temp variable with c.

Output:

Before reversing: firstInt: 23, middleInt: 45, lastInt: 67

After reversing: firstInt: 67, middleInt: 45, lastInt: 23

You might be interested in
Which of the following is an example of a wanted versus I need
Svetlanka [38]
B. cable tv. Everyone can live without tv
you need food and shelter to live and insurance is more necessary than tv
4 0
4 years ago
Extend the flow properties and definitions to the multiple-source, multiple- sink problem. Show that any flow in a multiple-sour
Mkey [24]

Answer:

We add a super source s and add a directed edge (s, si) with capacity c(s, si) = ∞ for each i = 1, 2, . . . , m. We also create a new super sink t and add a directed edge (ti, t) with capacity c(ti, t) = ∞ for each i = 1, 2, . . . , n. The single source s simply provides as much flow as desired for the multiple sources si, and the single sink t likewise consumes as much flow as desired for the multiple sinks ti.

Because the virtual edges of s and t can consume as much flows as they want, they don't influence the actual edges.

Explanation:

7 0
4 years ago
How do you flatten a 2D array to become a 1D array in Java?
Leni [432]

Answer:

With Guava, you can use either

int[] all = Ints.concat(originalArray);

or

int[] all = Ints.concat(a, b, c);

Explanation:

Use GUAVA

4 0
2 years ago
Write a method public static ArrayList merge(ArrayList a, ArrayList b) that merges two array lists, alternating elements from bo
bogdanovich [222]
The answer would be 798 since all of them combined with the square root dividing it would give you that.
4 0
4 years ago
he wants to customize the operating system to meet his needs. what types of tools should he use, and what can he do with each?
Dennis_Churaev [7]

Answer:

remastering iso image

Explanation:

you  can add the gui, default installed program, etc

3 0
3 years ago
Other questions:
  • Consider the following scenario and prescribe a solution. Situation: Tenisha is moving to Ohio to attend college. It is very hum
    15·1 answer
  • What port does the DarkComet malware listen on?
    15·1 answer
  • Traditional methods of business communication tend to mean paper-based messages such as formal letters, brochures, reports, prop
    10·1 answer
  • An administrative assistant types a document, saves, and prints. The assistant is using _____.
    13·1 answer
  • Which is the most efficient way to make the text in a row bold in every worksheet in the file?
    12·2 answers
  • You dad has given you his old digital scanner for your new computer. you plug it into the usb drive on your windows 8 computer b
    8·1 answer
  • What G-Suite Apps integrate with Forms
    14·2 answers
  • Jared is a corporate trainer who creates presentations to deliver at workshops. When creating these
    8·1 answer
  • Elena wrote the following code in Scratch to have the sprite move and then turn around. However, the code does not work as expec
    5·1 answer
  • Why would internet speed test be different on same network
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!