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
A computer's CPU and hard drive are found in the
Galina-37 [17]
A computers CPU and the hard drive are found in the system unit. The correct answer is C. <span />
8 0
3 years ago
Read 2 more answers
You've formatted the first paragraph of a document. What button can you use to apply the formatting from the first paragraph to
julia-pushkina [17]
All formatting for a paragraph is stored in the paragraph mark and carried to the next paragraph when you press the Enter<span> key. </span>
6 0
3 years ago
The period of time during which an IDPS monitors network traffic to observe what constitutes normal network behavior is referred
horrorfan [7]

Answer: Training period

Explanation:

The training period is refers to the period of time where we can monitor all the network traffic and also observe all the networking behavior with the constitute.

  • During the training period we get a proper training about the specific topic and also get a chance to learn various types of things.

 According to the given question, in the training period an IDPS monitor is used observing the networking traffic and the network behavior. Therefore, raining period is the correct answer.

 Therefore, Training period is the correct answer.

5 0
3 years ago
Which of the following IS a positive effect<br> of the use of personal communication devices?
Goshia [24]

a) Personal communication devices are used in healthcare for sending e-mails or messages to healthcare members.

b) They use these devices for calculations.

c)They can access work related medical information by using mobiles.

2) Personal communication devices use at work has positive effect on their work including reducing stress, benefiting patients care improving coordination of patient care among the healthcare team or increases unit team work.

5 0
2 years ago
In order for storage devices to be prepared for use, they must be ____________ Group of answer choices pre-prepared loaded initi
svetlana [45]

Answer:

formatted

Explanation:

In order for storage devices to be prepared for use, they must be formatted.

7 0
3 years ago
Read 2 more answers
Other questions:
  • Which element of the security policy framework requires approval from upper management and applies to the entire organization?A.
    5·1 answer
  • Researchers conducted a 'natural experiment' to examine the effects of on-site food services on weight gain among first-year col
    13·1 answer
  • The company where Derek works has tasked him with setting up and securing a SOHO router. He wants to make sure the wireless netw
    7·1 answer
  • What is the simplest way to permanantly get rid of an unwanted file
    14·1 answer
  • In ____________________ testing, security personnel simulate or perform specific and controlled attacks to compromise or disrupt
    10·1 answer
  • Digital citizenship is both a right and a {Blank}.
    11·2 answers
  • A local bank has an in-house application which handles sensitive financial data in a private subnet. After the data is processed
    15·1 answer
  • Nog
    8·1 answer
  • 40 points
    5·2 answers
  • What are you win your good at tech
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!