Consider the following Country class: public class Country{ String name; Integer population; 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 (ii) 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: Suppose that you send an e-mail message whose only data is a microsoft excel attachment. What might ...
A: As per the given information I have tried to send an email with only a Microsoft Excel file and foun...
Q: e of a Co
A: Clock Rate: The clock rate, also known as clock speed, is the frequency at which a processor's clock...
Q: Int func1 (int m, int n){ if (n==1) return m; return m * func(m,n-1); } What does this func1 do? Wha...
A: A recursive function is a kind of function that calls itself until a base case is reached.
Q: Consider the graph in Figure 1. Unless otherwise indicated, always visit adjacent nodes in alphabeti...
A: Explanation:- A* search traveling nodes starting from node 5 and ending at node 12 as below... 5->...
Q: 1) Square all 3 sides. 2) Sum the squares of the 2 shortest sides. 3) Compare this sum to the squa...
A: ALGORITHM:- 1. Declare both the methods. 2. Initialise three variables containing the side length. 3...
Q: What is the boot-up procedure for the router?
A: INTRODUCTION: BOOT-UP: To boot is to power on a computer system and load the startup services until ...
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: What is the best way to take notes in Computer Science class? Discuss.
A:
Q: What exactly is HTML?
A: Introduction What exactly is HTML?
Q: 1. Write a Java program to determine the answers to the following: a. The squre of 30 ...
A: Since you have asked multiple questions, we will solve the first question for you. If you want any s...
Q: OS cloning is defined as "cloning an operating system with the intent of reducing its disadvantages....
A: Cloning Cloning is the process of installing software, hard drives, storage, and drivers, or reprodu...
Q: Attributes of a system visible to programmers are under Compu Select one: O True
A: Lets see the solution.
Q: 8= 358 = 10= 2 -7 16-
A: FACE 1111 1010 1100 1110 FACE 001 111 101 011 001 110 (175316) in octal (FACE)₁₆ = (15 × 16³) + (10 ...
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: Which of the following are NOT PROTECTED by Freedom of Speech? Second Class Speech, such as Advertis...
A: The solution to the given problem is below.
Q: Explain the significance of communications protocol selections, as well as the protocols that were u...
A: Introduction: A communication protocol is a set of rules that enables two or more entities in a comm...
Q: PART 1: REPETITION CONTROL STRUCTURE (FOR) Instruction: Create a flowchart and a java program that r...
A: Required : A java program that checks if an input number is perfect, deficient or abundant as per th...
Q: How can we instruct the computer?
A: Introduction: Additionally, a program is defined as a collection of instructions that accomplish a c...
Q: n an arg
A: ArgumentWhen a function is called, the values stated within the function are referred to as argument...
Q: One of the following tuples not exist in a * :CFG set of variables final symbol O
A:
Q: What exactly is the Medium Term Scheduler?
A: Introduction: Time scheduling is a collection of techniques used to construct and present schedules ...
Q: For this question, you will be required to use the binary search to find the root of some function f...
A: import numpy as npdef binary_search(f,domain, MAX = 1000): start ,end = domain # get the start and e...
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: Explain briefly how it is possible for people to charge their phones through USB ports.
A: Introduction: The USB port facilitates connectivity between external devices and your computer or la...
Q: 2) What parameters are passed in this web string and what dynamic language do you think is being use...
A: The type of language is identified using the file extension we have Here, we are trying to load inde...
Q: Difference between RS 422 and RS 423 serial interfacing standards
A: Solution:-
Q: ite algorithm and draw a flow chart to develop a simple calculator that perform addition, subtractio...
A: Lets see the solution.
Q: Could you please rewrite this class in a new way and provide me with its call in the ( int main {}) ...
A: Here is code as below: I think it is Encapsulation example with GEt and Set method. and i have used ...
Q: Factor 262063, 9420457, and 181937053 using the POLLARD RHO ALGORITHM, if the function f is defined ...
A: Algorithm: Start with random x and c. Take y equal to x and f(x) = x2 + c.While a divisor isn’t obta...
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: Lesson 9: Database - Java programming 1. Create a database of salesman: a. Table Descripti...
A: As per the requirement created a table When we enter the record in a table at the starting commissio...
Q: 1.(a)Determine with proof whether the following graph G is Hamiltonian. (b)Give a minimal set of dis...
A:
Q: 3. Given the following maxterm expansion. F(a, b, c) = MM(0, 3, 4, 6, 7) a) Construct an Implicant c...
A: ANSWER:-
Q: Examples of software that has been utilized in the field of Agricultural Engineering are listed belo...
A: Answer:
Q: To be able to use an I/O peripheral device, you need to put the address first in ... Select one: О а...
A: Memory address registers(MAR) is connected to the address lines of the system bus and specifies the ...
Q: examples of two-way communication in which each party take turns transmitting
A: Two way communication means that communication is happened between both sides Here both sender and r...
Q: Given a list of n positive integers, show that there must two of these integers whose difference is ...
A: - We need to show that there must be two integers in a n length list whose difference is divisible b...
Q: ems. Please ans
A: given - The raw bytes below show a directory entry of a FAT12 disk.00002700h: 55 53 51 20 20 20 20 2...
Q: There are three ways to pass arguments to parameters in a function. List them. Python.
A: Following is the all possible ways to pass arguments to parameters in a function in python. 1. Way I...
Q: Describe one design heuristic that facilitates the provision of feedback to users. Provide an exampl...
A: Introduction: A heuristic, or heuristic methodology, is an approach to problem-solving that uses a p...
Q: ges does TDM ha net twork? (1M)
A: given - What advantages does TDM have over FDM in a circuit-switched network?
Q: For Intel 8237A Registers: 1- Specify the bits in the Single Mask register to set mask for channel 2...
A: For Intel 8237A Registers: 2) MASK REGISTER : 1)The mask is clear or sets all of the masks with one ...
Q: What is the significance of the order in which the parameters are provided to a function when it tak...
A: Parameters: The information is passed to a function in the form of parameters. Any number of paramet...
Q: Write JavaScript codes to validate a name text field so that when a user submits the form with the n...
A: function validateform() { var name = document.myform.name.value; var Regex =...
Q: n Python the only import that may be used is Numpy A function called ttransition_matrix, which will...
A: import numpy as np class Graph: def __init__(self, vertices): self.V = vertices def printSolution(...
Q: Considering the following scenario: you are tasked with developing a note keeping program that autom...
A: INTRODUCTION: Users can use note-taking software to jot down ideas or notes in a text format. These...
Q: In a database, describe the representations of Identifying Relationships, Non-Identifying Relationsh...
A: INTRODUCTION: Database: It is a collection of data that has been organized for ease of access, manag...
Q: Suppose that both a language L and its complement are Turing-recognizable. Is L also necessarily Tur...
A: Here, we are going to check whether language L is also necessary to be Turing decidable or not. Turi...
Q: A = ⟨4,33,6,90,33,32,31,91,90,89,50,33⟩ A is a min heap, convert it to max heap and extract TWO maxi...
A: Here i have prepared written solution as follows:
Q: Write a Python program to input an integer t and print the sum of all multiples oft and 5 in the out...
A: Python Program: # Enter an integer t by user as inputt = int(input("Enter an integer: ")) # s for su...
Please need help with this JAVA
Step by step
Solved in 3 steps with 5 images
- 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.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.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…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…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.
- 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 java program to create a class Employee which contains member variables as name (String object)empid (Integer object)salary (Float object)age (Integer object)Define a default as well as a parameterized constructor to initialize member variables with default and specified values respectively. Define and overload a method search as defined below boolean search (Employee e[ ], String name) To search an employee with name in an array of employee objects, if found return true, else false.boolean search (Employee e[ ], Integer empid) To search an employee with the empid in an array of employee objects, if found return true, else false.Also define another method to get the name of employee having highest salary in a set of employees. String getHighestSalary(Employee e[ ]) To return the name of the employee with highest salary in an array of employee objects.Input: At least 3 employee details like name, empid, salary and age.Name of employee to searchId of employee to searchOutput:…Implement the following concepts by constructing suitable classes in Java -a. Constructorsb. Constructor Overloadingc. Function Overloadingd. Function Overridinge. InheritanceCreate a class Person - Field - Name, Birthdate, Contact no and Mail idMethods - Constructor, accept and displayClass Employee - Inherits the Person classFields : Emp ID, grade, basic salary, Gross Salary, HRA (House Rent Allowance), TA (TravelingAllowance), DA (Dearness Allowance)Given:Grade Basic TAA 8000 2000B 7000 1500C 6000 1000D 5000 500Calculate Gross Salary :Gross Salary = Basic + HRA (20% of Basic) + DA (50% Basic) + TAe.g if Basic = 8000TA = 2000HRA = 20% of 8000 = 1600DA = 50 % of 8000 = 4000Gross = 8000 + 2000 + 1600 + 4000 = 15600Optional : you can implement increment function in which you can change grade of an employee andrecalculate salary with new grade
- An arithmetic progression is a sequence of numbers such that the difference between the consecutive terms is constant. For instance, the sequence 5, 7, 9, 11, 13, 15 is an arithmetic progression with a common difference of 2. Given the class IntNumber: 1. public class IntNumber 2. { 3. public final int value; 4. 5. public IntNumber(int number) { 6. this.value = number; 7. } 8. } where value is an immutable field, that can be directly accessed (public), implement a class called ArithmeticProgression that implements the following methods: •1 public static IntNumber getArithmeticProgressionDifference(ArrayList< IntNumber> list) which returns the difference between terms of the arithmetic progression (as an object of type IntNumber) if the values of the IntNumber objects are an arithmetic progression. The method returns null in any other case. • public static void printIsArithmeticProgression(ArrayList<IntNumber> list ) which prints on the console: The list is an arithmetic…Can you implement the Derived Class Parameterized constructor? A solution is placed in the "solution" section to help you, but we would suggest you try to solve it on your own first. Implement the constructor Dell(String name) of the Derived Class Dell which takes a string, name. We have already implemented the Base Class Laptop with the member function getName() and a parameterized constructor. Input# Laptop name is being passed through the parameterized constructor. Output# getName() method is returing Laptop name. Sample Input# Dell dell = new Dell("Dell Inspiron"); Sample Output# "Dell Inspiron"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…