Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Open your existing GameConsole application Validation.cs Create a new method to validate user input against a dynamic list of approved answers. Note : Think of

Open your existingGameConsoleapplication

Validation.cs

  1. Create a new method to validate user input against a dynamic list of approved answers. Note: Think of this like drop-down menu on a website form. Ex: when asking for a month, there are only 12 acceptable responses, anything else is invalid.

Users.txt

  1. Create a text document to hold user information:username,password,age, andtheme
  2. Pre-populate this with a few users (3+)

User.cs

  1. Create a login method, belonging to the class, not a particular object... This should return an instantiated object based on a successful comparison to the users.txt file Note: Think of this like a bouncer or host at a fancy restaurant. You walk up and give them your name.... try breaking it down step-by-step, how does the host know if you are allowed in. They have a file containing reservations, and you have a text-file containing registered users.
  2. Add another method allowing for the saving of new users. Use the newly created validation method to validate the user inputed theme... lightanddark are the only current themes.

Program.cs

  1. Instead of simply instantiating a user object with hard-coded values, use the login method to set the current user.
  2. If necessary, the store logged-in user so that it's accessible within other classes. We want to prevent the user from having to login each time they are returned to the 'home screen'.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

csharp Validationcs using System using SystemCollectionsGeneric namespace GameConsole public static ... 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

Principles Of Information Security

Authors: Michael E. Whitman, Herbert J. Mattord

7th Edition

035750643X, 978-0357506431

More Books

Students also viewed these Accounting questions

Question

Recall some characteristics of creative, divergent thinking.

Answered: 1 week ago