Using Visual Studio, create a new Console App project.
Write a program that:
a. Asks the user to enter the final mark for a module; and
b. Displays the module result based on the following rules:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp2
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Please enter final mark for a module: ");
int mark = Convert.ToInt32(Console.ReadLine());
if (mark >= 0 && mark <= 48)
{
Console.WriteLine("Failed");
}
else if (mark == 49)
{
Console.WriteLine("Passed (condoned)");
}
else if (mark >= 50 && mark <= 73)
{
Console.WriteLine("Passed");
}
else if (mark == 74)
{
Console.WriteLine("Distinction (condoned)");
}
else if (mark >= 75 && mark <= 100)
{
Console.WriteLine("Distinction");
}
Console.ReadKey();
}
}
}
Comments
Leave a comment