Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

C# program applies bonus points

using System;
 
class BonusNumber
{
    static void Main()
    {
        Console.WriteLine("Please write a number between 1 and 9: ");
        int a = int.Parse(Console.ReadLine());
 
        switch (a)
        {
            case 1:
            case 2:
            case 3:
                Console.WriteLine("The BONUS score is: " + (a * 10));
                break;
            case 4:
            case 5:
            case 6:
                Console.WriteLine("The BONUS score is: " + (a * 100));
                break;
            case 7:
            case 8:
            case 9:
                Console.WriteLine("The BONUS score is: " + (a*1000));
                break;
            default:
                Console.WriteLine("Invalid Score!");
                break;
 
        }
    }
}
Source by forum.tutorials7.com #
 
PREVIOUS NEXT
Tagged: #program #applies #bonus #points
ADD COMMENT
Topic
Name
8+4 =