Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

C# program applies bonus points

using System;
 
class BonusScore
{
    static void Main()
    {
        Console.WriteLine("Please enter integer between 1 and 9: ");
        int a = int.Parse(Console.ReadLine());
 
        if (a == 1 || a == 2 || a == 3)
        {
            Console.WriteLine("The BONUS score is: {0}", (a * 10));
        }
        else if (a == 4 || a == 5 || a == 6)
        {
            Console.WriteLine("The BONUS score is: {0}", (a * 100));
        }
        else if (a == 7 || a == 8 || a == 9)
        {
            Console.WriteLine("The BONUS score is: {0}", (a * 1000));
        }
        else
        {
            Console.WriteLine("Invalid score!");
        }
    }
}
Source by forum.tutorials7.com #
 
PREVIOUS NEXT
Tagged: #program #applies #bonus #points
ADD COMMENT
Topic
Name
3+5 =