Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

C#!! simplest form to enter into the mindtap website Programming Exercise 8-1A D

ID: 3704934 • Letter: C

Question

C#!! simplest form to enter into the mindtap website

Programming Exercise 8-1A Due Today at 11:59 PM CDT Create a program named Reverses whose Main) method declares three integers named firstInt, niddleInt , and lastInt . +Reverse3.cs 1 using static System.Console; 2 class Reverse3 Assign the following values to the integers: 4 static void Main() 23 to firstInt // Write your main here 7 45 to middleInt 67 to lastInt public static void Reverse(ref int a, ref int b, ref int c) 9 10 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 12 13 In the Main() method, display the three variables again, demonstrating that their positions have been reversed Run Code TestGrade

Explanation / Answer

using System.IO;
using System;

class Reverse3
{
static void Main()
{
Console.WriteLine("Enter the first integer: ");
int firstInt = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Enter the second integer: ");
int middleInt = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Enter the third integer: ");
int lastInt = Convert.ToInt32(Console.ReadLine());
Reverse(ref firstInt,ref middleInt,ref lastInt);
Console.WriteLine("After reverse: ");
Console.WriteLine(firstInt+" "+ middleInt+" "+lastInt);
  
}
public static void Reverse(ref int a, ref int b, ref int c ) {
int t = a;
a=c;
c=t;
}
}

Output: