Question-1

The purpose of this question is to develop a simple calculator for solving a quadratic equation of the form Ax2 + Bx + C = 0. The solution of the quadratic equation can be classified as a real or an imaginary solution. In this question you are required to apply two formulas for solving the quadratic equation; the discriminant formula and quadratic formula.

The discriminant formula is applied for determining whether the quadratic equation has a real or imaginary solution, where the quadratic formula is applied for finding the real solution(s) of the quadratic equation.

If the quadratic equation has a real solution, the calculator should find that real solution(s) by applying the quadratic formula. But if the quadratic equation has an imaginary solution, the calculator should notify only that there is an imaginary solution without finding that solution.

In this question you might need to make a quick revision through the internet to remember how to solve the quadratic equation by using discriminant and quadratic formulas.

The quadratic calculator should be implemented by using HTML tags and PHP codes. The final code with 2 snapshots should be provided in your answer sheet.

The calculator software system starts by browsing the calculator web page with:

  • A suitable title.
  • A suitable header.
  • Three empty textboxes with suitable labels for holding the three coefficients A, B and C of the quadratic equation.
  • An empty textbox with suitable label for holding the real solution(s) or holding a notification for the imaginary solution.
  • Two buttons with suitable labels, one for solving the quadratic equation and the other for clearing all values displayed in the coefficients textboxes and the solution textbox.

Note:

The design and the layout of the calculator's web page are left intentionally for the student to show his/her creativity in this part.

The PHP part of the calculator software system should include two functions as described below:

  • A PHP function for testing whether the quadratic equation has a real or an imaginary solution.
  • A PHP function for finding the real solution(s) of the quadratic equation.

The calculator software system should satisfy the following requirements:

  • The numerical values of the coefficients A, B and C of the quadratic equation may be any numerical value except zero.
  • The solution(s) of the quadratic equation should be shown only in the solution textbox when all coefficients textboxes are filled with numerical values and after pressing on the button that allocated for starting the solving process. Otherwise a suitable message should be shown in the solution textbox to notify that at least one of the coefficients text boxes is filled with none numerical value.
  • A suitable message should be shown in the solution textbox when the quadratic equation has an imaginary solution.
  • The solution of the quadratic equation should be rounded to 3 decimal places.
  • The solution of other quadratic equations can be calculated by changing only the coefficients' values in the textboxes and pressing on the button that allocated for starting the solving process.

A Business students' association is a new ITC college in Bahrain that keeps information about students, courses and instructors in an Excel sheet. Some of this information is shown in figure 1 below.

Student Course Instructor
Id Name Major Code Name Grade Id Name
111 Majed ITC M257 Advanced Java A 110011 Jamal
112 Ali ITC M363 Software Engineering C 110012 Faten
111 Majed ITC M129 Calculus A 110011 Jamal
114 Sameer BAS M257 Advanced Java C 110011 Jamal
115 Maha ITC M363 Software Engineering C 110012 Faten
114 Sameer BAS GR131 Bahrain History B 110015 Yusuf
115 Maha ITC M132 Linear Algebra D 110020 Waleed
113 Batool English EL111 Elementary English B+ 110035 Habib
111 Majed ITC AR112 Arabic Language C+ 110015 Yousef
112 Ali ITC M257 Advanced Java A 110011 Jamal

Figure 1: Student Information Excel Sheet.

This sheet does not satisfy the basic design' rules of database. In this question, as a database designer/developer, you are requested to:

  • Determine, with examples, the basic database design' rules that were not satisfied in the previous Excel sheet.
  • Develop a new database design for the information saved in the previous Excel sheet so that all mistakes and violations made in the previous design will be removed and the new design satisfies the third normal form.

Question-3

A new ITC College in Bahrain is planning to build a new database system for holding information about students, courses, projects and tutors. 'Student' and Project are part of the information that the new college wants to store in the database. These tables are shown below in figure 2 and figure 3. The new college will use MySQL for building the database.

Student ID Student First Name Student Last Name Project Id
111 Suhaila Salman 1005
222 Mazen Hamad 1003
333 Fayrooz Faris 1008
444 Irfan Salem 1009
555 Hadi Farhan 1007
666 Fatima Ali 1004
777 Waleed Khamis 1006
888 Maysoon Jaber 1001
999 Jana Mohammad 1002

Figure 2: Student Table

Project Id Project Name Start Date Completion Date
1001 Search for Driver Coash 18/10/2018 15/05/2019
1002 Dawrat 25/08/2018 13/04/2019
1003 Private Teacher 31/01/2018 21/02/2019
1004 Appointment for Dental Clinic 28/12/2017 24/04/2018
1005 House Budget Expenses 16/04/2017 19/08/2018
1006 Food Order 22/11/2016 14/03/2017
1007 Car Rental Management System 20/12/2016 27/2/2017
1008 Flat Rental Management System 18/02/2017 18/06/2017
1009 Cold Store Accounting System 30/11/2018 25/5/2019

Figure 3: Project Table

Based on the above two tables, answer the following 6 questions:

  • Write an SQL statement for creating the project table that is shown in figure 3.
  • Write an SQL statement for creating the student table that is shown in figure 2.
  • Write an SQL statement for adding one record to the project table that was created in question-1 above.
  • Write an SQL statement for adding one record to the student table that was created in question-2 above.
  • Write an SQL statement to list the first name and the last name of all students who completed their projects.
  • Write an SQL statement to list the id, the first name and the last name of all students with the project name they work or worked on. The list should be sorted by the project completion date in descending order.
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.