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
You are preparing to program a replacement system board, but the "system is booting in mpm mode" message is not displayed. what
Romashka [77]

The bios is not setup properly for the system, as such the OS is not loaded properly. It is basically on factory mode state of unit testing, if the unit is in warranty have the vendor fix this as they have to deactivate the MPM or manufacturing programming mode or from your end make sure that the disk which contains the OS is properly loading.

5 0
3 years ago
Read 2 more answers
What is the scope of numC?
GREYUIT [131]

Answer:

local scope which is the entire body of the function/method that it is being used in

Explanation:

The variable numC has a local scope which is the entire body of the function/method that it is being used in, which in this scenario is the passwordMaker method. This is because the variable numC is being used as a parameter variable for that method, meaning that a piece of information is being inputted by when the method is called and saved as the variable numC which is then used by the lines of code inside the method, but cannot be accessed from outside the method thus.

5 0
2 years ago
Read 2 more answers
1 Explain the difference between using a computer program and programming a computer.
Zanzabum
Well when you are using a computer program you are using a program. If you are programming a computer you are making the computer do a desired task. 
7 0
2 years ago
In 3 to 5 sentences, describe whether or not files should be deleted from your computer. Explain you answer.
daser333 [38]
I mean if your trying to delete like important files I dont think they should be deleted but that is My opinion. But if you do delete them then u could always got to the recycle bin in ur computer to get it back. I hope this helps !!
7 0
3 years ago
Read 2 more answers
How would a barcode reader be used in a healthcare industry?​
Leto [7]

Answer:

As you know the on going situation we are in, barcodes can be really useful for an example using them to check into a building that way when there is a infected person it is a really esay process to track down people that have been in that area.

5 0
2 years ago
Other questions:
  • Number Analysis Program: Write a program that reads data from the text file numbers.txt. Assume the file contains a series of nu
    14·1 answer
  • Why is wearable technology important?
    12·1 answer
  • Why is there a need to compare and align one's PECs of a successful entrepreneur?
    5·1 answer
  • Amy has decided to use a dark background and light colored text for her prensentation. Which toolbar option will let her change
    5·1 answer
  • Which one of the following is not the name of a 20th century school composition
    14·2 answers
  • PLEASE HELP<br><br><br> i’m doing a internet safety brochure. what is a good hook ?!
    14·1 answer
  • Mr. Perry has bookmarked a large number of webpages in Chrome while researching class topics. Unfortunately, he's bookmarked so
    13·1 answer
  • A properYour customer has connected a 1000-watt microwave oven and a 600-watt mixer to a 15-amp branch service line for the kitc
    11·2 answers
  • When planning the structure of a spreadsheet, columns are for _______ items and rows are for _______ items.
    5·2 answers
  • La estructura basica de una pagina web en Html​
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!