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
Before creating a brief to design a product, what is needed
castortr0y [4]

Answer:

A good design brief often begins with some information about the client and what their brand stands for. Including this helps to connect an individual project with the bigger picture. Aim to capture key points about what the company does, how big they are, and what their key products or services are.

Explanation:

A good design brief often begins with some information about the client and what their brand stands for. Including this helps to connect an individual project with the bigger picture. Aim to capture key points about what the company does, how big they are, and what their key products or services are.

8 0
3 years ago
Why are high-quality transformers wound with large diameter wire?
lesya692 [45]
So that they can lower the I2R losses
8 0
3 years ago
An elevator of mass 250kg is carrying two persons whose masses are 50kg and 100kg. if the force exerted by the motor is 3000N. C
Agata [3.3K]

m_{elevator}=250kg \\m_{people}=50kg+100kg=150kg \\m_{motor}\approx3000N\div10\frac{m}{s^2}\approx300kg \\m_{total}\approx250kg+150kg+300kg\approx\boxed{700kg}

Hope this helps.

r3t40

5 0
3 years ago
Mental state shift involves what?
Delvig [45]

Answer:

It involves a matter involving doubt, uncertainty, or difficulty that may be solved, problem ... getting into a frame of mind to be creative and solve problems.

Explanation:

Hope i am marked as brainliest answer

5 0
3 years ago
Write a program that prompts the user to enter a series of numbers between 0 and 10 asintegers. The user will enter all numbers
Anna71 [15]

Answer:

The program in Python is as follows:

import collections

from collections import Counter

from itertools import groupby

import statistics

str_input = input("Enter a series of numbers separated by space: ")

num_input = str_input.split(" ")

numList = []

for num in num_input:

         if(num.lstrip('-').isdigit()):

                   if num[0] == "-" or int(num)>10:

                             print(num," is out of bound - rejecting")

                   else:

                             print(num," is valid - accepting")

                             numList.append(int(num))

         else:

                   print(num," is not a number")

print("Largest number: ",max(numList))

print("Smallest number: ",min(numList))

print("Range: ",(max(numList) - min(numList)))

print("Mode: ",end = " ")

freqs = groupby(Counter(numList).most_common(), lambda x:x[1])

print([val for val,count in next(freqs)[1]])

count_freq = {}

count_freq = collections.Counter(numList)

for item in count_freq:

         print(item, end = " ")

         lent= int(count_freq[item])

         for i in range(lent):

                   print("#",end=" ")

print()

Explanation:

See attachment for program source file where comments are used as explanation. (Lines that begin with # are comments)

The frequency polygon is printed using #'s to represent the frequency of each list element

7 0
3 years ago
Other questions:
  • While working alone at their respective constant rates, computer X processes 240 files in 4 hours and computer Y processes 240 f
    11·1 answer
  • Jane is a postproduction crewmember for a film. Her responsibilities include arranging all the scenes that have been shot into t
    7·1 answer
  • The _______ number system allows digital devices to represent virtually any number simply by using 0s and 1s.
    11·1 answer
  • To use a stored address, C provides us with an indirection operator, ____.
    6·1 answer
  • In the early part of labor, contractions come every
    6·1 answer
  • The person in charge of recording the sound should always
    15·1 answer
  • Assume you are using the MINUS operator to combine the results from two tables with identical structure, CUSTOMER and CUSTOMER_2
    8·1 answer
  • Jared recently sent an email to all the members of his department asking them for their opinions about where the department shou
    11·1 answer
  • + Use for loop to print numbers from 100 to 10
    11·1 answer
  • Find the distance between the points.<br><br><br>(5,-2),(-6,-2)
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!