+1 (208) 254-6996 [email protected]

i have the file answer but i need someone to change answer because Plagiarism

Faculty of Computer Studies

Don't use plagiarized sources. Get Your Custom Essay on
Just from $13/Page
Order Essay

KSA-M275 Web Development Using PHP and MySQL

Tutor Marked Assignment – Fall 2021 2022

Cut-Off Date: to be announced Total Marks: 100


This TMA consists of 3 questions, where you are required to answer all of the questions. The TMA will be corrected by your tutor and you will be provided with a proper feedback file to understand your mistakes and avoid them on the final exam.

Plagiarism Warning:

As per AOU rules and regulations, all students are required to submit their own TMA work and avoid plagiarism. The AOU has implemented sophisticated techniques for plagiarism detection. You must provide all references in case you use and quote another person’s work in your TMA. You will be penalized for any act of plagiarism as per the AOU’s rules and regulations. For the similarity, it will be considered starting from 80% and it should be as follows:

Similarity %Deduction
30-4930% of the achieved mark
50-6950% of the achieved mark
70-8970% of the achieved mark
90-100Students get zero

Declaration of No Plagiarism by Student (to be signed and submitted by student with TMA work):

I hereby declare that this submitted TMA work is a result of my own efforts and I have not plagiarized any other person’s work. I have provided all references of information that I have used and quoted in my TMA work.

Name of Student:



Question-1[50 marks]

The purpose of this question is to develop a web page that prompts the user to enter three values about an isosceles triangle, the left coordinates of its base, the length of its base and the triangle height. Then the web page calculates the right coordinates of its base, the coordinates of the triangle vertexand the length of the equal sides.

Hint: You can consider that the base of the isosceles triangle is always parallel to x-axis (horizontal base).

The web page should be implemented by using only the basic HTML tags and PHP codes that you learnt in this course. The final code with 2 snapshots should be provided in your answer sheet.

The designed web page should include a title, a header, an input form for entering the required values and an output form for presenting the calculated values or a suitable message when some violations are occurred. The design and the layout of the web page are left intentionally for the student to distinguish his/her TMA form other students and to show his/her creativity in designing the web page.

The PHP part should include at least two PHP function for computing the coordinates of the triangle vertices and length of the triangle sides.



if(!isset($_POST[‘x1’])) $_POST[‘x1’]=”;

if(!isset($_POST[‘y1’])) $_POST[‘y1’]=”;

if(!isset($_POST[‘x2’])) $_POST[‘x2’]=”;

if(!isset($_POST[‘y2’])) $_POST[‘y2’]=”;

if(!isset($_POST[‘y3’])) $_POST[‘x3’]=”;

if(!isset($_POST[‘y3’])) $_POST[‘y3’]=”;

if(!isset($_POST[‘side’])) $_POST[‘side’]=”;

if(!isset($_POST[‘base’])) $_POST[‘base’]=”;

if(!isset($_POST[‘height’])) $_POST[‘height’]=”;

if(!isset($_POST[‘note’])) $_POST[‘note’]=”;

if(isset($_POST[‘submit’]) )






if( $x1==” || $y1==” || $base==”|| $height==”)


$_POST[‘note’]= ” There some non filled text boxes!”;




if(is_numeric($x1) && is_numeric($y1) && is_numeric($base) && is_numeric($height) )








$_POST[‘note’]= “”;




$_POST[‘note’]= ” There some none numerical values!”;




if(isset($_POST[‘clear’]) )













function computingCoordinates($x1,$y1,$base,$height)






$points = array();

array_push($points, $x2);




return $points;


function computeSide($base,$height)


return sqrt(($height*$height)+($base*$base/4));





<title> Isosceles Triangle System </title>


h1{color:blue; font-weight:bold;}






<h1>Isosceles Triangle System : </h1>

<form method=”POST” action=”<?php echo $_SERVER[‘PHP_SELF’];?> “>

<label>left coordinates of base (V1)</label>&nbsp;&nbsp;

<label> x1 = </label>

<input type = “text” name=”x1″ size=”15″ value=”<?php echo $_POST[‘x1’] ?>”>

&nbsp;&nbsp; <label> y1 = </label>

