Answer to Question #314375 in C# for jrs.

Question #314375

1) Identify the validation checks that you could use for the following inputs and justify your choice:

If more than a single validation check would be required from your perspective, please indicate which ones and why.

1a) Entering a telephone number.

1b) Entering a student's name.

1c) Entering a part number in this format: XXX999, where X must be any letter from the standard western alphabet (A-Z), and 9 must be replaced with a single digit between 0 and 9.


2) Write an algorithm using pseudocode to check the age and height of a child who wants to go on a fairground ride. The child's age must exceed 7, but below 12, their height must exceed 110 cm, but below 150 cm.


3) Write an algorithm using pseudocode to verify that a password's length exceeds 8 characters, but is shorter than 12 characters. (INCLUSIVE 8-12)


1
Expert's answer
2022-03-19T12:25:12-0400

Here is program:

 static void Main(string[] args)
        {
         //1)
            string telephonenum;
            string studentname;
            string num;
            Console.WriteLine("Enter telephone number: ");
            telephonenum =  Console.ReadLine();
            Console.WriteLine("Enter student name: ");
            studentname = Console.ReadLine();
            Console.WriteLine("Enter part number: ");
            num = Console.ReadLine();
            //2)
            int age;
            int height;
            Console.WriteLine("Enter age: ");
            age = int.Parse(Console.ReadLine());
            Console.WriteLine("Enter height: ");
            height = int.Parse(Console.ReadLine());
            if(age > 7 && age < 12 && height > 110 && height < 150)
            {
                Console.WriteLine("Accept");
            }
            else 
            {
                Console.WriteLine("No accept");
            }


        }

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
New on Blog
APPROVED BY CLIENTS