Part 2 – Automatic document generation
Your clients have requested a demonstration on the value of automatic document generation to be presented to their new junior programmers that have just begun working at the company. Attached is a C# program for a simple game that you are required to use to demonstrate this. You must replace the current inadequate comments with the C# XML comments. Your XML comments should contain examples of each of the following tags at the very least:
- <summary> and <remarks>
- <param> and <returns>
- <code>
- <see>
Note that your code does not have to compile but you could implement it in Visual Studio to iron out problems. Please note that you need to explain each of your C# XML comments. Comments without a good explanation will result in loss of marks and may not be marked entirely.
namespace Assign2
{
//
// This program is for CMP73010 Assignment 2 (2020)
//
// It calls some functions that need commenting
//
class Program
{
//
// Mainline function
//
static void Main(string[] args)
{
int num1 = ReadNumber();
int num2 = ReadNumber();
FormatBinary(num1, "+", num2, Add(num1,
num2)); Console.ReadLine();
}
//
// Read a single integer
//
public static int ReadNumber()
{
Console.Write("Number:
"); try
{
return Convert.ToInt32(Console.ReadLine());
}
catch (FormatException)
{
Console.WriteLine("illegal number
format"); return 0;
}
}
//
// Formatted operation output
//
public static void FormatBinary(int n1, string op, int n2, int result)
{
Console.WriteLine("{0} {1} {2} = {3}", n1, op, n2, result);
}
//
// Add two integers
//
public static int Add(int n1, int n2)
{
return n1 + n2;
}
}
}
Students succeed in their courses by connecting and communicating with an expert until they receive help on their questions
Consult our trusted tutors.