Answer to Question #285450 in C# for Tokie

Question #285450

Create a program that will ask a user to enter a number of tokens he/she want's to buy and displays

*the amount to pay

*total tokens acquired

*how many paid tokens

*and number of free tokens


1
Expert's answer
2022-01-07T01:50:47-0500
using System;
using System.Collections.Generic;


namespace App
{


    class Program
    {
        public static void Main()
        {


            Console.Write("Enter a number of tokens you want to buy: ");
            int numberTokens = int.Parse(Console.ReadLine());




            Console.WriteLine("The amount to pay {0}", (numberTokens * 10));
            Console.WriteLine("Total tokens acquired {0}", (numberTokens));
            Console.WriteLine("How many paid tokens {0}", (int)(numberTokens*0.1));
            Console.WriteLine("The number of free tokens {0}", (int)(numberTokens * 0.2));




            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