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
______ behavior expected from every professional​
Shalnov [3]

Answer:

Respectful

Explanation:

3 0
3 years ago
You are working with an older relative who is writing their last will and testament and you two are sharing the document back an
zloy xaker [14]

Answer:

In word there is a setting where you can mange all of user's permission in the document. These are a few permission settings: Read only and Can edit.

6 0
3 years ago
Ferestre de navigare
Stells [14]
LOLOLOLOLOLLOLOLOLOLOLOOOLOLOLOOLOLLOLOLOLOLOLO

7 0
3 years ago
When is a wired connection preferred to a wireless connection by an end-user device?
harkovskaia [24]

Answer:

Option (b) When the end-user device will run an application that requires a dedicated connection to the network

Explanation:

  • Option (b) is the correct option.
  • When the user device requires a highly dedicated network environment to itself to run a web application that requires large download and upload speeds, bandwidth requirements then it prefers a wired connection than a wireless connection.
  • If the wireless signal is within the reach, then it advisable to go for a wireless connection than a wired connection. A wired connection requires other hardware equipments like a internet connection cable etc. which is not required in case of wireless connection. So, option (a) is wrong option.
  • WLAN NIC is a wireless interface network controller that connects to a wireless radio based network than a wired network.So, option (c) is wrong option.
  • Delay torrent network is designed to operate where continuous network connectivity is not available like extreme terrestrial spaces, space communications, inter planetary communications etc.So, option (d) is wrong option.
6 0
3 years ago
An example of software is a
Veseljchak [2.6K]

Answer: false

Explanation:

5 0
2 years ago
Other questions:
  • Wordwrap forces you to stop typing words and press the enter key at the end of each line.
    12·1 answer
  • Write a method so that the main() code below can be replaced by the simpler code that calls method mphandminutestomiles(). origi
    14·2 answers
  • Blank includes websites that encourage interaction and connection among people ,business and organizations
    13·1 answer
  • ________ is a set of rules for exchanging files such as text, graphic images, sound, video, and other multimedia files on the we
    14·1 answer
  • Instructions
    12·1 answer
  • Wite 3 names of computers used in 1st generation of computers?
    12·1 answer
  • Can Word Processing (WP) programs be used for DTP? Explain your answer
    7·1 answer
  • Imagine that you have a friend who has expressed interest in designing and programming video games. He loves to play video games
    10·1 answer
  • Hi, I just have a few questions from my digital tech assignment.
    14·2 answers
  • . It has been said that technology will be the end of management. Maybe. How about artificial intelligence
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!