Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

You have been asked to develop an application that will be used by CS265 Web Sho

ID: 3715078 • Letter: Y

Question

You have been asked to develop an application that will be used by CS265 Web Shopping Network (WSN). First you need to design a class that will be used to represent every customer who makes purchases with C$265 WSN using their CS265 WSN credit card. The class should contain the following properties/attributes (private) 1. customer first name 2. customer last name 3. customer email address 4. customer alias 5, customer CS265 credit card account number 6. customer PIN/password 7. customer balance 8. customer limit The class should also contain the following methods (public) 1. 2. 3. constructor with parameters getter for each data field setter for each data field Instructions 1. Create folder named CS265WSN 2. Inside this folder, create the PHP class (WSNCustomerClass.php) using the information from above. 3. Inside this folder, write test drivers for the WSNCustomerClass PHP class. a. TestDriverl.php: Initialize attributes using the constructor with parameters. Use getters to b. TestDriver2.php: Initialize attributes using the constructor with parameters then modify c. TestDriver3.php: Initialize attributes using constructor with parameters (parameters are access and displav attributes. attributes with setters. Use getters to access and display attributes. read in from a data file. Use ? to separate data members). (Use it to create an array of objects). Use getters to access and display attributes. TestDriver4.php: Initialize attributes using constructor with parameters (parameters are read in from a data file. Use ? to separate data members). (Use it to create an array of objects). Use getters to access and display attributes. Then modify attributes with setters. Use getters to access and display the updated attributes. d.

Explanation / Answer

//WSNCustomerClass.php

<?php

// Customer class with member properties and methods

class Customer{

var $first_name;

var $last_name;

var $email;

var $alias;

var $cc_number;

var $pin;

var $balance;

var $limit;

function __construct($first_name, $last_name, $email, $alias, $cc_number, $pin, $balance, $limit){

$this->first_name = $first_name;

$this->last_name = $last_name;

$this->email = $email;

$this->alias = $alias;

$this->cc_number = $cc_number;

$this->pin = $pin;

$this->balance = $balance;

$this->limit = $limit;

}

function get_first_name(){

return $this->first_name;

}

function get_last_name(){

return $this->last_name;

}

function get_email(){

return $this->email;

}

function get_alias(){

return $this->alias;

}

function get_cc_number(){

return $this->cc_number;

}

function get_pin(){

return $this->pin;

}

function get_balance(){

return $this->balance;

}

function get_limit(){

return $this->limit;

}

function set_first_name($value){

$this->first_name = $value;

}

function set_last_name($value){

$this->last_name = $value;

}

function set_email($value){

$this->email = $value;

}

function set_alias($value){

$this->alias = $value;

}

function set_cc_number($value){

$this->cc_number = $value;

}

function set_pin($value){

$this->pin = $value;

}

function set_balance($value){

$this->balance = $value;

}

function set_limit($value){

$this->limit = $value;

}

}

//TestDriver1.php

<?php

include_once('WSNCustomerClass.php');

$customer = new Customer('Vishal', 'Jain', 'vishal@jain.com', 'Vishal', 123456789, 0000, 3000.00, 50000);

print 'Customer Information<br/>';

print 'First name: '.$customer->get_first_name().'<br>';

print 'Last name: '.$customer->get_last_name().'<br>';

print 'Email address: '.$customer->get_email().'<br>';

print 'Alias: '.$customer->get_alias().'<br>';

print 'Credit card no.: '.$customer->get_cc_number().'<br>';

print 'PIN: '.$customer->get_pin().'<br>';

print 'Balance: '.$customer->get_balance().'<br>';

print 'Limit: '.$customer->get_limit().'<br>';


//TestDriver2.php

<?php

include_once('WSNCustomerClass.php');

$customer = new Customer('Vishal', 'Jain', 'vishal@jain.com', 'Vishal', 123456789, 0000, 3000.00, 50000);

$customer->set_alias('Vishu');

$customer->set_limit(60000);

print 'Customer Information<br/>';

print 'First name: '.$customer->get_first_name().'<br>';

print 'Last name: '.$customer->get_last_name().'<br>';

print 'Email address: '.$customer->get_email().'<br>';

print 'Alias: '.$customer->get_alias().'<br>';

print 'Credit card no.: '.$customer->get_cc_number().'<br>';

print 'PIN: '.$customer->get_pin().'<br>';

print 'Balance: '.$customer->get_balance().'<br>';

print 'Limit: '.$customer->get_limit().'<br>';

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote