1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Verizon [17]
3 years ago
7

Create an abstract Student class for Parker University. The class contains fields for student ID number, last name, and annual t

uition. Include a constructor that requires parameters for the ID number and name. Include get and set methods for each field; the setTuition() method is abstract. Create three Student subclasses named UndergraduateStudent, GraduateStudent, and StudentAtLarge, each with a unique setTuition() method. Tuition for an UndergraduateStudent is $4,000 per semester, tuition for a GraduateStudent is $6,000 per semester, and tuition for a StudentAtLarge is $2,000 per semester.
Computers and Technology
1 answer:
MrRa [10]3 years ago
5 0

Answer:

<?php

abstract class Student {

 public $Id; // field for student ID  Number

 public $Lastname; // field for student last name

 public $Tuition; // field for annual tuition

 public function __construct( $id, $lastname) { // constructor property to initialise id number and lastname

  $this->Id = $id; // variable initialisation

  $this->Lastname = $lastname;

 }

 // set Id number

 public function setId($id) {

  return $this->Id = $id;

 }

 // get id number

 public function getId() {

  return $this->Id;

 }

   // set lastname

 public function setLastname($lastname) {

  return $this->Lastname = $lastname;

 }

 // get lastname

 public function getLastname() {

  return $this->Lastname;

 }

   //the setTuition() method is abstract

 abstract public function setTuition($amount);

 // get Tuition fee

 public function getTuition(){

  return $this->Tuition;

 }

}

 // UndergraduateStudent is a subclass that inherits the properties of class Student

class UndergraduateStudent extends Student {

 public function setTuition($amount) {

  return $this->Tuition = $amount;

 }

}

class GraduateStudent extends Student {

 public function setTuition($amount) {

  return $this->Tuition = $amount;

 }

}

class StudentAtLarge extends Student{

 public function setTuition($amount) {

  return $this->Tuition = $amount;

 }

}

   // create an instance of the class

$Undergraduate = new UndergraduateStudent(1,"Anyadike");

   // call all required methods

   echo '<span> id: </span>'.$Undergraduate->getId();

   echo '<span> name:</span>'.$Undergraduate->getLastname();

   echo "<span> Tution:</span>".$Undergraduate->setTuition("$4000");

 echo "<br>";

$GraduateStudent = new GraduateStudent(2,"Okonkwo");

   echo '<span> id: </span>'.$GraduateStudent->getId();

   echo '<span> name:</span>'.$GraduateStudent->getLastname();

   echo "<span> Tution:</span>".$GraduateStudent->setTuition("$6000");

 echo "<br>";

$StudentAtLarge = new StudentAtLarge(3,"Ojukwu");

 echo '<span> id: </span>'.$StudentAtLarge->getId();

   echo '<span> name:</span>'.$StudentAtLarge->getLastname();

   echo "<span> Tution:</span>".$StudentAtLarge->setTuition("$2000");

?>

Explanation:

explanations are detailed in the comment (//)

You might be interested in
_____ is a form of witty, amusing speech that is often used to bring people together.
Neporo4naja [7]

Answer:Informative

Explanation:

5 0
3 years ago
Read 2 more answers
An ipv4 address in the range 169.254.0.1 through 169.254.255.254 indicates a problem with what type of service
DENIUS [597]

Dynamic Host Configuration Protocol, also known as DHCP.

3 0
3 years ago
What is the best free game designing program for windows
Nadusha1986 [10]
Python, Unity 3D, C++Notepad
8 0
3 years ago
When breaking a problem down, you often encounter elements that you want to use repeatedly in your code. Sometimes it's appropri
ddd [48]

<u>Answer:</u>

<em>FUNCTION:</em>

  • A function does not require the number of times that the <em>code script needs to be executed </em>
  • When we go for large programming, ie. while creating projects, we can invoke function from one file to another based on the access <em>specifier mentioned for the function. </em>
  • There is a stack call created in the memory whenever a <em>function is called. </em>

<em>LOOP :</em>

  • Whereas the number of times that the loop has to be <em>executed must be defined </em>
  • A loop cannot be called, it can be used only the code block in <em>which it is present. </em>
  • There is not overhead of creating a stack since it is not invoked and there is no <em>transfer of control from one module to another </em>

8 0
3 years ago
unlike tv or newspaper ads, internet communications are interactive, and consumers can choose which messages and information the
Softa [21]

Companies often engage the services of Advertising firms to market their products. Company web offerings can be tailor-made for the consumers.

  • Advertising agencies are firms that makes, plan and handle the advertising needs of any business. They are known for handling negotiations creating tailored marketing campaigns.

A lot of agencies do not want to talk about pricing until they know what you can afford to spend.

Tailored content are delivered experiences that speak directly to customers.

This agencies uses their connections and resources to make one's campaign successful and cost-efficient.

Learn more from

brainly.com/question/23477855

5 0
2 years ago
Other questions:
  • All of the following are qualities of an aprenticeship except
    12·1 answer
  • In your memo, give three new employees directions for starting the computer and opening a word-processing document.
    9·1 answer
  • Which option allows you to customize the order of your data ?
    8·2 answers
  • Which option marks all modification made within a document? Review Comment Track Changes Balloons
    15·2 answers
  • How many check boxes from the following code can be selected at any given time? Home Address Federal Express UPS
    13·1 answer
  • In which of the following situations will a macro make your work more efficient?
    9·1 answer
  • Which are technical and visual demands that need to be considered when planning a project? Choose three answers
    10·1 answer
  • Essay about evolution of media shaped the values and norms of the society
    11·1 answer
  • Hello guys please help me <br>list and identify the components of computer ​
    15·1 answer
  • Class ____________ allow you to create one version of a class, without having to replicate code to handle multiple data types.
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!