fork download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace _2_6
  8. {
  9. internal class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. double price, total;
  14. Console.WriteLine("******************************");
  15. Console.WriteLine(" Program Laundty Fee ");
  16. Console.WriteLine("******************************");
  17. // Input customer details
  18. Console.Write("code: ");
  19. string CODE = Console.ReadLine();
  20.  
  21. Console.Write("name: ");
  22. string NAME = Console.ReadLine();
  23.  
  24. Console.Write("Enter quantity of clothes: ");
  25. int QUANTITY = int.Parse(Console.ReadLine());
  26.  
  27. // Variable to store the laundry price
  28. double PRICE = 0.0;
  29.  
  30. // Calculate laundry cost
  31. if (QUANTITY >= 1 && QUANTITY <= 100)
  32. {
  33. PRICE = 200.0; // Fixed price for 1-100 pieces
  34. }
  35. else if (QUANTITY >= 101 && QUANTITY <= 300)
  36. {
  37. PRICE = 300.0; // Fixed price for 101-300 pieces
  38. }
  39. else if (QUANTITY >= 301 && QUANTITY <= 500)
  40. {
  41. PRICE = 500.0; // Fixed price for 301-500 pieces
  42. }
  43. else if (QUANTITY > 500)
  44. {
  45. PRICE = 500.0 + (QUANTITY - 500) * 5.0; // Additional charge for pieces above 500
  46. }
  47.  
  48. // Display results
  49. Console.WriteLine("\n===== Laundry Service Receipt =====");
  50. Console.WriteLine("Customer Code: " + CODE);
  51. Console.WriteLine("Customer Name: " + NAME);
  52. Console.WriteLine("Quantity of Clothes: " + QUANTITY + " pieces");
  53. Console.WriteLine("Total Laundry Cost: " + PRICE.ToString("F2") + " THB");
  54.  
  55.  
  56. }
  57. }
  58. }
Success #stdin #stdout 0.02s 25724KB
stdin
Standard input is empty
stdout
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _2_6
{
    internal class Program
    {
        static void Main(string[] args)
        {
            double price, total;
            Console.WriteLine("******************************");
            Console.WriteLine("      Program Laundty Fee     ");
            Console.WriteLine("******************************");
            // Input customer details
            Console.Write("code: ");
            string CODE = Console.ReadLine();

            Console.Write("name: ");
            string NAME = Console.ReadLine();

            Console.Write("Enter quantity of clothes: ");
            int QUANTITY = int.Parse(Console.ReadLine());

            // Variable to store the laundry price
            double PRICE = 0.0;

            // Calculate laundry cost
            if (QUANTITY >= 1 && QUANTITY <= 100)
            {
                PRICE = 200.0; // Fixed price for 1-100 pieces
            }
            else if (QUANTITY >= 101 && QUANTITY <= 300)
            {
                PRICE = 300.0; // Fixed price for 101-300 pieces
            }
            else if (QUANTITY >= 301 && QUANTITY <= 500)
            {
                PRICE = 500.0; // Fixed price for 301-500 pieces
            }
            else if (QUANTITY > 500)
            {
                PRICE = 500.0 + (QUANTITY - 500) * 5.0; // Additional charge for pieces above 500
            }

            // Display results
            Console.WriteLine("\n===== Laundry Service Receipt =====");
            Console.WriteLine("Customer Code: " + CODE);
            Console.WriteLine("Customer Name: " + NAME);
            Console.WriteLine("Quantity of Clothes: " + QUANTITY + " pieces");
            Console.WriteLine("Total Laundry Cost: " + PRICE.ToString("F2") + " THB");


        }
    }
}