Modify the code on part-1.php, as indicated below. a. Create the additional properties for the class Customer: i. address ii. telephone b. Set an appropriate value for each of the newly created property, address and telephone,  in the customer object c. Set an appropriate value for forename and surname in the customer object.  d. Display the customer’s forename and surname before their email. Both forename and  surname should be on the same line e. Display the customer’s address on its own line, after their email. Capture your output  with a screenshot f. Use the withdraw method to withdraw $100 for an object of the class, Account g. Update your code to display the new balance. Capture your output with a screenshot

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Modify the code on part-1.php, as indicated below.
a. Create the additional properties for the class Customer:
i. address
ii. telephone
b. Set an appropriate value for each of the newly created property, address and telephone, 
in the customer object
c. Set an appropriate value for forename and surname in the customer object. 
d. Display the customer’s forename and surname before their email. Both forename and 
surname should be on the same line
e. Display the customer’s address on its own line, after their email. Capture your output 
with a screenshot
f. Use the withdraw method to withdraw $100 for an object of the class, Account
g. Update your code to display the new balance. Capture your output with a screenshot

------

<?php
class Customer//This comment is used to indicate that the a class called 'Customer' is being created
{
    public string $forename;
    public string $surname;
    public string $email;
    public string $password;
}

class Account //This a class named, Account
{
    public int    $number;
    public string $type;
    public float  $balance;
}

  public function withdraw(float $amount): float
    {
        $this->balance -= $amount;
        return $this->balance;
    }

$customer = new Customer();//An instance of 'customer' class is created using the 'new' operator
$account  = new Account(); //same is done with the 'Account' class
$customer->email  = 'ivy@eg.link'; //Here, the email property of the customer object is given a value
$account->balance = 1000.00;// The account property of the customer object is given a value
?>
<?php include 'includes/header.php';//This includes the file name header.php ?> 
  <p>Email: <?= $customer->email ?></p>
  <p>Balance: $<?= $account->balance ?></p>
<?php include 'includes/footer.php';//This includes the file name footer.php ?>

Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Development strategies
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education