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
You create a storyboard at the _____ stage of web development
ddd [48]

Answer:

initial stage of web development.

4 0
3 years ago
Read 2 more answers
what types of physical drives does windows disable defragmenting, but provides another method of optimization?
Anika [276]

The type of physical drives does windows disable defragmenting, but provides another method of optimization is known as windows.

<h3>What is windows?</h3>

It should be noted that windows is a separate viewing area on a computer display screen in a system.

In this case, the type of physical drives does windows disable defragmenting, but provides another method of optimization is known as windows.

Learn more about window on:

brainly.com/question/25243683

#SPJ12

4 0
1 year ago
Difference between server and a client computer
maw [93]

Answer:

A server stores data for a client computer to access and use, and pretty self eplanitory for a client computer

Explanation:

5 0
2 years ago
As Kaydence reads a chapter in her anthropology text, she draws a network diagramming the relationships among the concepts descr
german

Answer:

visual encoding

Explanation:

According to my research on the three types of encoding methods, I can say that based on the information provided within the question Kaydence is best described as capitalizing on visual encoding. Which is the act of associating a certain something with a picture in order to store it into memory, as opposed of associating it with sound or words. In this situation Kaydence is associating it with a networking diagram she drew.

I hope this answered your question. If you have any more questions feel free to ask away at Brainly.

5 0
3 years ago
Write a pyhton program to calculate area of a circle?
marta [7]

Answer:

The code to calculate the area of a circle is:

from math import pi

def circleArea(radius):

 if radius > 0:

   return pi * (radius ** 2)

 else:

   return None

if __name__ == '__main__':

 radius = 5

 print("Radius: {} Area: {}".format(radius,circleArea(radius)))

Explanation:

A detailed explanation of each line of code is given below.

#Define the number pi used to calculate the area

from math import pi

#We define a function that calculates the area of a circle

def circleArea(radius):

#Check if the radius is valid ( radius > 0) since there aren´t negative radius

 if radius > 0:

#Compute the area formula for a circle \pi * radius^{2}

   return pi * (radius ** 2)

 else:

#Return None if the radius is invalid

   return None

#Run the function we´ve defined

if __name__ == '__main__':

#Define a radius

 radius = 5

#Call the function and parse the radius through it, then print the result

 print("Radius: {} Area: {}".format(radius,circleArea(radius)))

8 0
3 years ago
Other questions:
  • Where does the VLookup function find its lookup values?
    14·1 answer
  • The following algorithm should output the t times table in the format:
    6·1 answer
  • When you select the data range for a pie chart, you should be sure to include the total cell on the worksheet?
    13·1 answer
  • An administrator running a port scan wants to ensure that no processes are listening on port 23. What state should the port be i
    7·1 answer
  • What can act as a buffer against unemployment
    11·1 answer
  • Describe any five GSM PLMN basic services?
    10·1 answer
  • Create a Divisible application that displays a random integer between 1 and 100 and displays appropriate messages stating whethe
    5·1 answer
  • Which storage device is not recommended as a permanent storage solution?
    6·1 answer
  • The final step in the object-oriented design (ood) process consists of developing the?
    7·1 answer
  • Looking for similarities between concepts or problems is referred to as
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!