<input type = “text” name=”y1″ size=”15″ value=”<?php echo$_POST[‘y1’] ?>”>


<label>The triangle height:</label>&nbsp;&nbsp;

<input type = “text” name = “height” size=”15″ value=”<?php echo $_POST[‘height’] ?>”>


<label>The length of base</label>&nbsp;&nbsp;

<input type = “text” name=”base” size=”15″ value=”<?php echo $_POST[‘base’] ?>”>


<input type = “submit” name = “submit” value=”Submit”/>

<input type = “submit” name = “clear” value=”Clear”/><br/><br/>

<label>Right coordinates of base (V2)</label>&nbsp;&nbsp;

<label> x2 = </label>

<input type = “text” name = “x2″ size=”15″ value=”<?php echo $_POST[‘x2’] ?>”>

&nbsp;&nbsp; <label> y2 = </label>

<input type = “text” name=”y2″ size=”15″ value=”<?php echo$_POST[‘y2’] ?>”>


<label>The coordinates of the triangle vertex (V3)</label>&nbsp;&nbsp;

<label> x3 = </label>

<input type = “text” name = “x3″ size=”15″ value=”<?php echo $_POST[‘x3’] ?>”>

&nbsp;&nbsp; <label> y3 = </label>

<input type = “text” name = “y3″ size=”15″ value=”<?php echo$_POST[‘y3’] ?>”>


<label> The length of the equal sides = </label>

<input type = “text” name = “side” size=”15″ value=”<?php echo$_POST[‘side’] ?>”>


<label> Explanation = </label>

<input type = “text” name=”note” size=”60″ style=”font-size:17px;” value=”<?php echo$_POST[‘note’] ?>”>




Question-2[20 marks]

Blood Bank Management Information System (BBMIS) is a database management system that provides blood to the patients who need blood. BBMIS keeps some records about blood donations that facilitate the searching for a certain blood group.

In this regard, you are asked to do some research about BBMIS, select one of the aspects that managed by BBMIS and then design two database tables about this aspect [14 marks] and another database table that represents a relation between the previous two tables [6 marks]. For each table you need to:

1- Define the objective(s) of the table.

2- Design at least five fields for the table; data type and size.

3- Determine the primary key of the table.



· Donor table: to store and retrieve the donor information as id, first name, last name, date of birth and blood group.

· Patient table: to store the patient information as patient ID, first name, last name, date of birth and blood group.

· Blood table: To store the donated bloods from donors and to store any patient who took blood. The information are blood id, patient id, donor id, blood group and expire date.


Donor table:


Patient table:

Patient_IDvarchar(10)First_NameVarchar(25)Last_NameVarchar(25)DoBdateMobileVarchar(10)BloodGroupVarchar (3)

Blood table:



TablePrimary key
Question-3[30 marks]

A new company is planning to build a new database system for holding information about Railway Reservation System (RSS). ‘Passengers’, ‘Train Tickets’, and ‘Reservations’ are part of the information that the new company wants to store in the new database. These tables are shown below in figure 1, figure 2 and figure 3. The new company intends to use MySQL for building the new database.

Passenger IDPassenger NamePassenger AgePassenger Gender

Figure 1: Passengers table

Ticket IDDate of FlightDeparture TimeLanding TimeDestination

Figure 2: Train Tickets table

Reservation IDPassenger IDTicket IDDate Reservation

Figure 3: Reservations table

Based on the above three tables, answer the following 6 questions: You need to provide for every SQL a screen shot that shows the implementation of the SQL and the result of that SQL.

1- Write an SQL statement for creating the Passengers table that is shown in figure 1. No need to write any SQL statement for adding any record to the Passengers table.

[5 marks]

2- Write an SQL statement for adding one record to the Passengers table that was created in question-1 above. The added record should be one of the records that are given in the Passengers table. [5 marks]

3- Write an SQL statement to list the names of all males passengers whose age between 30 and 50. [5 marks]

4- Write an SQL statement to list the names of all passengers who made reservations in 2020. [5 marks]

5- Write an SQL statement to list the names of all passengers whose departure time was before 16:00 and destination address is Jeddah or Riyadh. [5 marks]

6- Write an SQL statement to list the names of all passengers whose destination address is Al-Dammam. [5 marks]



