search
HomeWeChat AppletMini Program Development[C# applet] Command line applet: Do you want to buy a large cup, a small cup or a medium cup? Implementation code

Achievement effect:

A prompt appears on the screen: 1. Small cup 3 yuan; 2. Medium cup 4 yuan; 3. Large cup 5 yuan, please enter the corresponding number to select...

When the user enters a number, the corresponding result will be prompted: small cup, please pay 3 yuan; if the input is incorrect, the medium cup will be defaulted

The following is the source code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace ConsoleManyHellos
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("1=小杯3块,2=中杯4块,3=大杯5块");
            Console.Write("你的选择?");
            string s = Console.ReadLine();
            int n = int.Parse(s);
            switch (n)
            {
                case 1:
                    Console.WriteLine("小杯,请支付3块钱;");
                    break;
                case 2:
                    Console.WriteLine("中杯,请支付4块钱;");
                    break;
                case 3:
                    Console.WriteLine("大杯,请支付5块钱;");
                    break;
                default:
                    Console.WriteLine("默认中杯,请付款4块钱;");
                    break;
            }
            Console.WriteLine("谢谢使用,祝您用餐愉快!");
 
        }
    }
}

Screenshot of the command line effect:

[C# applet] Command line applet: Do you want to buy a large cup, a small cup or a medium cup? Implementation code

The above is the detailed content of [C# applet] Command line applet: Do you want to buy a large cup, a small cup or a medium cup? Implementation code. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.