Final Exam PROG 32356 You are allowed to use any materials including slides, books, assignments/programs created by you or the solutions provided by the professor, MSDN Documentation, Internet. a)...

1 answer below »
uploaded file


Final Exam PROG 32356 You are allowed to use any materials including slides, books, assignments/programs created by you or the solutions provided by the professor, MSDN Documentation, Internet. a) Laptops must be used for the exam. b) Code will be submitted on SLATE as an archive containing all files and folders related to the program. c) Students are not allowed to use someone else’s solutions – only solutions created by them or the professor. d) The code must be error free. Any compile time errors will result in Zero. e) Besides implementing the required functionality submissions are required to use the correct coding conventions used in class, professional organization of the code, alignment, clarity of names are all going to be part of the evaluation. Comments are recommended but not required. f) No .rar files will be accepted I have read, understood and agreed to follow these rules as well as Sheridan’s policies and procedures on academic honesty available here: Academic Honesty at Sheridan. http://sheridaninstitute.libguides.com/academic_honesty http://sheridaninstitute.libguides.com/academic_honesty Practical Section a) Using Visual Studio, create a Console based application named FinalExam ( 1 Point) b) Add a new local DB connection and create a DB named FinalExam. ( 1 Point) c) Run the script given to you on SLATE to make all the tables, or copy the file and run the queries. ( 2 Point) d) Note: Connection string should not be stored in the program.cs file. ( 3 Point) e) Make the required classes to implement the logic/code/functionality. The main file should only be used to take the values from the user, display menu and call methods. ( 5 Point) f) Use parameters in queries wherever applicable. ( 3 Point) g) Assume, customer names are unique in customer table. h) Take screen shots to show each step, Part 1: Take screen shots to demonstrate working of Part 1 (15) a) Display a welcome message as “Welcome to ’s Application. Please enter the credentials to log in “. ( 1 Point) b) It should ask user for username and password. ( 2 Point) c) Make sure user enters the required details. ( 3 Point) d) If username and password exists in database then go to Part 3. ( 5 Point) e) If user name and password doesn’t exist, let the user know about it and ask the user to either retry or Sign Up using menu options. ( 3 Point) a) If user selects Sign Up, then go to Part 2. ( 1 Point) Part 2: Take screen shots to demonstrate working of Part 2 (18) a) If user doesn’t exit in database, ask user to enter details for each column to create an account. ( 2 Point) b) Insert a record into Customer table using disconnected architecture. ( 5 Point) c) Make sure all columns have valid data ( example credit limit can’t be text) and none of the column should have null value. ( 3 Point) d) After successful insertion into Customer table, insert username and password in Customer_Detail table too(using disconnected architecture). For this, create a method that takes the customer name and returns reverse of the name. Use customer name as username and reverse as password. ( 7 Point) e) Ask user to log in again. ( 1 Point) Part 3: Take screen shots to demonstrate working of Part 3 (52) After successful login, welcome the user as “Welcome < username="">”. Display three options to customer as follows: ( 2 Point) Option 1: Edit Customer Profile Option 2: Buy Products Option 3: Exit Application Option 1: Edit Customer Profile a) Let customer edit values for City and Credit Limit columns only. Make sure values entered are valid values and credit limit is positive integer between 1000 and 6000. ( 5 Point) b) Customer can edit values only for themselves not for other customers. ( 3 Point) c) Once done, take customer back to the options menu. ( 2 Point) Option 2: Buy Products a) Display all product types available as Menu options. Avoid duplicate values. ( 3 Point) b) Ask user to select a product type and display all products available for the selected product Type. ( 3 Point) c) Ask user to select a particular product of a particular product type and display its price. ( 3 Point) d) Ask user quantity they want to buy. Make sure that the quantity is a positive number. ( 5 Point) e) Validate that you have asked quantity on hand for the selected product and product type. ( 5 Point) a) If yes, a) Insert a record in Orders and Orderline table. ( 12 Point) (Hint : Orders Table : CustNum should be custNum of customer who is logged in. Orderline Table: OrderNum is the orderNum of order you placed, ProductNum is productNum of product customer is buying, Quantity is quantity entered by customer and SalesPrice is product ‘s MSRP. b) Update the quantity on hand. ( 5 Point) b) If No, let the customer know about it and ask customer to enter another quantity( Go back to ‘e’) ( 3 Point) f) Display options menu. ( 1 Point) Submission: • Make sure your code runs and there is no compile time error. • Make sure you add all screen shots required to demonstrate the working of your code. You will loose 10% if screen shots are missing. • Create a .zip folder named YourNameFinalExam that contains the following: ◦ Complete code for final exam solution. Make sure it contains all files. ◦ A folder containing screen shots. Name the files appropriately. ◦ Database for final exam. • No .rar files will be accepted. Good luck !
Answered Same DayAug 10, 2021