Create table Passengers (

Passenger_ID int(3) primary key,

Passenger_Name varchar(20) not null,

Passenger_Age int(3) not null,

Passenger_Gender varchar(6) not null



Insert into Passengers values (824,’Ahmad’,56,’Male’);


Select Passenger_Name

From Passengers

Where Passenger_Gender=’Male’

And Passenger_Age between 30 and 50


Select Passenger_Name

From Passengers, Reservations

Where Passengers.Passenger_ID=reservations.Passenger_ID

and Date_Reservation BETWEEN ‘2020/1/1’ and ‘2020/12/31’


Select Passenger_Name

From Passengers, Reservations ,train_tickets

Where passengers.Passenger_ID=reservations.Passenger_ID

and reservations.Ticket_ID=train_tickets.Ticket_ID

and Departure_Time <’16:00′

and Destination in (‘Jeddah’,’Riyadh’)


Select Passenger_Name

From Passengers, Reservations ,Train_tickets

Where passengers.Passenger_ID=reservations.Passenger_ID

and reservations.Ticket_ID=train_tickets.Ticket_ID

and Destination =’Al-Dammam’


قبل الخطوات 3 الى 6

Insert into Passengers values (824,’Ahmad’,56,’Male’);

Insert into Passengers values (585,’Bushra’,22,’Female’);

Insert into Passengers values (826,’Aziz’,44,’Male’);

Insert into Passengers values (647,’Bashar’,23,’Male’);

Insert into Passengers values (492,’Karima’,60,’Female’);

Insert into Passengers values (405,’Dawoud’,52,’Male’);

Insert into Passengers values (812,’Farid’,63,’Male’);

Insert into Passengers values (743,’Fawaz’,38,’Male’);

Insert into Passengers values (413,’Fawazi’,56,’Male’);

Insert into Passengers values (703,’Zahra’,37,’Female’);

Create table Train_Tickets(

Ticket_ID int primary key, Date_of_Flight date,

Departure_Time time,

Landing_Time time, Destination char(20)) ;

Insert into Train_Tickets values(24926,’2020/11/27′,’18:59′,’22:00′,’Al-Dammam’);

Insert into Train_Tickets values(70547,’2021/10/08′,’19:07′,’1:34′,’Tabuk’);

Insert into Train_Tickets values(72256,’2021/1/26′,’23:41′,’1:20′,’Riyadh’);

Insert into Train_Tickets values(18744,’2021/7/20′,’18:18′,’22:20′,’Riyadh’);

Insert into Train_Tickets values(44835,’2020/10/11′,’12:55′,’15:20′,’Dhahran’);

Insert into Train_Tickets values(59459,’2021/5/11′,’13:28′,’19:05′,’Jeddah’);

Insert into Train_Tickets values(22546,’2020/12/29′,’18:14′,’2:42′,’Riyadh’);

Insert into Train_Tickets values(31500,’2021/6/1′,’14:06′,’18:29′,’Jeddah’);

Insert into Train_Tickets values(40542,’2020/11/11′,’11:24′,’14:34′,’Dhahran’);

Insert into Train_Tickets values(39696,’2021/1/12′,’23:42′,’4:47′,’Al-Dammam’);

Create table Reservations (

Reservation_ID int primary key,

Passenger_ID int ,

Ticket_ID int ,

Date_Reservation date


Insert into Reservations values(853731,703,44835,’2020/11/5′);

Insert into Reservations values(627567,826,40542,’2020/11/9′);

Insert into Reservations values(487586,824, 24926,’2020/11/20′);

Insert into Reservations values(472258,812, 22546,’2020/12/27′);

Insert into Reservations values(153534,703, 39696,’2021/1/10′);

Insert into Reservations values(166820,826, 72256,’2021/1/19′);

Insert into Reservations values(490694,824, 59459,’2021/5/5′);

Insert into Reservations values(369987,743, 31500,’2021/5/25′);

Insert into Reservations values(247524,647, 18744,’2021/7/19′);

Insert into Reservations values(151989,703, 70547,’2021/10/1′);

M275-TMA Page -3- Fall 2021 2022

Order your essay today and save 10% with the discount code ESSAYHELP