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
Add code to this loop, to pick up all of the radios, with only seven blocks.
Goshia [24]

Answer:

umm

Explanation:

what do you mean by that

4 0
2 years ago
Write a function that takes in two parallel lists: a list of times (in increasing order), and a list of distance traveled by tha
Georgia [21]

Below is the function that takes two parallel lists;

List of times in increasing order and that of distance travelled by that point in time.

I put into consideration the instructions given in the question.

ANSWER;

def find_velocity(time, distance):

velocities = []

for i in range(1, len(time)):

velocities.append((distance[i] - distance[i - 1]) / (time[i] - time[i - 1]))

return velocities

times are = [1, 3, 5, 7]

distances are = [25, 29, 35, 70]

print(find_velocity(times, distances))

7 0
3 years ago
All of the following are considered active job search methods EXCEPT _____. a. sending out resumes b. attending job training pro
LuckyWell [14K]
A sending out resumes
5 0
3 years ago
Read 2 more answers
Which tab should you choose to add a picture from a file to your presentation?
Tems11 [23]

C. Insert

Insert will let you inseet different things into your presentation.

6 0
3 years ago
What are the main differences between photo and video formats?
horrorfan [7]

Answer:

Nothing just the video is series of photos together

Explanation:

8 0
3 years ago
Other questions:
  • What is the best overall approach to education and career development for IT professionals?
    14·1 answer
  • When paying bills online, a payee is:
    9·1 answer
  • Which of the following attacks seeks to introduce erroneous or malicious entries into a server's hostname-to-IP address cache or
    5·1 answer
  • Which of the following are not parts of a message? Select all that apply.
    12·1 answer
  • Create a class named Console, and move all the methods that retrieve and validate user input to that class. These methods can re
    7·1 answer
  • A student that earns a well qualified score on an ap exam would receive a ___
    13·1 answer
  • Which term collectively describes hard disks, CDs, and flash drives?
    11·2 answers
  • Which media device uses the characteristic continuous?
    10·1 answer
  • Perceptron simplest definition
    14·1 answer
  • 25 points
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!