INFO321 Week 3 Assignment

Assignment Instructions
There are 2 parts to this weeks assignment.
Download the attached instruction details.

The objective is to perform the same tasks; first, by issuing SQL commands, and then by using MS Access (use the graphical interface to perform the tasks).

Part A SQL (70%); by following the detailed instructions you will Create a table, Insert data into that table, and use Select commands to select and display data from the table.

Submit one Word document, which includes the text of the SQL commands, and screen captures of the commands along with the Web sites feedback.

Part B MS Access (30%): use MS Access to create the same tables, load the same content and perform the same Queries.
The MS Access database is submitted.

Two files will be submitted a word document for Part A and an Access database for Part B.

Project 3

Write a PHP program that determines if a given credit card number is a valid Visa, MasterCard, or Discover credit card number
by performing the Luhn check (aka the Mod 10 check).
The format for a valid American Express, Visa, MasterCard, or Discover credit number is as follows:
American Express numbers start with 3
Visa card numbers start with 4
MasterCard numbers start with 5
Discover card numbers with with 6
Visa, MasterCard and Discover card types must have exactly 16 digits
American Express card types must have exactly 15 digits

Given the sample credit card number: 4388576018402626
The algorithm for the Luhn/Mod 10 check is as follows:

Starting from the second digit from right and moving to the left, double every other digit.
If the result from doubling is two digits, then add those two digits together to end up with a one digit number.

Add up all of the one digit numbers from Step 1.

4 + 4 + 8 + 2 + 3 + 1 + 7 + 8 = 37

Starting from the right most digit and moving to the left, sum every other digit.

6 + 6 + 0 + 8 + 0 + 7 + 8 + 3 = 38

Sum the integer results from Step 2 and Step 3.

37 + 38 = 75

If the integer result from Step 4 is evenly divisible by 10 (i.e. there is no remainder),
then the card number is valid; else the card number is invalid.

75 / 10 has a remainder of 5, therefore, this sample credit card number is invalid.

Your program must adhere to the following specifications:

It must have seven (7) functions named exactly as follows:

Function Name
Number of
Parameters
Received
isCCValid
1
checkType
1
checkLength
2
convertCC2Array
1
doubleSumEvenPos
1
sumOddPos
1
sumMod
2

The functions must be formulated as follows:

Function Name
Function
Description
Receiving
Parameter
Description
Receiving
Parameter
Data Type
Returning
Parameter
Data Type
Returning
Parameter
Description
isCCValid
Calls the six functions
Credit Card Number
String
Boolean
Returns true if the credit card number is valid,
otherwise returns false
checkType
Checks the first digit of the Credit Card Number for
validity and returns the Credit Card type
Credit Card Number
String
String
Returns the type of credit card as follows:

“VISA” for Visa
“MCRD” for MasterCard
“DISC” for Discover
“AMEX” for American Express
“INVD” for none of the above; considered Invalid
checkLength
Checks the Credit Card Number length against the
Credit Card type
Credit Card Number
String
Boolean
Returns true if the credit card number length is valid,
otherwise returns false
Credit Card Type – See Returning Parameter
from function checktype
String
convertCC2Array
Converts a Credit Card Number string to an array
Credit Card Number
String
Array
Returns a credit card number as Single Dimension Array
doubleSumEvenPos
Performs the calculations from Steps 1 and 2 above
Credit Card Number (Array) – See Returning
Parameter from function convertCC2Array
Array
Integer
Returns the result of Steps 1 and 2 above
sumOddPos
Performs the calculations from Step 3 above
Credit Card Number (Array)- -See Returning
Parameter from function convertCC2Array
Array
Integer
Returns the result of Step 3 above
sumMod
Performs the calculations from Steps 4 and 5 above
Result returned from function doubleSumEvenPos
Integer
Boolean
Returns true if the result of the Mod10 check
is valid, otherwise returns false
Result returned from function sumOddPos
Integer

DO NOT send me any programs that contain any credit card numbers.
Your credit card variable should be equated to “” in the program that you submit.
I will generate my own test data to evaluate and grade your program.
You must use this code for the Main part of your program.
    if (isCCValid($creditCardNumber))
        echo $creditCardNumber . ” is valid.”;
    else
        echo $creditCardNumber . ” is not valid.”;

Function isCCValid must call the other six functions.
Set variable $creditCardNumber to some credit card number in your the Main part of your program
in order to test. You may use the following test data or make up your own.
These credit card numbers are not real but they will pass the Luhn/Mod 10 check:
For Visa, $creditCardNumber = “4111111111111111”;
For MasterCard, $creditCardNumber = “5212121212121211”;
For Amex, $creditCardNumber = “311111110101010”;
For Discover, $creditCardNumber = “6111111212121212”;

This is an invalid credit card number that you can use to test (or make up your own), $creditCardNumber = “4388576018402626”;
Programs that do not follow the above assignment specifications (as summarized in this list) will receive a heavy reduction in the score:
Main part of the program matches the given code above
Number of functions
Function names
Function perform tasks as described
Function receiving parameters – correct number of parameters and data types
Function returning parameters – data

OLEDs

4. (25 marks) Compose a short essay outlining everything you know about one of the topics listed below.
Important points to consider when preparing your essay:
–    Your short essay must be between 2 and 3 typed pages in length (12pt Times font, 2.54 cm margins all around, 1.5 line spacing).
–    For any essay longer than 3 pages, excess pages will be removed and not considered in graded. 
–    Unlike for the rest of the exam, you are free to include figures/diagrams taken directly from lecture notes (no other source will be accepted), however these diagrams must be numbered sequentially, have appropriate meaningful captions that are inserted using the caption function, and be referred to in the body text of the essay.
–    Essays should include discussion related to material/device preparation, structure, explanation of properties, and applications.
–    Figures/diagrams in the text and do not contribute to the page length. 
–    This question will be marked on depth of understanding, clarity of writing, formatting (e.g., subscripts and superscripts), as well as spelling and grammar.

Topic:
OLEDS

Quarantine Eating Habits

Quarantine Eating Habits.
Grade 6 writing level.
Create a balanced Breakfast, Lunch, and Dinner. Be sure to explain why it is important to eat a balanced meal especially through the Covid-19 pandemic. This response MUST be a minimum of 300 words.

Examples not to do:
Breakfast:(Balanced Meal). Cereal alone is not a balanced meal
Lunch: (Balanced Meal) A burger alone is not a balanced meal
Dinner: (Balanced Meal). Chicken alone is not a balanced meal