Answer to Question #305085 in C# for DOHC 44

Question #305085

Using Visual Studio, create a new Console App project.



Write a program that:



Asks the user to enter the final mark for a module; and



Displays the module result based on the following rules:



0 to 48 (inclusive) means the result is failed;



49 means that the result is passed (condoned);



50 to 73 means that the result is passed;



74 means that the result is distinction (condoned); and



75 to 100 means that the result is distinction.

1
Expert's answer
2022-03-03T10:00:03-0500
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();
        }
 
    }
}

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