Answer To: Final Exam PROG 32356 You are allowed to use any materials including slides, books,...

Shweta answered on Aug 12 2021
133 Votes
BhumiFinalExam/BhumiFinalExam/App.config







BhumiFinalExam/BhumiFinalExam/BhumiFinalExam.csproj



Debug
AnyCPU
{A5B49B47-2BCC-4B62-B309-D368A562B13F}
Exe
BhumiFinalExam
BhumiFinalExam
v4.7.2
512
true
true


AnyCPU
true
full
false
bin\Debug\
DEBUG;TRACE
prompt
4


AnyCPU
pdbonly
true
bin\Release\
TRACE
prompt
4




















BhumiFinalExam/BhumiFinalExam/Program.cs
using System;

using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
namespace BhumiFinalExam
{
class Program
{
static void Main(string[] args)
{
string username = LoginPage();
AccessLoginPage(username);

}
public static void AccessLoginPage(string username)
{
if (username != "" && username != null)
{
Console.WriteLine("You are successfully login.");
Console.Clear();
if (username != "" || username != null)
OptionPage(username);
}
else
{
Console.Clear();
Console.WriteLine("Login is Failed!");
MenuLoginFail();
}
}
public static string LoginPage()
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["connString"].ConnectionString);
con.Open();
SqlCommand cmd;
DataTable dt = new DataTable();
Console.WriteLine("Welcome to Bhumi's Application. Please enter the credentials to log in.");
Console.WriteLine("Enter Username");
string username = Console.ReadLine();
Console.WriteLine("Enter Password");
string password = Console.ReadLine();
if (username == "" || password == "")
{
Console.WriteLine("Either username or password is blank.");
return username;
}
else
{
cmd = new SqlCommand("select * from Customer_Detail where CustUserName='" + username + "' and CustPassword='" + password + "'");
cmd.Connection = con;
using (SqlDataAdapter da = new SqlDataAdapter(cmd))
{
da.Fill(dt);
}
con.Close();
if ((dt.Rows.Count > 0))
return username;
else
return null;
}
}
private static bool MenuLoginFail()
{
Console.WriteLine("1) Try Again");
Console.WriteLine("2) Sign Up");
Console.WriteLine("3) Exit");
Console.WriteLine("\r\nWrite your option: ");
switch (Console.ReadLine())
{
case "1":
Console.Clear();
string username = LoginPage();
AccessLoginPage(username);
return true;
case "2":
Console.Clear();
SignUp();
return true;
case "3":
return false;
default:
return true;
}

}
private static bool OptionMenu(string userName)
{
Console.WriteLine("1) Edit Customer Profile");
Console.WriteLine("2) Buy Products");
Console.WriteLine("3) Exit Application");
Console.WriteLine("\r\nWrite your option: ");
switch (Console.ReadLine())
{
case "1":
Console.Clear();
EditCustomerProfile(userName);
return true;
case "2":
Console.Clear();
BuyProducts(userName);
return true;
case "3":
return false;
default:
return true;
}

}
public static void SignUp()
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["connString"].ConnectionString);
con.Open();
SqlCommand cmd;
Console.WriteLine("New to Bhumi's Application. Please enter your details to Sign Up.");
Console.WriteLine("Enter Customer Name");
string custName = Console.ReadLine();
Console.WriteLine("Enter City");
string city = Console.ReadLine();
Console.WriteLine("Enter Credit Limit");
string creditLimit = Console.ReadLine();
if (custName == "" || city == "" || creditLimit == "")
{
Console.WriteLine("Enter value for all the fields");
SignUp();
}
else
{
bool IsCreditLimitValid = validateCreditLimit(creditLimit);
bool IsCustomerNameUnique = validateCustomerName(con, custName);
if (IsCreditLimitValid && IsCustomerNameUnique)
{
Int32 number;
Int32.TryParse(creditLimit, out number);
cmd = new SqlCommand("Insert into Customer (CustName, City, CreditLimit) Values('" + custName + "','" + city + "'," + number + ")", con);
cmd.ExecuteNonQuery();

//Insert password as reverse of username.
string password = ReverseString(custName);
//Insert data into Customer_Detail Table.
cmd = new SqlCommand("Insert into Customer_Detail (CustUserName, CustPassword) Values('" + custName + "','" + password + "')", con);
cmd.ExecuteNonQuery();
Console.Clear();
Console.WriteLine("Data Inserted Successfully!");
Console.WriteLine("Now login again!");
string username = LoginPage();
AccessLoginPage(username);
}
else
{
if (!IsCreditLimitValid)
{
validateCreditLimit(creditLimit);
}
if (!IsCustomerNameUnique)
{
Console.WriteLine("Enter unique customer name");
Console.Clear();
...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here