{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

5-Design - Problem Solving 1 1 2 3 4 Never start coding...

Info icon This preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
1) Never start coding unless you understand the task! 2) Gather requirements first. This means identify the problem and ask questions about it. Now you kind of know what to do. 3) Analyze requirements to make sure that they are consistent and complete. Now you know that whatever you are going to do is doable . 4) Produce technical specification (i.e. express the requirements in technical terms). Now you know exactly what to do. 5) Think of what steps you need to take solve the problem and express them verbally to obtain a high- level process description. Now you have a process that you can code! 6) Start coding. Problem Solving Problem Solving
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
* Split complex task in a series of simple steps. * Identify entities the problem deals with. These will be your classes . * Identify what data characterizes your entities. These will be your class properties . * Identify what actions your entities can perform. These will be your class methods . * Find repeated actions and generalize them. These will be your utility functions or utility classes . You will reuse them. * Don’t make any assumptions: check user input and make provisions for worst cases. Process Analysis Process Analysis
Image of page 2
Problem: Determine if the email address is valid. Requirement analysis: What rules can we define to check email address against? What is email address comprised of? [email protected] Local Part @ domain subdomain1.subdomain2.tld Email Validation Task Email Validation Task
Image of page 3

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Core Rules Single ‘@’ character Non-empty Local Part Non-empty domain Non-empty subdomain(s) Non-empty TLD Local Part must not end with ‘.’ Additional Rules 7) 1 < TLD length < 7 8) Local Part length < 65 9) Domain Length < 256 11) Subdomain(s) must not begin with ‘-’ or end with ‘-’ 12) Check for invalid characters: ‘\\’, ‘”’, ‘<‘, ‘>’, ‘)’, ‘(‘, ‘]’, ’[‘, ’;’, ‘,’, ‘:’, ‘|’ 13) Domain cannot contain two ‘-’ in a row 14) Check TLD against the list of ICANN domains Email Validation Rules Email Validation Rules
Image of page 4
General There has to be LocalPart and Domain separated by ‘@’ Must not contain general illegal characters (‘\\’, ‘”’, ‘<‘, ‘>’, ‘)’, ‘(‘, ‘]’, ’[‘, ’;’, ‘,’, ‘:’, ‘|’) LocalPart 0 < Length < 65 Must not end with ‘.’ Domain 0 < Length < 256 There has to be at least one subdomain and a TLD separated by ‘.’ Must not contain ‘@’ All subdomains must be valid TLD must be valid Subdomain 0 < Length < 64 Must not begin or end with ‘-’ TLD 0 < Length < 7 Must not contain ‘-’ OR limit TLD choices to domains from ICANN list.
Image of page 5

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern