티스토리 뷰

AU Study/TAFE

W8 Fri morning

Last72 2017. 9. 12. 19:36
Click left space of the line number, than the program stops at that point, before run that code. We can check the value of variables.

if(carMake == "Jeep")

input Jeep - run
input Jeep2017 - do not run

After the program stopped, once you click continue butten, it runs until another stop point

//// Woongyeol_choi

// P453075

// 08/09/2017

// Week 8 excercies





using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;



namespace ConsoleApplication1

{

    class Program

    {

        static void Main(string[] args)

        {

            Console.WriteLine("Week 8 exercise");

            Console.Write("Please enter car make: ");



            string carMake = Console.ReadLine();



            if(carMake == "Jeep")

            {

                Console.WriteLine("The car is expensive");

            }

            else if(carMake == "Hyundai")

            {

                Console.WriteLine("The car is cheep");

            }

            else

            {

                Console.WriteLine("The car isn't nor cheep or expensive");

            }



            Console.ReadLine();

        }

    }

}



//// Woongyeol_choi

// P453075

// 08/09/2017

// Week 8 excercies 2





using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;



namespace ConsoleApplication1

{

    class Program

    {

        static void Main(string[] args)

        {

            Console.WriteLine("Please enter test score.");

            /*

            0 - 50 is a FAIL

            50 - 70 is a PASS

            70 - 90 is a Performance with merit

            90 - 100 is a Performance with distinction

            */



            int score = Int32.Parse(Console.ReadLine());



            if (score >= 90 && score <= 100)

            {

                Console.WriteLine("Performance with distinction.");

            }

            else if (score >= 70 && score <= 90)

            {

                Console.WriteLine("Performance with merit");

            }

            else if (score >= 50 && score <= 70)

            {

                Console.WriteLine("PASS");

            }

            else if (score >= 0 && score <= 50)

            {

                Console.WriteLine("FAIL");

            }

            else if (score <= 0)

            {

                Console.WriteLine("Invaild.");

            }

            Console.ReadLine();

        }

    }

}



//// Woongyeol_choi

// P453075

// 08/09/2017

// Week 8 excercies 3





using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;



namespace ConsoleApplication1

{

    class Program

    {

        static void Main(string[] args)

        {

            Console.Write("Enter a car make: ");

            string carMake = Console.ReadLine();



            if (carMake == "Ford" || carMake == "Mustang" || carMake == "Landrover")

            {

                Console.WriteLine("The car is American car.");

            }

            else if (carMake == "Deawoo" || carMake == "Kia" || carMake == "Hyundai")

            {

                Console.WriteLine("The car is Korean car.");

            }

            Console.ReadLine();

        }

    }

}




//// Woongyeol_choi

// P453075

// 08/09/2017

// Week 8 excercies 3





using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;



namespace ConsoleApplication1

{

    class Program

    {

        static void Main(string[] args)

        {

           

                Console.Write("Enter a car make: ");

                string carMake = Console.ReadLine();



                switch (carMake)

            {

                case "Ford":

                    Console.WriteLine("It is Ford");

                    break;

                case "Kia":

                    Console.WriteLine("It is Kia");

                    break;

                case "Hyundai":

                    Console.WriteLine("It is Hyundai");

                    break;

                case "Mustang":

                    Console.WriteLine("It is Mustang");

                    break;

                default:

                    Console.WriteLine("It is bicycle");

                    break;

            }

                Console.ReadLine();

            }

        }

    }



//// Woongyeol_choi

// P453075

// 08/09/2017

// Week 8 excercies 4





using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;



namespace ConsoleApplication1

{

    class Program

    {

        static void Main(string[] args)

        {

            string[,] myBoard = new string[2, 3];



            for (int i = 0; i < myBoard.GetLength(0); i++)

            {

                for (int j = 0; j < myBoard.GetLength(1); j++)

                {

                    //myBoard[i, j] = 'X';

                    myBoard[i, j] = Console.ReadLine();

                    Console.Clear();

                }

            }

            for (int i = 0; i < myBoard.GetLength(0); i++)

            {

                for (int j = 0; j < myBoard.GetLength(1); j++)

                {

                    Console.Write(myBoard[i,j]+"\t");

                }

                Console.Write("\n");

            }

            Console.ReadLine();

        }

    }

}

if(carMake == "Jeep")

input Jeep - run
input Jeep2017 - do not run

After the program stopped, once you click continue butten, it runs until another stop point

