Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ChatBot
- {
- class Program
- {
- static void Main(string[] args)
- {
- bool exit = false;
- while (exit == false)
- {
- Console.Write("What is your name? ");
- string name = Console.ReadLine();
- Console.Write("Hello there, " + name + ", How old are you? ");
- int age = Convert.ToInt32(Console.ReadLine());
- Console.Write("So you are " + name + " and you are " + age + " years old, correct? ");
- string verify = Console.ReadLine();
- if (verify == "Y")
- {Console.Write("How can I help you " + name, "?");
- string task = Console.ReadLine();
- Console.WriteLine("No");
- exit = true;
- }
- else if (verify == "N")
- { }
- else if (verify == "Yes")
- {
- Console.Write("How can I help you " + name, "?");
- string task = Console.ReadLine();
- Console.WriteLine("No");
- exit = true;
- }
- if (exit == true)
- { Console.WriteLine("Have a good day"); }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement