0
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;

    namespace Assignment_1
    {
        class Program
        {
            static void Main(string[] args)
            {
                double SurfaceArea, Height, Radius, Volume;
                string inputString;
                int number;

                {
                    //Title Text
                    Console.WriteLine("Cylinder - Surface area and volume calculator");

                    //Prompts for input request

                    Console.Write("Enter the radius: ");
                    inputString = Console.ReadLine();

                    //displays user input for radius

                    Console.WriteLine("{0}", inputString);

                    Radius = double.Parse(inputString);
                    Console.Write("Enter Height: ");
                    inputString = Console.ReadLine();
                    Height = double.Parse(inputString);

                    //displays user input for height

                    Console.WriteLine("{0}", inputString);

                    //Calculation and display of surface area

                    SurfaceArea = (((2 * ((3.149)) * Radius) + (((2 * (3.149)) * (Radius) * Height))));
                    Console.WriteLine("Surface Area = {0}", SurfaceArea);

                    //Calculation and display of volume

                    Volume = ((3.149 * Radius * Radius * Height));
                    Console.WriteLine("The Volume = {0}", Volume);

                } 

                //Prompt the user for a four digit number (e.g. 5297) and display the sum of all of the digits
                //The four digit number must be read as a single number and the individual digits must be broken out using div (/) and mod (%).

    //Adds white space between lines
                Console.WriteLine("");

                Console.WriteLine("Sum of the digits - enter four digit whole numbers");
                Console.Write("please enter four digit whole number: ");

// この時点で、4 桁の数値を取得するために何をすべきかについて混乱しています。数値は 0、10 進数、または負の数値にすることはできず、1000 未満または 9999 を超えることはできません。質問していません。これはクラス用ですが、いくつかのガイダンスが役立つため、回答を求めて

            {
                //Prompt the user for three numbers and display the largest number. Use Math.Max in your solution. 
                Console.ReadLine();
            }
        }
    }
}
4

1 に答える 1