Answer to Question #254257 in C# for Siya

Question #254257

You are a Windows developer for a data analysis company. For one of your applications you need to create a keyword searching form that asks for a filename and a keyword from the user (as shown in below figure). The form should search for the keyword in the file and display the number of lines that contain the keyword in the results group box. Your form assumes that the entered keyword is a single word. If it is not a single word, you need to create and throw an exception for that case.


1
Expert's answer
2021-10-22T04:53:48-0400
using System;

namespace WhatsMyInfo

{

    public class Program

    {

        public static void Main()

        {

            string name;

            int age;

            int birthyear;

            Console.Write("Please enter your name: ");

            name = Console.ReadLine();

            Console.Write("Please enter your age: ");

            age = Convert.ToInt32(Console.ReadLine());

            Console.Write("What year were you born?: ");

            birthyear = Convert.ToInt32(Console.ReadLine());

            //Print a blank line

            Console.WriteLine();

            //Show the details that the user entered

            Console.WriteLine("Name is {0}.", name);

            Console.WriteLine("Age is {0}.", age);

            Console.WriteLine("Birth year is {0}.", birthyear);

        }

    }

}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS