Answer to Question #38393 in C# for Justin Murupel

Question #38393
In the written examination conducted by WebSoft Solutions Pvt. Ltd., candidates are given certain
advanced C# codes. They are asked to find the errors in the code (if any) and predict the output of
the code. You are one of the candidates appearing at the interview. Optimize the code, find out the
errors (if any), and predict the output of the following code snippet: [10 Marks]
using System;
class Student
{
private string name = "Marcus Trott";
private double marks = 65.0;
public void DispName()
{
System.Console.WriteLine("Name: ",; name);
}
public void DispMarks()
{
System.Console.WriteLine("Marks: ", marks);
}
}
class MainClass
{
static void Main()
{
Student s= new Student();
string n = s.DispName();
double m= s.marks;
}
}
1
Expert's answer
2014-01-16T08:24:50-0500
The answer to the question is available in the PDF file https://www.assignmentexpert.com/https://www.assignmentexpert.com/homework-answers/programming-answer-38393.pdf

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS