Answer to Question #227573 in C# for Stan

Question #227573

Write a brief C# script that multiplies the number of recruits by 5 and stores it as the players score. The script should also deduct points when the number of recruits falls below 10 (assuming that the player is part of the team).


1
Expert's answer
2021-08-19T14:32:24-0400
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Text.RegularExpressions;


namespace Q227573
{
    class Program
    {
        static void Main(string[] args)
        {


            Console.Write("Enter the number of recruits: ");
            int numberRecruits;
            int totalScores;
            int.TryParse(Console.ReadLine(), out numberRecruits);
            //multiplies the number of recruits by 5 and stores it as the players score.
            totalScores = numberRecruits * 5;
            //deduct points
            if (numberRecruits < 10)
            {
                totalScores -= (10 - numberRecruits);
            }
            Console.WriteLine("Total scores: {0}", totalScores);


            Console.ReadLine();
        }
    }
}

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