Question
2) When taking data from the user, some validations (such as valid email address, valid phone number, etc.) must be performed. Write a function that
2) When taking data from the user, some validations (such as valid email address, valid phone number, etc.) must be performed. Write a function that take a string and return email if it is a valid email address, phone if it is a valid phone number, number if it is a valid numeric data, and date if it is a valid date.
Youre to decide which date format and phone number your function will be validating.
3) To add or register a new PV module, a manufacturer must fill out and submit a module detailed specifications (MDS) form. A sample to use in this PD is attached. Write a function that prompts the user to enter data from the MDS then returns the dictionary of these data.
Note: Use the same specifications for all the modules in the test results. Only the model numbers are different.
4) Each user must register with the portal. A user could be a Manufacturer, a Testing Lab, or any interested party. Write a function that takes a user registration and returns a dictionary of data. To register, a user provides the following information:
username & password to log in next time
first name
middle name (optional)
last name
company name
company type (test lab or manufacturer)
address
office phone number
cell phone number
email address
5) Main function
- Get the MDS data and instantiate:
A product (i.e. a new PV module) with the relevant data.
Note that it would require you to instantiate a manufacturer; which in turn will also require you to instantiate a contact person.
Insert the data into the relevant tables in the database
- Get the test results data file
- Read in the content and store into the relevant tables in the database
- Retrieve data from the database and display the information below in a tabular format:
Manufacturer |
| |||
Contact name |
| |||
Contact Email |
| |||
Cell Technology |
| |||
Rated Power |
| |||
| Baseline | TC200 | Damp Heat | HF10 |
Average Isc |
|
|
|
|
Average Voc |
|
|
|
|
Average Pmax |
|
|
|
|
Average Pmax drop from Baseline average | 0% |
|
|
|
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started