c3ypt1c / Lucky-Name-Numbers

This is the solution to the WJEC 2017 Lucky Name Number algorythom.
http://c3ypt1c.tk/oldwiki/doku.php?id=lucky_numbers
0 stars 0 forks source link

Whats the point of this? #7

Open ghost opened 7 years ago

ghost commented 7 years ago

print("Is your name" ,firstName ,surName," If so wait six seconds if not retun the code")

time.sleep( 6 ) #What's the point of this?

This is a function that if the user enters the name wrong they have chance to exit the program.

c3ypt1c commented 7 years ago

Okay, but if the user tries doing anything, nothing will happen (ie. Press a key) and the sleep slows down the debugging of the program should an error occurater in the program. How about we give the user the opportunity to say yes or no after they enter their name to see if it's correct?

ghost commented 7 years ago

Yes or press q to quit the program or r to restart it not sure yet also i just had the new controlled assessment task from my teacher.

c3ypt1c commented 7 years ago

Usually, you can press ctrl+c to make a program crash and quit from command line.... I'll implement.

ghost commented 7 years ago

I agree regarding the gui we will work on that soon the gui will be it own code also rename .pyw to .py as that the python file format.

c3ypt1c commented 7 years ago

.pyw is a python file that doesn't produce a window interface so they should be used with things that don't need command line like the Gui-Development.pyw or fun.pyw. This is because the file doesn't do anything by itself and is basically a load of functions that other programs use. (http://filext.com/file-extension/PYW).

However, engine.py (also engine2.py in the "optimised" (rushed and incorrect spelling, I know) branch) is named .py as it will be a command line interface and you will be able to interact with the interface.

ghost commented 7 years ago

Sure we need to fix the spelling mistakes.

c3ypt1c commented 7 years ago

What is the exactly "new controlled assessment task from my teacher" you mentioned earlier? Maybe you want to do a prototype on Github?

ghost commented 7 years ago

Here it is

ghost commented 7 years ago

Check it out

Shon has setup up a new business producing handmade jewellery. She has been working from home and has been selling her products at local craft fairs. Her designs have proved popular and Sharon wants to expand the market for the jewellery. Sharon has decided that the business should have a web presence and has set about creating website for the jewellery. She has also decided to reward repeat customers by issuing them with a loyalty card that can be used to give a 10% discount on orders over £50.00. The loyalty cards will be valid from one year from the date they are issued.
Sharon will need to cheek if the loyalty card is still valid. Loyalty cards contain an expiry date and an 8 digit number where the eight digits is a check digit The 8 digit number can then be used to validate the card number using a modulus 10 check. Your task is to write an application that will: • Allow the user to enter the customer’s details: name, postcode and loyalty card details • Check if the card has expired • Check the loyalty card number is valid by: please o Allowing the user to enter the 8 digits shown on the front of the card o Remove the 8th digit and storing it as ‘check_digit’ o Reversing the numbers o Multiplying the 1st, 3rd,5th and 7th digits by 2  If the result of the multiplication is greater than 9 then subtract 9 from the results o Adding together the resulting 7 digits o Checking if the sum of the added digits plus the ‘check_digit’ is divisible by 10 • Output whether the loyalty card is valid or not • Output the customers and loyalty card details.

Example Calculation

Digit 1 Digit 2 Digit 3 Digit 4 Digit 5 Digit 6 Digit 7 Digit 8 Totals

Card No. 4 6 7 6 4 8 3 3

Stored as Check_digit Reversed 3 8 4 6 7 6 4

Odd x2 6 8 8 6 14 6 8

-9 6 8 8 6 5 6 8

Added up (6 +8 +8 +6 +5 +6 +5) = 47

Plus Check-digit 47 + 3 = 50

The number 50 can be divided exactly by 10 and therefore the card number is valid!
Test data: 4256 7933 4275 7466 4297 4331 4285 7266 4526 7937 42442 7891 4254 7819 4287 4325 4244 8894 4275 7464

ghost commented 7 years ago

https://github.com/DavidBrockway/Check-it-out-

ghost commented 7 years ago

Need help on a few things if you don't mind take a look at the todo list