Answer to Question #304720 in C# for kun

Question #304720

People who earn less than R6 000.00 do not pay tax. Write a program that reads in a person’s salary. If he earns R6 000.00 or more, the program must request the percentage tax the person pays. The program must then finally display one of the following messages (as an example): For a person who earns R1500.00 You do not pay tax, and your final payout is R1500.00 For a person who earns R8200.00 and whose tax is 10% You pay R820.00 tax, and your final payout is R7380.00


1
Expert's answer
2022-03-03T09:58:57-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 salary: ");
            int salary = Convert.ToInt32(Console.ReadLine());

            if (salary > 6000)
            {
                Console.WriteLine("Please enter person's tax: ");
                int tax = Convert.ToInt32(Console.ReadLine());
                decimal pay = salary / 100 * tax;
                Console.WriteLine("Your tax: {0}, final payout: {1}", pay, salary - pay);
            }
            else
            {
                Console.WriteLine("Final payout: {0}", salary);
            }

            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