MS101 MS OFFICE LECTURE NOTES #1 CST4708 HW #3A –Algorithm & Flow Chart Problem Statement & Overview ❑ Create an Algorithm using FLOW-CHART then PSEUDO-CODE for a Login Authentication program. Problem...

1 answer below »
Please follow all the detailed instructions for HW3A. This will get graded as an "F" if all of the instructions aren't met. Thank you for your help.


MS101 MS OFFICE LECTURE NOTES #1 CST4708 HW #3A –Algorithm & Flow Chart Problem Statement & Overview ❑ Create an Algorithm using FLOW-CHART then PSEUDO-CODE for a Login Authentication program. Problem Statement ❑ The functionality of the Login Authentication program are as follows: ▪ The program is to prompt the user for the username and password and authenticate the username & password by displaying whether “Access has been granted” or “Logon Failure. Please try again” since username or password are incorrect. ▪ The program is to run indefinitely requesting a username & password and performing the authentication of the username & password, until a secret code is entered for the username = -1 and for the password = -1 together. Only when both these values username is -1 & password is -1 should the program stop the execution and display a message “Program has been terminated!”. ❑ You are to assume, the database of usernames & passwords for the Login Authentication program, is stored in TWO ARRAYS OF STRINGS as follows: ❑ Based on these requirements, you are to create the following: 1. Flow Chart – create a flow chart, using the Flow Chart Symbols from CST4708_Lecture 2A_Algorithm_Basics 2. TEST & TROUBLESHOOT the Flow Chart – for every possible combination of input condition and resulting outputs to confirm if every input is providing the required output 3. Derive the PSEUDO-CODE from the Flow Chart – from tested flow chart, derive the pseudo-code algorithm. 4. TEST & TROUBLESHOOT the PSEUDO-CODE – test the pseudo-code in the event there are errors during the generation of pseudo-code from Flow Chart. ❑ Detailed REQUIREMENTS are listed in the sections to follow. UsernnameDatabase “Joe” “Angel” “Sam” “Mary” “Nancy ” 0 1 2 3 4 PasswordDatabase “111” “222” “333” “444” “555” 0 1 2 3 4 2 HW3A – Detailed Requirements Requirement #1 – Create the Login Authentication Program Flow Chart ❑ IMPORTANT! Please note the following: ▪ Requirement #1 is broken down into 5 requirements: 1) Requirement #1a. 2) Requirement #1b. 3) Requirement #1c. 4) Requirement #1d. 5) Requirement #1e. ▪ Make sure you have SATISFIED ALL THESE SUB-REQUIREMENTS in order to fulfill Requirement #1. ▪ Points will be removed for every requirement you do not follow. ❑ Detailed Requirements below. REQUIREMENT #1a – Create the FLOW CHART for the Login Authentication Program ❑ CREATE the FLOW CHART for the following Login Authentication program: ▪ The program is to prompt the user for the username and password and authenticate the username & password by displaying whether “Access has been granted” or “Logon Failure. Please try again” since username or password are incorrect. ▪ The program is to run indefinitely requesting a username & password and performing the authentication of the username & password, until a secret code is entered for the username = -1 and for the password = -1 together. Only when both these values username is -1 & password is -1 should the program stop the execution and display a message “Program has been terminated!”. REQUIREMENT #1b – Database Requirements is two ARRAYS of strings that store the Usernames & Passwords the Authentication Process will search to authenticate ❑ The TWO ARRAYS OF STRINGS that will contains the usernames & passwords for the Login Authentication program are as follows: ❖ NOTE that these ARRAYS are NOT FLOW CHARTS, but the database your algorithm will leverage. ❖ See Lecture 2A for guidance. UsernnameDatabase “Joe” “Angel” “Sam” “Mary” “Nancy ” 0 1 2 3 4 PasswordDatabase “111” “222” “333” “444” “555” 0 1 2 3 4 3 REQUIREMENT #1c – 1) USE ONLY the SYMBOLS from lecture CST4708_Lecture 2A_Algorithm_Basics, 2) Symbols cannot be altered & 2) Symbols can be nested in Processing box ❑ Adhere to the following rules: 1. RULE #1 – USE ONLY the SYMBOLS used in our class (Lecture 2A). DO NOT USE any other symbols you see in the web or symbols from flow chart tools. ONLY the following symbols should be used (see Lecture 2A): 4 2. RULE #2 – The SYMBOLS CANNOT be ALTERED and must be exactly as in my Lecture 2A or above list: o You MUST USE the chart exactly like it is. o DON’T CHANGE the SYMBOL just because it DOES NOT meet your thinking process or approach. If you cannot make the symbol work in a scenario, then your approach is wrong! 3. RULE #3 – For some SYMBOLS you CAN have other SYMBOLS or FLOW CHARTS NESTED within the processing synbol. See Lecture 2A for example of these scenarios. For example, the if statement below can contain other flow charts indicating the algorithm that takes place inside its processing when a condition is TRUE: REQUIREMENT #1d – NO hand-drawn flow chart. Use Drawing Program to implement your flow chart ❑ No hand-drawn flow charts. ❑ Search and download a free tool to create your flow chart. such as: ▪ Draw.io ▪ Visio etc. ❑ But keep in mind RULE #1. 5 REQUIREMENT #1e – DESIGN & IMPLEMENT your algorithm based on the 5 DESIGN CRITERIA listed in Lecture 2A ❑ Your algorithm should be implemented you the following DESIGN CRITERIA listed in Lecture 2A shown below: ➢ FOR BEST PRACTICE, WHEN DESIGNING THE ALGORITHM USE THE FOLLOWING CRITERIA: 1. BEST TOOL – Selection of best FLOW CHART SYMBOL for each task: - What I mean by best tool or FLOW CHART SYMBOL for a part of the algorithm. Symbol or tools like: if, if/else, nested if/else, while loop, Do While Loop, for loop, etc. - When selecting a tool, keep in mind organization, efficiency etc. (in other words, you will not use a hand saw to cut a tree, if you have a power saw. Same apply here, you will NOT use a number of string variables to store a list of items when you have a better tool such as an array of strings) 2. EFFICIENT/PERFORMANCE – Program/design should be efficient for optimal performance: - Limit unnecessary processing where possible. Consider CPU & MEMORY usage as you decide steps in your algorithm. - Limit any additional or unnecessary steps that would require necessary processing by the CPU. - Limit any additional or unnecessary MEMORY Data Structures, example unnecessary variables etc. 3. SCALABLE – design and implement so that program can be scaled and grow with FEW LIMITATIONS: - (Don’t go crazy here, just make it so that is realistic, for example, only 5 users are now available, but program should provide the flexibility that if more users need to be added we can do it without having to re-engineer the solution. - I am not asking for implementation of full scalability features, but ask yourself, what can I do now in my algorithm that will not require too much effort to prepare for growth in the future? - MODULARITY, which is the next section, is one of the FIRST & most important criteria to provide scalability, so pay close attention to next section. 4. MODULAR – program should be implemented using tools to make it modular, this works hand in hand with scalability: - Program should be written in parts or modular. In other words, mayor, simple, functionalities and features should be enclosed within block of code that can be called when needed and reused over and over again: o In Flow Charts these modules are implemented with PRE-DEFINED PROCESSES DEFINITIONS & CALLS. o In programming languages, these modules implemented with Sub-Procedures/Functions DEFINITIONS & CALLS. - When deciding which block of code to modularize, keep in mind scalability. Future upgrades of features should only require swapping these modular code segments with a new one WHILE KEEPING THE SAME STRUCTURE AND NOT BREAKING ANY OF THE OTHER MODULES. - Guidance – Each modular block of code should only perform ONE ATOMIC OPERATION when possible. For example, you don’t want to place a PRINT feature and AUTHENTICATE feature in the same module! If you do, you cannot swap any of these features with a new one without affecting the other, thus NOT SCALABLE. Therefore, you would have separate PRINT MODULE & separate AUTHENTICATE MODULE. Now you can swap any of these modules with a new one without affecting the other. HINT: For example, the module of code that authenticates a username and password should NOT also display the “Welcome Access Granted” or “Access Denied”. This block of code or MODULE for AUTHENTICATE should only authenticate!!! 5. IMPLEMENTATION – There are many best practices for implementation. I am going to focus on an important one, where you declare your variables or data structures. Use the following guidelines: - Use GLOBAL Storage Elements – use Global data storage elements (variables, arrays, etc.) for data that must be seen and accessible by the entire program. Use public keyword for GLOBAL storage elements. They usually get declared in Class or Program location/Forms where the Main() driving function resides. - MODULE-LEVEL Storage Elements – Use MODULE-LEVEL data elements (variables, arrays, etc.) for data that should only be used within the module or object (Class, Form, etc.). - LOCAL-LEVEL Storage Elements – Use LOCAL data storage elements (variables, arrays, etc.) for temporary data that should be seen and used only when needed and short lived, for examples inside functions and procedures. 6 Requirement #2 – Test Flow Chart ❑ The TEST ALGORITHM MUST BE TESTED to verify that it works before being implemented using a programming language. ❑ Follow the requirements below: REQUIREMENT #2a – Test the Flow Chart Algorithm using the suggested algorithm from Lecture 2A ❑ Leverage the following TEST ALGORITHM in Lecture 2A to execute the testing process: 7 REQUIREMENT #2b – Test the Flow Chart using the possible input combinations & possible output outcomes shown in this section ❑ As listed in the TEST ALGORITHM, the first two processing boxes is for you to gather a list of the following: ▪ EVERY POSSIBLE COMBINATION OF INPUT CONDITIONS for username & password and EXPECTED resultant OUTPUT displayed. ▪ These are the DATA VALUES that you will use to determine if a particular test passed or failed and determine final decision if your TEST ALGORITHM is
Answered Same DayApr 13, 2021

Answer To: MS101 MS OFFICE LECTURE NOTES #1 CST4708 HW #3A –Algorithm & Flow Chart Problem Statement & Overview...

Aditya answered on Apr 17 2021
162 Votes
New folder/code.txt
using System;
namespace login
{
class Program
{
static voi
d Main(string[] args)
{
string[] Username = {"Joe","Angel","Sam","Mary","Nancy"};
string[] Password = {"111","222","333","444","555" };
int database_size = Username.Length;
string input_username;
string input_password;
do
{
int access = 0;
Console.Write("Enter The UserName - ");
input_username = Console.ReadLine();
Console.Write("Enter The Password - ");
...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here