Git Product home page Git Product logo

php-exercise's Introduction

php-exercise-01

  • Fork the php-exercise-01 to your account.

  • Do all exercises and push them.

Part 1: Registration 25x๐Ÿ”‘

We will be creating registration and login process for a website.

  1. Create 2 pages:
    a. Registration and Login Page. (home.php)
    b. Logged in Page (safe.php)

  2. The first page should be split in half. The left side is where a user registers, whereas the right side is where the user logs in. Go crazy with the design as the really good ones will get bonus keys

  3. Registration fields:
    a. Full Name
    b. Username
    c. Password
    d. Confirm Password
    e. Email
    f. Phone
    g. Date of Birth
    h. Social Security Number

  4. Login Fields:
    a. Username
    b. Password

  5. On submit all data must be displayed in a nice ordered way. All input must be validated (For full keys use backend validation). This might include a validation of whether the user exists.

Part 2: Income Tax Calculator 35x๐Ÿ”‘

In this exercise we will be creating an income tax calculator. Your task will be to provide an interface for an employee to calculate their salary post income tax.

To do so you must have the following:

  1. A form containing the following fields:
    a. Salary in USD
    b. Radio button with 2 options: Yearly or monthly.
    c. Tax Free Allowance in USD

  2. The results should be shown in a tabular format and should include:
    a. Two columns: monthly and yearly
    b. The following rows:

    • Total salary
    • Tax amount
    • Social security fee
    • Salary after tax

Rules:

  1. All the fields are required.

  2. When you choose monthly or yearly the calculation must adjust accordingly

  3. There are some salary ranges that will affect the percentage of the tax. Below is the list of yearly salaries and their taxes:

    • salary < 10,000$: 0% tax
    • 10,000$ < salary < 25,000$: 11% Tax
    • 25,000$ < salary < 50,000$: 30% tax
    • salary > 50,000$: 45% tax

  4. Tax free allowance must be added to salary after tax.

  5. A social security fee worth 4% of the salary is deducted from salary for anyone with salary > 10,000$.

  6. The site must be extremely user friendly and looks good. You will receive extra keys for your creativity.

  7. Bonus 5x๐Ÿ”‘ if you stay in the same page on submit and maintain the inputs in their respective input fields.

Part 3: Palindrome 5x๐Ÿ”‘

Write a function that takes a string as a parameter and returns true if the string is a palindrome and false otherwise. A string is considered a palindrome if it has the same sequence of letters when reversed (for example, "radar", "mom", "a", "").

  • Function input should be from the query string.
  • Your function should be case insensitive.

Part 4: Multidimensional Arrays 10x๐Ÿ”‘

You have the following array:

Array ( [musicals] => Array ( [0] => Oklahoma [1] => The Music Man [2] => South Pacific ) [dramas] => Array ( [0] => Lawrence of Arabia [1] => To Kill a Mockingbird [2] => Casablanca ) [mysteries] => Array ( [0] => The Maltese Falcon [1] => Rear Window [2] => North by Northwest ) )

Create the multidimensional array from it and then print it out as follows (exact same):

MUSICALS
----> 0 = Oklahoma
----> 1 = The Music Man
----> 2 = South Pacific
DRAMAS
----> 0 = Lawrence of Arabia
----> 1 = To Kill a Mockingbird
----> 2 = Casablanca
MYSTERIES
----> 0 = The Maltese Falcon
----> 1 = Rear Window
----> 2 = North by Northwest

Once you are done, sort the array in decreasing order by genre.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.