//// Woongyeol_choi

// P453075

// 08/09/2017

// Week 8 excercies





using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;



namespace ConsoleApplication1

{

    class Program

    {

        static void Main(string[] args)

        {

            Console.WriteLine("Week 8 exercise");

            Console.Write("Please enter car make: ");



            string carMake = Console.ReadLine();



            if(carMake == "Jeep")

            {

                Console.WriteLine("The car is expensive");

            }

            else if(carMake == "Hyundai")

            {

                Console.WriteLine("The car is cheep");

            }

            else

            {

                Console.WriteLine("The car isn't nor cheep or expensive");

            }



            Console.ReadLine();

        }

    }

}



//// Woongyeol_choi

// P453075

// 08/09/2017

// Week 8 excercies 2





using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;



namespace ConsoleApplication1

{

    class Program

    {

        static void Main(string[] args)

        {

            Console.WriteLine("Please enter test score.");

            /*

            0 - 50 is a FAIL

            50 - 70 is a PASS

            70 - 90 is a Performance with merit

            90 - 100 is a Performance with distinction

            */



            int score = Int32.Parse(Console.ReadLine());



            if (score >= 90 && score <= 100)

            {

                Console.WriteLine("Performance with distinction.");

            }

            else if (score >= 70 && score <= 90)

            {

                Console.WriteLine("Performance with merit");

            }

            else if (score >= 50 && score <= 70)

            {

                Console.WriteLine("PASS");

            }

            else if (score >= 0 && score <= 50)

            {

                Console.WriteLine("FAIL");

            }

            else if (score <= 0)

            {

                Console.WriteLine("Invaild.");

            }

            Console.ReadLine();

        }

    }

}



//// Woongyeol_choi

// P453075

// 08/09/2017

// Week 8 excercies 3





using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;



namespace ConsoleApplication1

{

    class Program

    {

        static void Main(string[] args)

        {

            Console.Write("Enter a car make: ");

            string carMake = Console.ReadLine();



            if (carMake == "Ford" || carMake == "Mustang" || carMake == "Landrover")

            {

                Console.WriteLine("The car is American car.");

            }

            else if (carMake == "Deawoo" || carMake == "Kia" || carMake == "Hyundai")

            {

                Console.WriteLine("The car is Korean car.");

            }

            Console.ReadLine();

        }

    }

}




//// Woongyeol_choi

// P453075

// 08/09/2017

// Week 8 excercies 3





using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;



namespace ConsoleApplication1

{

    class Program

    {

        static void Main(string[] args)

        {

           

                Console.Write("Enter a car make: ");

                string carMake = Console.ReadLine();



                switch (carMake)

            {

                case "Ford":

                    Console.WriteLine("It is Ford");

                    break;

                case "Kia":

                    Console.WriteLine("It is Kia");

                    break;

                case "Hyundai":

                    Console.WriteLine("It is Hyundai");

                    break;

                case "Mustang":

                    Console.WriteLine("It is Mustang");

                    break;

                default:

                    Console.WriteLine("It is bicycle");

                    break;

            }

                Console.ReadLine();

            }

        }

    }



//// Woongyeol_choi

// P453075

// 08/09/2017

// Week 8 excercies 4





using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;



namespace ConsoleApplication1

{

    class Program

    {

        static void Main(string[] args)

        {

            string[,] myBoard = new string[2, 3];



            for (int i = 0; i < myBoard.GetLength(0); i++)

            {

                for (int j = 0; j < myBoard.GetLength(1); j++)

                {

                    //myBoard[i, j] = 'X';

                    myBoard[i, j] = Console.ReadLine();

                    Console.Clear();

                }

            }

            for (int i = 0; i < myBoard.GetLength(0); i++)

            {

                for (int j = 0; j < myBoard.GetLength(1); j++)

                {

                    Console.Write(myBoard[i,j]+"\t");

                }

                Console.Write("\n");

            }

            Console.ReadLine();

        }

    }

}

'AU Study > TAFE' 카테고리의 다른 글

w9 Tue morning  (0) 2017.09.14
W8 Fri afternoon  (0) 2017.09.12
W8 thu afternoon  (0) 2017.09.12
W8 thu morning  (0) 2017.09.12
W8 wed afternoon  (0) 2017.09.12
댓글
Announcement
Recent Posts
Recent Comments
Total
Today
Yesterday
Link
TAG
more
«   2025/01   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
Search by month