Design a class named Person with fields for holding a person's name, address, and telephone number. Write one or more constructors and the appropriate mutator an accessor methods for the class's fields. Next, design a class named Customer, which extends the Person class. The Custo class should have a field for a customer number and a boolean field indicating whe the customer wishes to be on a mailing list. Write one or more constructors and the
Q: Define a language that is not a regular language using a context-free grammar that is not ambiguous.…
A: The previous question was about defining a language that is not a regular language using a…
Q: When it comes to SDLC models, what exactly are the steps included in the waterfall approach? If you…
A: Software Development Life Cycle (SDLC) models are methodologies used by software developers to plan,…
Q: Why does symmetric encryption have problems when it comes to managing keys?
A: Symmetric Encryption: Symmetric encryption is a type of encryption where the same key is used for…
Q: hose pages are located all over the world.) Details The files in this web of files are plain text…
A: #include <iostream>#include <fstream>#include <vector>#include…
Q: the code comes back with this error
A: Thank you for providing more information. To solve for the values of A, B, and C when R(s) is equal…
Q: Prove the double complement law X’’ = X, By proving first that X * X’’ = X’’, And then that X * X’’…
A: To prove the double complement law X’’ = X, we need to show that X * X’’ = X’’ and X * X’ = X.
Q: How does Direct Memory Access (DMA) work to improve the system's ability to handle several threads…
A: Direct memory access (DMA) is a strategy that permits an input/output (I/O) gadget to send or get…
Q: Please explain the benefits and drawbacks of symmetric encryption. What factors should be thought…
A: Symmetric encryption: Symmetric encryption is a type of encryption in which the same secret key is…
Q: Which fibre is utilised to protect the inner core and prevent the cable from straining in fiber-…
A: Introduction: Fiber optic cable is a form of network cable that is commonly used to carry data. It…
Q: Answer the given question with a proper explanation and step-by-step solution. Consider a Hamming…
A: The answer is given below
Q: What are the key considerations involved in designing user interfaces for complex software…
A: Designing user interfaces for complex software applications, such as enterprise resource planning…
Q: What is the purpose of an application and how may this be clarified
A: It is also known as application program or application software which means a computer software…
Q: ivate networks (VPNs) are not based on the same physical network
A: What distinguishes extranets from virtual private networks (VPNs)? A virtual private network (VPN)…
Q: What are the 4 protocols in TLS?
A: TLS (Transport Layer Security) is a cryptographic protocol designed to provide secure communication…
Q: Which approach to the Waterfall model would you choose for your project, the Traditional Waterfall…
A: Waterfall model is a successive improvement process that streams like a waterfall through all…
Q: Both architectural and non-architectural maps of a project should be created for maximum…
A: A software architecture settles on significant choices in regards to the product that proceeds to…
Q: Decrypt the message MAXLJGTEAX which was encrypted using the affine cipher: Alphabet: A = 0, B = 1,…
A: Hello student Greetings Hope you are doing great. Thank You!!! Affine cipher is a type of…
Q: Is there a big difference between the way network apps and other apps function when it comes to…
A: Dear learner, hope you are doing well, I will try my best to answer this question. Thank You!!
Q: C++
A: In step 2, I have provided solution for Q1)------- In step final solution, I have provided…
Q: Write the unsimplified logic expression for each of the following truth tables. Though it is not…
A: The question presents a truth table with three columns labeled M, N, and F1. Each row in the truth…
Q: If a file contains an index directory that allows for random access, what does it mean?
A: Your answer is given below.
Q: Binary data from the primary store may be converted by an output device into coded hole patterns on…
A: Like a punch card, punch tape is involved for certain early PCs as a way to store and info…
Q: in c++ please A liter is 0.264179 gallons. Write a program that will read in the number of liters…
A: Your C++ program is given below as you required with an output. Sample Output:
Q: Is it OK to use the word "Object-Orientation" to describe something? Object-oriented engineering for…
A: Object Oriented concept is used to define a concept which includes objects.Object are the real world…
Q: Three promising new uses have emerged as a direct consequence of the development of the "internet of…
A: Internet: The Internet is a global network of computers connected to each other through cables,…
Q: Create a programme that receives an integer N from the command line, produces a random BST of size…
A: In this programming exercise, we are tasked with creating a program that generates a random binary…
Q: JAVA Given a main program that searches for the ID or the name of a student from a text file,…
A: we have to implement mainly two methods Method findID() Method findName()
Q: Is it true that agile development techniques are more effective when applied to specific types of…
A: The Agile model is an iterative and incremental approach to software development that emphasizes…
Q: For a FIQ interrupt method to be hooked and chained, it must begin at the specified offset in the…
A: Microprocessor:- A microprocessor is a small electronic device that is used to control and manage…
Q: Design a relational database containing information about parts, suppliers, and customers. Each part…
A: To design a relational database for parts, suppliers, and customers, we would first need to identify…
Q: Is it conceivable for the web to provide applications with two types of support? You can easily…
A: The question is asking if it is possible for the internet to offer two types of support for…
Q: How exactly operating systems carry out process implementation remains a mystery.
A: An operating system (os) will be system programming that oversees PC equipment and programming…
Q: Which general ideas and trends characterize the majority of today's cybercrime? If you want a…
A: Cybercrime can take many structures yet they all share the advanced climate for all intents and…
Q: According to the given question, here is the solution Write a program in Python that asks the user…
A: 1. Prompt the user for the size of the series.2. Initialize an empty list to hold the series of…
Q: How do you define "read-only memory" in the simplest terms possible? (ROM)
A: In step 2, I have provided "What is ROM and its type?" In the final step, I have provided…
Q: In what ways could direct memory access (DMA) facilitate the system's concurrent nature? So how does…
A: Direct Memory Access can be curtailed to DMA, which is an element of PC frameworks. It permits…
Q: How to Determine the Most Effective Vehicle Routes for a Delivery Issue Use code to explain. Use…
A: The Vehicle Routing Problem (VRP) is a graph theory combinatorial optimization and integer…
Q: When we say that Direct Memory Access (DMA) has the potential to increase the system's concurrency,…
A: Direct Memory Access (DMA) is a method of transferring data from a device's memory to the computer's…
Q: Look for a written guide that explains how to use devices that keep your hands free while driving.…
A: Hands-free devices are becoming increasingly popular among drivers as they allow them to stay…
Q: Please elaborate on the software development process metrics you've found. There must be exhaustive…
A: When it comes to software development, metrics are measurements used to evaluate and improve various…
Q: Determine how wireless infrastructure affects low-income countries. The lack of LANs or other sorts…
A: In today's interconnected world, access to information and communication technologies is…
Q: 13. Team Dragons Tigers Carp Swallows Bay Stars Giants Dragons Tigers Carp Swallows Monday Giants…
A: Self join is a join which is used to join the table with itself showing that there exist two tables.
Q: Using no more than five words, please describe the interaction between the instruction set and the…
A: Explain the relationship between instructions, data, and events in five words or less.
Q: Among the many crucial parts of a CPU are the Control Unit and the ALU; please describe them.
A: The CPU is the cerebrum of a PC, containing all the hardware expected to handle input, store…
Q: Talk about the four things you found most important about continuous event simulation after reading…
A: Continuous event simulation is a technique used in computer simulations to model systems where…
Q: In your opinion, what is the most crucial consideration when switching from batch processing to…
A: Batch processing is a computer processing method in which a specified set of data is processed…
Q: Answer the given question with a proper explanation and step-by-step solution. pmt function in…
A: To calculate the monthly payment for a loan in Excel using the PMT function, you will need to…
Q: There are many ways in which cloud computing might change the world for the better. Has his life…
A: Cloud computing: Cloud computing is the use of the internet to access resources such as programmes,…
Q: Find out how secondary storage systems that use magnetic media and those that use solid-state media…
A: The most popular kind of storage device is magnetic storage, which includes floppy discs and hard…
Q: How well versed are you in the usage of port numbers?
A: 1) Port numbers are used to identify specific processes or services on a networked device. They…
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:
JAVA0P33 HABS..
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images
- Design a class named Person with fields for holding a person's name, address, and telephone number (all as Strings). Write a constructor that initializes all of these values, and mutator and accessor methods for every field. Next, design a class named Customer, which inherits from the Person class. The Customer class should have a String field for the customer number and a boolean field indicating whether the customer wishes to be on a mailing list. Write a constructor that initializes these values and the appropriate mutator and accessor methods for the class's fields. Demonstrate the Customer class in a program that prompts the user to enter values for the customer's name, address, phone number, and customer number, and then asks the user whether or not the customer wants to receive mail. Use this information to create a customer object and then print its information. Put all of your classes in the same file. To do this, do not declare them public. Instead, simply write: class Person…Define a class named Employee. This class should extend the Person class from the previous question. The class should have a constructor, which takes the name, age, employer (String) and salary (int) as parameters (in that order). The first two parameters should be passed to the constructor of the superclass and the value of the last two parameters should be stored in instance variables. The class should define the methods, getSalary which returns the salary of the employee and getEmployer which returns the name of the employer. Any methods from the previous question that need to be overridden should be overridden! Use super and instanceof as appropriate. I.e., for the following methods you should be able to call the method in the superclass for specific situations (e.g. the compareTo method in the superclass can be called if you receive anything other than an Employee, and this also holds for the equals method). The toString method only needs to append details and as such can also…Design a class named Person with properties for holding a person’s name, address, and telephone number. Next, design a class named Customer, which is derived from the Person class. The Customer class should have a property for a customer number and a Boolean property indicating whether the customer wishes to be on a mailing list. Demonstrate an object of the Customer class in a simple application.
- Design a Friend class that the following members: • A field for the name of the friend (a string). •A field for the cell phone number of the friend (a string). • A field for the gender of the friend (a character F or M). • A static field numObjects (integer). Constructors: A default constructor and a parameterized constructor. Accessors methods for the data fields. Set methods for the cell phone data field and the numObjects field. A toString() method that displays the data fields. Design a testFriend driver class that has an arrFriends array that can hold up to a maximum of 15 objects. Write a static fillArray() method that receives the arrFriends array and allow the user to enter the information of a number of friends. Save the objects to the array. Return the array to the call statement. Write a static displayArray) method that receives the arrFriends array as parameter and display a numbered list of information on the objects saved in the array. Write a static sortData() method…Write the code below for the Computer class. The Computer class must be an abstract class, and have the following methods and attributes: • a public string called HostName • a private int called MemorySize • a public abstract method called shutdown that takes no arguments and returns nothing • a public abstract method called runProgram that takes a String for the name of the program and returns a boolean. • Also include getter/setter methods for the attributesJava Object Oriented Programming Create a Shape class that shall have color and filled instance variables of enum Color and boolean type. The filled boolean variable shall show, whether the shape is filled (colored). The enum Color shall be defined within the class having 4 color names (choose any four). Also define getArea and getPerimeter method in Shape class, both shall return 0. Create Rectangle class with length and width attributes and a Circle class with radius attribute, of type double. Properly encapsulate all fields. Circle and Rectangle shall extend Shape class and override getArea and getPerimters methods as per its type and specific formula. In Test class, create an object of Rectangle and Circle, by initializing all attributes in constructor and print both shapes' area and perimters. In Test class, define a static method with following signature, public static void printEachShapeCount(Shape... shapes) As you know, the parent type variable can hold the…
- Design a LandTract class that has two fields (i.e. instance variables): one for the tract’s length(a double), and one for the width (a double). The class should have: a constructor that accepts arguments for the two fields a method that returns the tract’s area(i.e. length * width) an equals method that accepts a LandTract object as an argument. If the argument object holds the same data (i.e. length and width) as the calling object, this method should return true. Otherwise, it should return false. a toString method (that returns a String representation of the tract’s length, width, and area). Demonstrate the class in a program by creating an array of three LandTract objects initialized with user input. Then, print the info of the LandTract objects stored in the array by invoking the toString method (implicitly or explicity). Also, use the equals method to compare at least two LandTract objects and print wether they are of equal size or not. Sample Output:…Java Programming problem Create a checking account class with three attributes: account number, owner’s name, and balance. Create constructor, getters and setters. If one is to set the initial balance of an account as a negative value in a setter or a constructor, remind the user about the error and set it as 0. Create a CheckingAccountDemo class, and create a main method in which Ask for the name, account number, and initial balance for one account from the keyboard input. With these input values as arguments in a call to the constructor, create a CheckingAccount object. Print the summary of this account that includes information on the name, account number, and balance by calling the getters.Exercise 2 Design a class named Customer with field holding for customer's name, address, and telephone number. Customer's name and address can only be accessed by Customer class. Telephone number can only be accessed by its subclass. Write two overloading constructors and the appropriate setter and getter methods for the class's fields. A retail store has a preferred customer plan where customers can earn discounts on all their purchases. The amount of a customer's discount is determined by the amount of the customer's cumulative purchases in the store as follows: • When a preferred customer spends RM500, he or she gets 5 percent discount on all future purchases • When a preferred customer spends RM1,000, he or she gets 6 percent discount on all future purchases • When a preferred customer spends RM1,500, he or she gets 7 percent discount on all future purchases When a preferred customer spends RM2,000 or more, he or she gets 10 percent discount on all future purchases Design a class…
- 1. Create abstract class Pet , which is the abstract super class of all animals.1. Declare an integer attribute called legs, which records the number of legs for this animal.2. Define a constructor that initializes the legs attribute.3. Declare an abstract method eat.4. Declare a concrete method walk that prints out something about how the animals walks (include the number of legs).2. Create the Dog class that implements Pet class.1. This class must include a String attribute to store the name and food of the pet2. Define a default constructor that calls the super class constructor to specify that all dogs have 4 legs and name.3. override the eat and walk method.3. Create the Cat class that Implements Pet class.1. This class must include a String attribute to store the name of the pet, and a string to save food .2. Define a constructor that takes one String parameter that specifies the cat's name. This constructor must also call the super class constructor to specify that all cats have…Create abstract class Pet , which is the abstract superclass of all animals. Declare a integer attribute called legs, which records the number of legs for this animal. Define a constructor that initializes the legs attribute. Declare an abstract method eat. Declare a concrete method walk that prints out something about how the animals walks (include the number of legs). Create the Dog class. The Dog class extends the Pet class. This class must include a String attribute to store the name and food of the pet Define a default constructor that calls the superclass constructor to specify that all dogs have 4 legs and name. override the eat and walk method. Create the Cat class that extends Pet. This class must include a String attribute to store the name of the pet, and a string to save food . Define a constructor that takes one String parameter that specifies the cat's name and food. This constructor must also call the superclass constructor to specify that all cats have four legs.…Create abstract class Pet , which is the abstract superclass of all animals. Declare a integer attribute called legs, which records the number of legs for this animal. Define a constructor that initializes the legs attribute. Declare an abstract method eat. Declare a concrete method walk that prints out something about how the animals walks (include the number of legs). Create the Dog class. The Dog class extends the Pet class. This class must include a String attribute to store the name and food of the pet Define a default constructor that calls the superclass constructor to specify that all dogs have 4 legs and name. override the eat and walk method. Create the Cat class that extends Pet. This class must include a String attribute to store the name of the pet, and a string to save food . Define a constructor that takes one String parameter that specifies the cat's name and food. This constructor must also call the superclass constructor to specify that all cats have four legs.…