Consider the following Country class: public class Country{ String Integer population; } name; Rewrite this class so that (i) it has a constructor that takes TWO inputs (a string and a number) and sets the object's state accordingly, (ii) it implements the Comparable interface so that two Country objects can be compared, and (iii) once the name is set it is never allowed to be changed again. Here is how Country objects should be compared. Let c1 and c2 be two Country objects. c1 < c2 when c1's population is less than c2's population; if they have the same population, then c1 < c2 when c1's name is alphabetically less than c2's name. Finally, c1 is equal to c2 when they have the same population and the same name.
Q: Imagine that you work for a corporation that has a firewall in place to protect its internal network...
A: Firewall: Firewalls on networks are authentication systems that are used to prevent or limit illegal...
Q: Discuss the five particular instances of fuzzy logic applications in artificial intelligence that ha...
A: Fuzzy logic is employed in a variety of sectors, including automobile systems, household products, e...
Q: Analyze the advantages of agile development versus traditional formalized development approaches.
A: Agile is iterative and incremental model.
Q: Use the pumping lemma for context-free languages to show that the language L = {an | n is a power o...
A: The given language is: L = {an | n is a power of 2} To prove: L is not context-free.
Q: In what ways may we as programmers be defensive, and what are some examples of defensive programming...
A: Defensive programming:- Defensive programming is a kind of "defensive design" that aims to guarantee...
Q: The most basic peer-to-peer networks are made up of two computers that are directly connected over a...
A: A peer-to-peer network is used for connecting two networks together. The communication between netwo...
Q: Write a program that takes a string and an integer as input, and outputs a sentence using the input ...
A: Use an infinite loop to accept the input and exit if the first word is quit
Q: 1. Identify conditional and join probabilities from the following example. Explain how the probabili...
A: Solution :-
Q: Q4: Write a FORTRAN90 program that reads a student ID and his GPA out of 4.0. The program should pri...
A: Algorithm: Start Read student ID and GPA If gpa>=3.5 then print "EXCELLENT" Else if gpa<3.5 a...
Q: To be able to use an I/0 peripheral device, you need to put the address first in... Select one: O a....
A: The Answer is given below step.
Q: * A PDA employs data structure Linked list Hash table Stack Queue
A: The solution to the given problem is below.
Q: Answer about these questions: b, eb c, bE d, aE a, ea c, bE 43 d, a → 94 b, e >b E, ES q1
A: We are given a PDA and we are going to find out its stack symbol.
Q: Give an overview of the backup plan's components. When it comes to backup plans for mobile devices a...
A: Introduction: Backups are exhaustive and occur automatically. Backups should include everything nec...
Q: Please answer it in Python Sorting a list is to take the minimum and put it at the beginning, then s...
A: Introduction: Selection sort is a sorting algorithm that picks the smallest element from an unsorted...
Q: Write a line of Python code to randomly select 4 items from the list menuitems and assign it to the ...
A: Python is the coding language and is the object-oriented requirement as the dynamic, code strong and...
Q: I need to work out a pair of floating point numbers represented by this 24bit 0101 0011 1111 1101 01...
A: Given: Dear student we need to explain about a pair of floating point (real) numbers could be repr...
Q: A decision tree with better splits means that it can be more accurate in
A: A decision tree is a graphical model used to represent decisions in a decision-making process. It is...
Q: (C PROGRAMMING ONLY) 1. Point Me There by CodeChum Admin I was supposed to be your tour guide but ...
A: To assign the address of the variable to the pointer use & operator. As if & operator is bee...
Q: Computer Science can someone pls make this video 4) Changing the dataset (and thus alteri...
A: First let's calculate BMI (body mass index) BMI of 5' and 100lbs ==19.53 BMI of 5'7'' and 140lbs==21...
Q: Q.Write a program to create a Distance class containing kilometers and meters as data members. Also ...
A: Program Explanation: Declare the header file Define a class for Distance Declare the instance varia...
Q: The user decides whether 1. Trapezoid, 2. Ellipse, or 3. Equilateral Triangle. Compute the area of t...
A: The Code is given below.
Q: Does the virtual network interface card (vNIC) obtain a MAC address?
A: The virtual machine requires a virtual adapter or virtual network interface card to connect to the n...
Q: Explain the usefulness and limitations of traffic engineering as a solution for the problem of netwo...
A: Introduction: Traffic engineering is a method for boosting the presence of a broadcast communication...
Q: Python Multiple Choice Explain: For an ordered list of 11 items, how many comparisons will a line...
A: Here is code to find item in List using python: List = [ 23,56,87,3,5,7,1,2,3 ] value = int(input...
Q: What exactly is a consistent database state, and how does one go about achieving one?
A: Consistency of data implies no duplication or mismatching of data.
Q: How do computers communicate with one another? the flow of information from data to knowledge What i...
A: Introduction: Computer communication is analogous to human communication. In truth, many areas of co...
Q: Given the following binary number in 32-bit (single precision) IEEE-754 format, the decimal value cl...
A:
Q: Why is gaming considered both entertainment and competition?
A: here gaming can be termed with both entertainment and competition. we have added few points in step ...
Q: Describe three major qualities of cloud computing that can be used to improve the efficiency with wh...
A: Introduction: Characteristics include the following: Cloud Computing: Cloud computing uses the Inte...
Q: 1. Write a program to get the first and last element for the linked list. The Elements are (100,200,...
A: As per our guidelines we are supposed to answer only one question. Kindly repost other questions as ...
Q: 5. What is the gray code of 101011110010102? 6. Solve: ABF5H - 9CDFH 7. What is the 2's complement o...
A: Answers: 1. 11111000101111 2. Result (hex) f16 , Result (decimal) 3,862 3. 0000 0010 0100 1011
Q: What is the role of a router in a network environment? What makes it different from a switch Provide...
A: Answer the above questions are as follows:
Q: Descriptive models have some important qualities and properties, which we will discuss below
A: Introduction: A descriptive model elucidates the link between a system or other object and its surro...
Q: Q-1. What is at put gf thie logic gatu? F=?
A: AND gate: OR gate:
Q: se of Power Map (3D Maps)? Create an interactive, guided cinematic tour of your data on map Create a...
A: Explanation Power Maps or 3D Maps in Excel is a three-dimensional visualization tool that can be use...
Q: What are the differences between how RapidMiner (RM) and Tableau execute k-means clustering?
A: When you have unlabeled data, K-means clustering would be a type of unsupervised learning. The prima...
Q: Find out how to troubleshoot some of the most frequent issues with Linux hardware, software, file sy...
A: Introduction: Linux hardware difficulties may occur for a variety of reasons. It's a good idea to fa...
Q: Explain all of the options available to you during Linux configuration and installation.
A: Linux is a free and open source operating system that can be downloaded and installed on virtually a...
Q: *.. 1: Given the following UML diagram. Answer the following questions Gradeskeport - studentID: int...
A: Algorithm: Start Create a class named GradesReport with studentID, studentName, academicYear, stude...
Q: 7. What is the 2's complement of 9FDB5H?
A: Two's complement is found by adding 1 to one's complement One's complement of a number can be found ...
Q: 6. Write function main to do the following a. Declare four integers that will represent the four pro...
A: import java.util.LinkedList;public class Threadexample { public static void main(String[] args)throw...
Q: Unlike most other PC operating systems, the Mac OS stores a large portion of the operating system in...
A: The answer is given in the below step
Q: Computer Science Help to create the mind map for Introduction to Industrial Engineering and Industri...
A: Introduction to Industrial Engineering and Industrial Revolution 4.0. Do the mind map in the same re...
Q: Determine the twos' complement for hexadecimal 4B,, that is stored in a WORD size storage location. ...
A: size of word = 2 byte = 8 bits 1111 1111 1011 0101 procedure- subtract hexadecimal no. from FFFFFF...
Q: Proof that (11^n) −6 is divisible by 5 for all values of n ≥1
A: We have to prove that (11^n) −6 is divisible by 5 for all values of n ≥1. Using Induction method we ...
Q: An algorithm that requires operations to complete its task on n data elements is said to have a line...
A:
Q: One of the following tuples not exist in a * :CFG set of variables final symbol O start symbols O pr...
A: One of the following tuples that does not exist in CFG is Final Symbol Existing tuples are set of...
Q: Write the appropriate commands that correspond to the following: 1) Create a directory called "OS-LA...
A: in the following section we will solve the above problem in details
Q: What are the two forms of file access that exist in the world? What exactly is the difference betwee...
A: There аre three wаys tо ассess а file intо а соmрuter system: Sequentiаl-Ассess, Direсt...
Q: Write a function named dictMax which takes two arguments: a dictionary and a list. Your function mus...
A: Initialize the return value to None and in the initial value we simply update None with our dictiona...
Write in Java script
Step by step
Solved in 3 steps
- The Doctor program described in Chapter 5 combines the data model of a doctor and the operations for handling user interaction. Restructure this program according to the model/view pattern so that these areas of responsibility are assigned to separate sets of classes. The program should include a Doctor class with an interface that allows one to obtain a greeting, a signoff message, and a reply to a patient’s string. To implement the greeting, define a method named greeting for the Doctor class. To implement the signoff message, define a method named farewell for the Doctor class. Both greeting and farewell should return a string with a greeting or farewell message respectively. The reply function is defined for you, it should be added as a method for the Doctor class. The rest of the program, in a separate main program module, handles the user’s interactions with the Doctor object. Develop this program with a terminal-based user interface. Note: The program should output in the…The Java Programming class has two types – remote and in-person. For remote students, the weighted score comprises of midterm, final, assignments and discussion. The weights for each are 30%, 30%, 30% and 10% respectively. For in-person students, the weighted score comprises of midterm, final and assignments. The weights for each are 30%, 30% and 40%. Write a generic class Students.java which has a constructor that takes three parameters – id, name, and type. Type will represent if the student is ‘remote’ or ‘in-person’. A toString() method in this class will display these details for any student. A generic method score() will be part of this class and it will be implemented by inherited classes. Write accessors and mutators for all data points. Write two classes RemoteStudents.java and InPersonStudents.java that inherits from Student class. Show the use of constructor from parent class (mind you, RemoteStudents have one additional parameter – discussion). Implement the abstract method…Consider the following class Date, which represents a date using three ints for month, day and year: class Date { private: int month; int day; int year; public: Date() { month = day = year = 0; } Date(int m, int d, int y) { month = m; day = d; year = y; } bool operator==(Date); bool operator<(Date); }; Write an implementation for both overloaded operators. == should return true if the Date objects are equivalent and false if not. < should return true if the Date of the calling object (left object) comes before the parameter Date object (right object) and false if not. You may assume that all objects of class Date are valid, i.e. month is between 1 and 12, inclusive; day contains an appropriate day for the given month, and year can be anything. You do not need to demonstrate calling these operators.
- Answer the given question with a proper explanation and step-by-step solution. The base class Pet has protected fields petName, and petAge. The derived class Cat extends the Pet class and includes a private field for catBreed. Complete main() to: create a generic pet and print information using printInfo(). create a Cat pet, use printInfo() to print information, and add a statement to print the cat's breed using the getBreed() method.Write a java program in which Animal:Create a class Animal and Add a protected data member named id of integer type.• Add get/set methods for id data member in Animal class with public access. Also provide default constructor this should initialize id to 0.• Also provide parameterized constructor and toString method.• Add an abstract method tellAboutSelf method to Animal class with public access• Add another abstract method speak method to Animal class.Reptile, Bird, MammalNext create the three child classes which extends form Animal class.• Add a default constructor to each of the above created class. The constructor should initialize the id data member id, Reptile, Bird and Mammal, to 1, 2 and 3 respectively also it display a message “(class Name)’s default constructor”. E.g. for Bird it says “Bird’s default constructor”.• Add a parameterized constructor to each of the above created class. The constructor should initialize the id data member, Reptile, Bird and Mammal, to the…Create the following classes based on the given declaration. Also, each class should have the default constructor. Just place the prototype of the constructors in the class but you dont have to implement them. The default constructor is a public member. A) CSUSM is an object of class University. Class University has the follow private attributes: -UnivName: string -UnivDepts: a vector of Department class -UnivStudents: a vector of student class -UnivAddress: string -UnivAge: int B) Each department has the following private attributes: -deptName: string -deptFaculty: vector of Faculty class -deptYearCreated: int C) Each student has the following private attributes: -studName: string -studYearOfStudy: int -studNumber: long -studCoursesTaken: vector of Course class D) Each faculty has the following private attributes: -FacName: string -FacYearofExperience:int -FacId: long -FacCoursesTeaches: vector of Course Class E) Each course has the following private attributes:…
- 1) Consider the following class Date, which represents a date using three ints for month, day and year: class Date { private: int month; int day; int year; public: Date() { month = day = year = 0; } Date(int m, int d, int y) { month = m; day = d; year = y; } bool operator==(Date); bool operator<(Date); }; It asks to create an implementation for both overloaded operators. == should return true if the Date objects are equivalent and false if not. < should return true if the Date of the calling object (left object) comes before the parameter Date object (right object) and false if not. Assume that all objects of class Date are valid, i.e. month is between 1 and 12, inclusive; day contains an appropriate day for the given month, and year can be anything. You don't need to demonstrate calling these operators.i have a parent class called Person containing the name and ID number of students and i need to write the program for a child class named student that extends from the parent class and also adds two more attributes below is a copy of my Parent class public class Person{ private String name; private int id; public Person( ) { name = "not defined"; id = 0; } public Person(String newName, int newId ) { name = newName; id = newId; } public String getName( ) { return name; } public int getId( ) { return id; } public void setName(String newName) { name = newName; } public void setId(int newId) { id = newId; } public void set(String newName, int newId) { name = newName; id = newId; } public String toString( ) { return "Name = " + name + "ID is " + id;…Write a generic class Students.java which has a constructor that takes three parameters – id, name, and type. Type will represent if the student is ‘remote’ or ‘in-person’. A toString() method in this class will display these details for any student. A generic method score() will be part of this class and it will be implemented by inherited classes. Write accessors and mutators for all data points. Write two classes RemoteStudents.java and InPersonStudents.java that inherits from Student class. Show the use of constructor from parent class (mind you, RemoteStudents have one additional parameter – discussion). Implement the abstract method score() of the parent class to calculate the weighted score for both types of students. Write a driver class JavaProgramming.java which has the main method. Create one remote student object and one in-person student object. The output should show prompts to enter individual scores – midterm, finals, ...... etc. and the program will…
- solve this by arraylist in the last of the question it has been told 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…Using JAVA Language Consider a Billing class that implements an interface Payable having a method getTotalPaymentAmount(). Besides this, you have a Doctor class with private instance variables (docID, docName, and docFee) and a public getDoc() method, Patient class with private instance variables (pName, pID, pDisease), Medicine class with private instance variables (medID, medName, medQty, medPrice), and MedicalTest class with private instance variables (testID, testName, testPrice). Each of these classes has the toString() method to display the information of its object. The Billing class is having "Has A" relationship with the other four classes (Doctor, Patient, Medicine, and MedicalTest) mentioned above. The getPaymentAmount() method of Billing class returns the total billing amount that includes doc fee, medicine cost, and medical test fee that a patient has to pay. After implementing these classes, you are required to do the following in the driver class: Create an ArrayList of…Use the parent classes to the left to help you solve this problem. The first parent is the Person class with some very generic information. The second class, CardHolder, is the class for a credit card holder. Create the child class PlantinumClient. This class inherits all of the attributes of both parent classes. In addition, the child class has the attributes cash_back and rewards. cash_back should be set to 0.02 and rewards should be set to 0. Override the process_sale method so that 2% of each sale is added to rewards. Expected Output Declare an instance of the PlatinumClient class as shown below. platinum = PlatinumClient("Sarah", "101 Main Street", 123364) Your class should be able to execute the code below in the stated order and produce the given return values. Order Code Return Value 1 platinum.process_sale(100) N/A 2 print(platinum.rewards) 2 3 print(platinum.balance) 100 4 platinum.make_payment(50) N/A 5 print(platinum.balance)…