Create an abstract class called Student. The Student class includes a name and a Boolean value representing full-time status. Include an abstract method to determine the tuition, with full-time students paying a flat fee of $2,000 and part-time students paying $200 per credit hour. Create two subclasses called FullTime and PartTime. Create an application that demonstrates how to create objects of both subclasses. Save the files as Student.java, FullTime.java, PartTime.java, and UseStudent.java.
Q: Differentiate between and
A: The answer is given in the below step
Q: hapter 8 Irvine book, When I compiled this code I get the following errors ;Greatest Common Divisor…
A: According to the information given:- We have to write a recursive implementation of Euclid’s…
Q: Q9. Consider the following algorithm: sum = 0 For j starting at 1 and ending with 13: sum =…
A: If Thirteen is included then output is
Q: Explain the XML Elements with their types.
A: The answer to the question is given below:
Q: Using a method that is based on data modeling comes with a few potential pitfalls.
A: Introduction: Modeling data The technique of expressing data and how it flows in a condensed form of…
Q: Write proper pseudocode for FixHeapNode(A[1,..., n), p) that fixes the subtree rooted at A[p] to be…
A: In pseudo-code programming, all statements depend on each other. The pseudo-code includes while,…
Q: Explain why WINS server is required?
A: A historical computer name registration and resolution service called Windows Internet Name Service…
Q: A database analyst has developed the following ER Diagram for a small company. WORKER Status…
A: so we are adding dash hypens before each line in text file containing business rules using python
Q: What is the difference between and ?
A: The question is solved in step2
Q: The Class C network 210.10.10.0 has been subnetted into 4 subnets. For each subnet (1st, 2nd, 3rd,…
A: Here is the explanation regarding the subnetting the address into 4 parts:
Q: Differentiate between and
A: Here in this question we have asked to differentiate between <tr> and <td> tag
Q: Write HTML code which includes table.
A:
Q: An array A contains all the integers from O to n, except for one number which is missing. In this…
A: Given a list of numbers from O to n, with exactly one number removed, find the missing number. This…
Q: For all of the following words, if you move the first letter to the end of the word, and then spell…
A: In order to complete this task, we must create a programme that, up until the user types "quit,"…
Q: Differentiate between and
A: Html which refers to the Hypertext markup language one it is used for the code that is used to…
Q: Explain The Lists in HTML.
A: HTML lists are used to specify lists of information.
Q: What are some of the advantages and disadvantages of having a global Internet, in your opinion?
A: Comparing the Pros and Cons of Utilizing the Internet In all of technology, the most well-known and…
Q: If you need to create a table, you can do so with the help of a feature in Word called "table…
A: Excel will take a Title to construct a table. When more than one word or phrase is needed for a…
Q: Which of the following statements is true of loop detection in BGP. - The underlying algorithm used…
A: The question is solved in step2
Q: It is essential for multimedia projects to make use of fundamental building blocks. How can you make…
A: Introduction: Components of Multimedia: Textual MaterialsThe text transports us back to the early…
Q: How to configure Proxy Server in Windows?
A: The question is solved in step2
Q: TASK 2.4 Implement the missing code for the method specialize(specialization_map) of class…
A: Coded using Python 3.
Q: What are the different Computer Level Hierarchy? Briefly describe each
A: Definition: The combination of many levels that links the computer with the user and facilitates…
Q: What are the differences between the Python tuple data type and the Python list data type?
A: The question is solved in step2
Q: Is there anything special about a computer that makes it stand out from other types of technological…
A: Introduction: A few fundamental traits that distinguish one computer from another are shared by all…
Q: Differentiate between Remote Desktop and Remote Assistance, giving suitable examples of when you…
A: A computer is a digital electronic machine that can be programmed to automatically perform a series…
Q: how do they compare to Influential Access? Please give an illustration. When comparing Direct and…
A: Direct Access: The value is immediately available in this access, thanks to the index. The data…
Q: Explain what is the difference between TFTP and FTP application layer protocols?
A:
Q: Explain the XML Elements with their types.
A:
Q: Why must the symbol or name used in the C++ inclusion guard on a library interface file be distinct?…
A: Your answer is given below.
Q: What three data anomalies are caused by data redundancy? How to eliminate such anomalies
A: A database management system (or DBMS). It is essentially just a computer-based data storage system.…
Q: It is important to keep in mind that the reordering and reassembly of packets takes place during the…
A: Introduction: Network administration and system management are separate but related fields of study…
Q: Spreadsheets are credited with establishing the personal computer's legitimacy as a legitimate…
A: In fact, given the information: Spreadsheets are credited with establishing the personal computer as…
Q: Assume that we are planning to use a Genetic Algorithm to find the optimum point of the following…
A: The core components of the Genetic Algorithm are as follows: Chromosome’s population Fitness…
Q: Let f(x) = sin(e*). Find the ƒ'(x) by using limit definition of the derivative and compare your…
A: Below I have provided a program for the given question. Also, I have attached a screenshot of the…
Q: What is the typical amount of power that a computer consumes throughout its lifetime?
A: Introduction: The most popular uses for computers are for creating and modifying data, as well as…
Q: Python: You must make a rock paper scissors game Goal Ask the player if they pick rock paper or…
A: # Rock paper scissors game #import the random moduleimport random # Initialize variablesplayer_score…
Q: The following C code is a formula representing the Volume of a Sphere. Convert into MIPS code. (You…
A: ANSWER:-
Q: Differentiate between and .
A: Here in this question we have asked to differentiate between <tr> and <td> tag
Q: Maintaining the Loop Invariant (LI & not exit & codeloop → LI): Suppose that LI (the statement…
A: The following claim will be required twice.The following statement is a claim: If the first node in…
Q: When processor designers consider a possible improvement to the processor datapath, the decision…
A: The given data can be elaborated with the help of a table as: I-MEM ADD MUX ALU REGS D-REM…
Q: While gathering evidence during the containment process is important, in your own words explain why…
A: Before an incident overwhelms resources or causes more harm, containment is crucial. Containment is…
Q: Explain The Lists in HTML.
A: The question has been answered in step2
Q: Discuss the role that business process re-engineering can play in the restructuring of an…
A: Re engineering business processes: 1. Improving processing methods will maximise a company's…
Q: Consumer-oriented tablets are radically altering how organizations store, retrieve, and use…
A: Consumer-oriented tablets are significantly changing how organizations use, access, and location…
Q: Tablet computers are distinct from other kinds of computers in a number of important respects.
A: There is a wide variety of ways in which the tablets and the computers are not equivalent to one…
Q: Write a note on Schema of DTD.
A: The question is solved in step2
Q: Write Algorithm to Constructing dead reckoning messages. Dead-Reckoning-Message(s,t,P,Q) in: state…
A: The question is solved in step2
Q: What is the difference between and ?
A: The Table element specifies and the Table Row (TR) tag is used to generate each row in an HTML…
Q: State Advantages of DTD.
A:
OOPs
In today's technology-driven world, computer programming skills are in high demand. The object-oriented programming (OOP) approach is very much useful while designing and maintaining software programs. Object-oriented programming (OOP) is a basic programming paradigm that almost every developer has used at some stage in their career.
Constructor
The easiest way to think of a constructor in object-oriented programming (OOP) languages is:
Create an abstract class called Student. The Student class includes a name and a
Boolean value representing full-time status. Include an abstract method to determine
the tuition, with full-time students paying a flat fee of $2,000 and part-time students
paying $200 per credit hour. Create two subclasses called FullTime and PartTime.
Create an application that demonstrates how to create objects of both subclasses.
Save the files as Student.java, FullTime.java, PartTime.java, and UseStudent.java.
Step by step
Solved in 4 steps with 4 images
- Write a program named SalespersonDemo that instantiates objects using classes named Real EstateSalesperson and GirlScout. Demonstrate that each object can use a SalesSpeech() method appropriately. Also, use a MakeSale() method two or three times with each object, and display the final contents of each objects data fields. First, create an abstract class named Salesperson. Fields include first and last names; the Salesperson constructor requires both these values. Include properties for the fields. Include a method that returns a string that holds the Salespersons full name—the first and last names separated by a space. Then perform the following Create two child classes of Salesperson: Real EstateSalesperson and Girl Scout. The Real EstateSalesperson class contains fields for total value sold in dollars and total commission earned (both of which are initialized to 0), and a commission rate field required by the class constructor. The Girl Scout class includes a field to hold the number of boxes of cookies sold, which is initialized to 0. Include properties for every field. Create an interface named ISell able that contains two methods: SalesSpeech() and MakeSale(). In each Real EstateSalesperson and Girl Scout class, implement SalesSpeech() to display an appropriate one- or two-sentence sales speech that the objects of the class could use. In the Real Estatesalesperson class, implement the MakeSale() method to accept an integer dollar value for a house, add the value to the Real EstateSalespersons total value sold, and compute the total commission earned. In the Girl Scout class, implement the MakeSale() method to accept an integer representing the number of boxes of cookies sold and add it to the total field.a. Write a FractionDemo program that instantiates several Fraction objects and demonstrates that their methods work correctly. Create a Fraction class with fields that hold a whole number, a numerator, and a denominator. In addition: Create properties for each field. The set access or for the denominator should not allow a 0 value; the value defaults to 1. Add three constructors. One takes three parameters for a whole number, numerator, and denominator. Another accepts two parameters for the numerator and denominator; when this constructor is used, the whole number value is 0. The last constructor is parameterless; it sets the whole number and numerator to 0 and the denominator to 1. (After construction, Fractions do not have to be reduced to proper form. For example, even though 3/9 could be reduced to 1/3, your constructors do not have to perform this task.) Add a Reduce() method that reduces a Fraction if it is in improper form. For example, 2/4 should be reduced to 1/2. Add an operator+() method that adds two Fractions. To add two fractions, first eliminate any whole number part of the value. For example, 2 1/4 becomes 9/4 and 1 3/5 becomes 8/5. Find a common denominator and convert the fractions to it. For example, when adding 9/4 and 8/5, you can convert them to 45/20 and 32/20. Then you can add the numerators, giving 77/20. Finally, call the Reduce() method to reduce the result, restoring any whole number value so the fractional part of the number is less than 1. For example, 77/20 becomes 3 17/20. Include a function that returns a string that contains a Fraction in the usual display format—the whole number, a space, the numerator, a slash (D, and a denominator. When the whole number is 0, just the Fraction part of the value should be displayed (for example, 1/2 instead of 0 1/2). If the numerator is 0, just the whole number should be displayed (for example, 2 instead of 2 0/3). b. Add an operator*() method to the Fraction class created in Exercise 11a so that it correctly multiplies two Fractions. The result should be in proper, reduced format. Demonstrate that the method works correctly in a program named FractionDemo2. c. Write a program named FractionDem03 that includes an array of four Fractions. Prompt the user for values for each. Display every possible combination of addition results and every possible combination of multiplication results for each Fraction pair (that is, each type will have 16 results).In Chapter 9, you created a Contestant class for the Greenville Idol competition. The class includes a contestants name, talent code, and talent description. The competition has become so popular that separate contests with differing entry fees have been established for children, teenagers, and adults. Modify the Contestant class to contain a field that holds the entry fee for each category, and add get and set accessors. Extend the Contestant class to create three subclasses: ChildContestant, TeenContestant, and AdultContestant. Child contestants are 12 years old and younger, and their entry fee is $15. Teen contestants are between 13 and 17 years old, inclusive, and their entry fee is S20. Adult contestants are 18 years old and older, and their entry fee is $30. In each subclass, set the entry fee field to the correct value, and override the Tostring() method to return a string that includes all the contestant data, including the age category and the entry fee. Modify the GreenvilleRevenue program so that it performs the following tasks: The program prompts the user for the number of contestants in this years competition, which must be between 0 and 30. The program continues to prompt the user until a valid value is entered. The program prompts the user for names, ages, and talent codes for the contestants entered. Along with the prompt for a talent code, display a list of valid categories. Based on the age entered for each contestant, create an object of the correct type (adult, teen, or child), and store it in an array of Contestant objects. After data entry is complete, display the total expected revenue, which is the sum of the entry fees for the contestants. After data entry is complete, display the valid talent categories and then continuously prompt the user for talent codes, and display all the data for all the contestants in each category. Display an appropriate message if the entered code is not a character or a valid code.
- Create an application named ShapesDemo that creates several objects that descend from an abstract class called GeometricFigure. Each GeometricFigure includes a height, a width, and an area. Provide get and set accessors for each field except area; the area is computed and is read-only. Include an abstract method called ComputeArea() that computes the area of the GeometricFigure. Next you will create three additional classes derived from the GeometricFigure class. Name these derived classes: Rectange, Square, and Triangle Create a Rectangle is a GeometricFigure whose area is determined by multiplying width by height. Create a Square is a Rectangle in which the width and height are the same. Provide a constructor that accepts both height and width, forcing them to be equal if they are not. Provide a second constructor that accepts just one dimension and uses it for both height and width. The Square class uses the Rectangle’s ComputeArea() method. Create a Triangle is a GeometricFigure…Create an application named ShapesDemo that creates several objects that descend from an abstract class called GeometricFigure. Each GeometricFigure includes a height, a width, and an area. Provide get and set accessors for each field except area; the area is computed and is read-only. Include an abstract method called ComputeArea() that computes the area of the GeometricFigure. Next you will create three additional classes derived from the GeometricFigure class. Name these derived classes: Rectange, Square, and Triangle.Create a class called Complex for performing arithmetic with complex numbers. Complex numbershave the form realPart + imaginaryPart * i where i is √-1Write a java program to test your class. Use floating-point variables to represent the private data of theclass. Provide a constructor that enables an object of this class to be initialized when it is declared.Provide a no-argument constructor with default values in case no initializers are provided. Providepublic methods that perform the following operations:a) Add two Complex numbers: The real parts are added together and the imaginary parts are addedtogether.b) Subtract two Complex numbers: The real part of the right operand is subtracted from the realpart of the left operand, and the imaginary part of the right operand is subtracted from theimaginary part of the left operand.c) Print Complex numbers in the form (a, b), where a is the real part and b is the imaginary part Sample Output: a=(9.5 , 7.7) b)=(1.2 , 3.1) a+b=(10.7 , 10.8)…
- Using oop in java Create a class named “Rectangle” having length and width as attribute. There should be behaviorstoset the values of length and width (individually and collectively), and get their values individually. There should also bebehavior to display the perimeters and area of the rectangle. Create another class named as Main which hastwo objects of Rectangle (r1, r2) having length (3.2, 20) and width (4.5, 36) respectively. Also displaythe length, width, perimeter and area of both rectangles.Create a class named “Rectangle” having length and width as attribute. There should be behaviorstoset the values of length and width (individually and collectively), and get their values individually. There should also bebehavior to display the perimeters and area of the rectangle. Create another class named as Main which hastwo objects of Rectangle (r1, r2) having length (3.2, 20) and width (4.5, 36) respectively. Also displaythe length, width, perimeter and area of both rectangles.Please Use Netbeans Create four pages:Three Classes: Employee, Department, and CompanyA program MyCompany which supplies employee name and salary information and prints out the totalsalary of all the employees.Pass in all four .java files.1) Create a class called "Employee" with the following properties:name (String)age (int)salary (double)In the Employee class, create a constructor that accepts and sets an employee’s name, age, and salary.Create getters for name, age, and salary.2) Create a class called "Department" with the following properties:i (int)name (String)Employee[] employees=new Employee[10];In the Department class, create a constructor that accepts and sets the department name. Also set i=0(to initialize the value).In the Department class create a method called "addEmployee" that accepts an Employee object andadds it to the array of employees. (Hint, include i++ to increment the value of i.)In the Department class, create a method called "getTotalSalary" as follows:public…
- Create a class Course, which has one field: String courseName Create the constructor, accessor, and mutator for the class. Then, in the main method of this class, create an instance of the class with the name "CST1201". Write an equivalent while statement to replace the following for statement for (int i=2; i<100; i=i+2) { System.out.println(i); }The Rectangle class) Following the example of the Circle class in Section 9.2, design a class named Rectangle to represent a rectangle. The class contains: ■ Two double data fields named width and height that specify the width and height of the rectangle. The default values are 1 for both width and height. ■ A no-arg constructor that creates a default rectangle. ■ A constructor that creates a rectangle with the specified width and height. ■ A method named getArea() that returns the area of this rectangle. ■ A method named getPerimeter() that returns the perimeter.Draw the UML diagram for the class and then implement the class. Write a test program that creates two Rectangle objects—one with width 4 and height 40and the other with width 3.5 and height 35.9. Display the width, height, area, and perimeter of each rectangle in this order.Create a class called FinalGrade that is used to represent the points obtained in the letter grade of CSC 110 by different students. The FinalGrade class should include three pieces of information as instance variables—studentName (type String), studentID (type String), and pointsObtained (type int). Your class should have a constructor that initializes the three instance variables. Provide a set and a get method for each and every instance variable. In addition, provide a method named computeLetterGrade that returns the letter grade obtained by the student taking the pointsObtained as an argument. For the grading policy refer to CSC 110 grading scheme specified in syllabus. Write a test application named FinalGradeDriver that creates at least 3 different objects of class FinalGrade and test all the methods of class FinalGrade. Sample Output Student Name : Homer SimpsonStudent ID : S123456Points Obtained : 99Letter Grade : A Student Name : Marge SimpsonStudent ID : S234567Points…