Could you please help me debug the code below? Thanks. using System; public clas
ID: 3618945 • Letter: C
Question
Could you please help me debug the code below? Thanks. using System;public class PassArrayElement
{
public static void Main()
{
int [] someNums = {10,12,22,35};
int x;
Console.Write(" At Beginning of Main() method...");
for(x = 0; x < someNums.Length; ++x)
Console.Write("(0,6)", someNums[x]);
Console.WriteLine();
for (x = 0; x < someNums.Length; ++x)
MethodGetsOneInt(someNums[x]);
Console.Write("At end of Main()method.....");
for (x = 0; x < someNums.Length; ++x)
Console.Write("(0,6)", someNums[x]);
}
public static void MethodGetsOneInt(int oneVal)
{
Console.Write("In MethodGetsOneInt() {0}", oneVal);
oneVal = 999;
Console.WriteLine(" Afterchange {0}", oneVal);
}
} Could you please help me debug the code below? Thanks. using System;
public class PassArrayElement
{
public static void Main()
{
int [] someNums = {10,12,22,35};
int x;
Console.Write(" At Beginning of Main() method...");
for(x = 0; x < someNums.Length; ++x)
Console.Write("(0,6)", someNums[x]);
Console.WriteLine();
for (x = 0; x < someNums.Length; ++x)
MethodGetsOneInt(someNums[x]);
Console.Write("At end of Main()method.....");
for (x = 0; x < someNums.Length; ++x)
Console.Write("(0,6)", someNums[x]);
}
public static void MethodGetsOneInt(int oneVal)
{
Console.Write("In MethodGetsOneInt() {0}", oneVal);
oneVal = 999;
Console.WriteLine(" Afterchange {0}", oneVal);
}
}
Explanation / Answer
This program is working fine for me. What is the problem? Can youplease post more details..
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.