Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In this exercise you are to state the correct ordering of two given strings, formatted with Name: in front of them. First you must request

In this exercise you are to state the correct ordering of two given strings, formatted with Name: in front of them.

First you must request and receive name A:

what is name A? Next you must request and receive name B:

what is name Es?

The user will always enter the names with Name: at the beginning of both name A and B. In the three examples below, (A} and (8) are placeholders for these inputs. If name A precedes name B, you are to write:

{A} Precedes {B}

If name A is equal to name 8, you are to write:

{A} Equals {s}

If name A follows name B, you are to write:

{A} Follows {a}

An example of the full console output is: What is name A?

Name: Amy

what is name B?

Name: Matthew

Amy Precedes Matthew

Note that the user inputs the entire ?Name: Amy? ?Name: Matthew? lines.

Use the following skeleton as a basis for your program:

Don?t forget to add a console. Readline () at the end of the program so it doesn?t close automatically when debugging.

Do not use if statements or switch statements.

Hint, consider the string methods covered in the week 1 lecture / chapter 2.

Use the C# programming language to complete

public class StringOrder

{

enum Order { Precedes=-1, Equals=0, Follows=1 };

public static void Main()

{

Console.WriteLine("What is name A?");

}

}

public class stringorder { enum order { Precedes=-1, Equals=0, Follows=1 }; public static void Main() { } Console.WriteLine("what is name A?");

Step by Step Solution

3.47 Rating (154 Votes )

There are 3 Steps involved in it

Step: 1

Hi find your solution below Output snapshot is attached This program has enum type variables list th... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Probability And Statistics

Authors: Morris H. DeGroot, Mark J. Schervish

4th Edition

9579701075, 321500466, 978-0176861117, 176861114, 978-0134995472, 978-0321500465

More Books

Students also viewed these Chemical Engineering questions

Question

Is the sample selected related to the target population?

Answered: 1 week ago