Design a class named Fan to represent a fan. The class contains: a. An int data field named speed that specifies the speed of the fan. A fan has speeds indicated with a value 1, 2, or 3. b. A bool data field named on that specifies whether the fan is on. c. A double data field named radius that specifies the radius of the fan. d. A no-arg constructor that creates a default fan with speed 1, on false, and radius 5. e. The accessor and mutator functions for all the data fields.
Q: Explain both the benefits and the drawbacks of using pre-made software packages rather than…
A: Explanation: The benefits and drawbacks of employing software packages rather than designing…
Q: Compare the mobile and cloud connectivity. How may mobile devices benefit from cloud computing?
A: Introduction: Mobile computing empowers us to get to information and data through a mobile gadget,…
Q: I need assistance converting the following code to a Hack assembly code
A: The Hack computer has a text-based assembly language to create programs for the hardware platform…
Q: Is it feasible to encrypt both the data and the connection from beginning to end? What are the…
A: All data on both sides of a communication connection is encrypted and decrypted using link…
Q: Find out the advantages and disadvantages of the network environment that is currently in use.
A: Determine the existing network environment's advantages and disadvantages.
Q: What difficulties are there in implementing networking throughout a whole organisation? Please…
A: One definition of networking is "goal-directed behavior that occurs both inside and outside of an…
Q: Take into consideration the following scenario: you are hired by company "x" and are working on a…
A: Given: Non-repudiation ensures that no one may question the validity of anything. Non-repudiation…
Q: What is the difference between TCP and UDP when it comes to networking? Compare and contrast these…
A: TCP is a connection-orientated protocol, whereas UDP is a connectionless protocol. A key distinction…
Q: What is the differences/similarities between FOR, WHILE and DO Loop.
A: HI THEREI AM ADDING ANSWER BELOWPLEASE GO THROUGH ITTHANK YOU
Q: What are the advantages that virtual private networks (VLANs) provide to an organization's business…
A: Introduction: Employ private Virtual Local Area Networks to isolate a user from the rest of the…
Q: Is it possible to successfully combat cybercrime in the world? How? Elaborate. Give examples of…
A: Cyber fraud can be defined as a fraudulent activity that is performed over the internet. The primary…
Q: Two alternative methods are used to terminate processes and break deadlocks.
A: Two methods break a Deadlock: To end the impasse, kill one or more processes. Preemption: To avoid…
Q: What kind of memory does the computer have, and how can you describe it?
A: Given: Provided: The background of the subject we must consider is given to us. The goal is to talk…
Q: What is the operating system's role in the management of the system's hardware?
A: Given: There is only room for one process to be active at any one time. Because central processing…
Q: Provide a condensed explanation of how Wavelength Division Multiplexing works.
A: Wavelength Division Multiplexing(WDM) works as following: In this technique, there is a multiplexer…
Q: * used for declaration for all forms global O dim O form O
A: Hey, the answer is given below.
Q: 3) Locate three sites on the internet that deal with web security. Use whatever means you want and…
A: 1) Dark ReadingDark Reading is packed with information for a growing information security community.…
Q: Identify some of the issues involved in constructing an infrastructure for an information system to…
A: Given: Identify some of the issues involved in constructing an infrastructure for an information…
Q: Learn everything you can about social networking. What is autonomic computing and how does it help…
A: According to the information given:-We have to define the social networking and autonomic computing…
Q: When dealing with the administration of multiprogramming, multiprocessing, and distributed computing…
A: Concurrency: Concurrency is a technique for interleaving actions in time to provide the appearance…
Q: In order to investigate and solve problems, every professional has to have access to the appropriate…
A: Given: Operating system technicians are in charge of installing, configuring, and maintaining…
Q: When you think about email, what images spring to mind? What path does an email take once it is…
A: Introduction: It's a means for sending electronic communications via the internet. It's a…
Q: Many of the motherboard's components are linked via parallel lines of electrical conductivity. Are…
A: Given: Parallel lines of electricity link the various components of a PC processing unit. Buses are…
Q: he advantages of floating point number over intege
A: A floating point number, is a positive or negative whole number with a decimal point. For example,…
Q: C. Video class inherits the class Disk. It has as attributes two Strings director and description.…
A: Given :
Q: How many of a computer's internal and exterior components receive their electricity directly from…
A: Definition: For the internal components of a computer, a power supply unit (PSU) transforms mains AC…
Q: In order to investigate and solve problems, every professional has to have access to the appropriate…
A: Introduction: There is still no perfect operating system. Every system has its own set of…
Q: Use social networking blogs and cloud computing to your advantage.
A: Cloud computing is a network of servers connected using the Internet. Its main function is to share…
Q: It is possible for a computer system to generate and process information in a variety of distinct…
A: Introduction: Similar to people, computers use their brains to process information. The central…
Q: Deduce X from the following, (i) (BA0.C),6 = (X)g (ii) (10101100)₂ = (X) 16 2 (iii) (FFE.C)₁ = (X) ₂…
A: The Answer is in Below Steps
Q: The individual components of a high-level programming language are identified by their names.
A: Start: Input refers to the process of providing the computer with data and instructions. output…
Q: What component of hardware is responsible for a device's ability to connect to the Internet?
A: What component of hardware enables a device's physical network connection? Solution: In the network,…
Q: What are the best practises of the extranet that apply to the intranet? What role does extranet play…
A: INTRANET: An intranet is described as an organization's internal private network. The objective is…
Q: Describe the variations in the number of locking techniques implemented between Solaris and Linux.…
A: Introduction: Describe the variations in the number of locking techniques implemented between…
Q: An analysis of the benefits and drawbacks associated with purchasing pre-made software rather than…
A: Advantages: Because the project is built for the mass market to meet the common criteria of many…
Q: When mapping generalisations and specialisations in enhanced entity relationship diagrams, which…
A: Enhanced entity relationship diagram is a graphical portrayal that portrays connections among…
Q: t by the phrase "virtual machine se
A: Introduction: Below the phrase "virtual machine security."
Q: Talk about frequency multiplexing as well as time division multiplexing (According to commuter…
A: Multiplexing is the sharing of a medium or bandwidth. It is the process in which multiple signals…
Q: Please enumerate the many ways in which TCP and UDP vary from one another.
A: TCP:It is a connection-oriented networking protocol that enables the exchange of messages between…
Q: Then then, why should anybody bother encrypting their data anyway?
A: Find the required answer given as below :
Q: The question is, under what circumstances is preventing deadlock less costly than allowing deadlocks…
A: Avoiding a stalemate A stalemate occurs when two tasks are waiting to be completed one after the…
Q: The individual components of a high-level programming language are identified by their names.
A: Solution: A high-level language (HLL) is a programming language like C, FORTRAN, or Pascal that…
Q: If you are using Windows 8 to play games on a gaming computer that already has built-in video and an…
A: Introduction: To guarantee that your gaming PC will meet your needs, you must build it yourself from…
Q: Master social media. How can autonomic computing improve cloud computing? Blogging is an example of…
A: The autonomic registering drive, which was created by IBM, exhibits and promoters organizing PC…
Q: You must write the proper program or pseudocode. You must provide also proper data type declaration…
A: According to the information given:- We have to follow the instruction to implement the withdrawal…
Q: What exactly do you mean when you talk about "network security," and how would you express it to…
A: The safety of a network "Network security" encompasses various technologies, equipment, and…
Q: Reflect on IBM's strategy in entering the PC market, VHS' entry into the video game market and…
A: While IBM were selling products like Automatic Sequence Controlled Calculator and type-writers for…
Q: hat does fine-grained multithreading mean
A: What does fine-grained multithreading mean?
Q: which is faster, static routes or dynamic routes? elaborate
A: Static Routing is faster than dynamic routing In static routing, the path between the routers are…
Q: By taking this course, not only will you improve your knowledge of social networking blogs, but also…
A: The social networking blog is the process of writing in a place where readers already existed.…
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:
in c++
Step by step
Solved in 3 steps with 2 images
- 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).Write a program named DemoJobs for Harolds Home Services. The program should instantiate several Job objects and demonstrate their methods. The Job class contains four data fields—description (for example, wash windows), time in hours to complete (for example, 3.5), per-hour rate charged (for example, $25.00), and total fee (hourly rate times hours). Include properties to get and set each field except the total fee—that field will be read-only, and its value is calculated each time either the hourly fee or the number of hours is set. Overload the + operator so that two Jobs can be added. The sum of two Jobs is a new Job containing the descriptions of both original Jobs (joined by and), the sum of the time in hours for the original Jobs, and the average of the hourly rate for the original Jobs. Harold has realized that his method for computing the fee for combined jobs is not fair. For example, consider the following: His fee for painting a house is $100 per hour. If a job takes 10 hours, he earns $1000. His fee for dog walking is $10 per hour. If a job takes 1 hour, he earns $10. If he combines the two jobs and works a total of 11 hours, he earns only the average rate of $55 per hour, or $605. Devise an improved, weighted method for calculating Harolds fees for combined Jobs and include it in the overloaded operator+() method. Write a program named DemoJobs2 that demonstrates all the methods in the class work correctly.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) Create an enumeration named Departments that contain four set of values FINANCE, HR, IT, and MARKETING.b) Create a class named PersonDetails that contains fields for a person’s first name (String), last name (String), and address (String). The class have- A constructor that accepts parameters for each field.- Get methods for each field.c) Create a class named Employee that contains fields for an employee ID (int), Social Security number (String), personal information (Person object), department (Departments type), and annual salary (double). The class have- A constructor that requires values for each data field.- Get methods for each of the data fields.- Set methods for each of the data fields.d) Create an application/class named EmployeeSort that allows a user to enter values for an array of 5 Employee objects (create an array of Employee type that will save 5 employee objects). Prompt a user for the data needed to create an employee object. Continue to prompt the user for Social…a) Create an enumeration named Departments that contain four set of values FINANCE, HR, IT, and MARKETING.b) Create a class named PersonDetails that contains fields for a person’s first name (String), last name (String), and address (String). The class have- A constructor that accepts parameters for each field.- Get methods for each field.c) Create a class named Employee that contains fields for an employee ID (int), Social Security number (String), personal information (Person object), department (Departments type), and annual salary (double). The class have- A constructor that requires values for each data field.- Get methods for each of the data fields.- Set methods for each of the data fields.d) Create an application/class named EmployeeSort that allows a user to enter values for an array of 5 Employee objects (create an array of Employee type that will save 5 employee objects). Prompt a user for the data needed to create an employee object. Continue to prompt the user for Social…Create a class called Invoice in your assignment source package. An Invoice should include four pieces of information as attributes(instance variables) - a part number of type String, a part description of type String, a purchasing quantity of type Int, and a price per item of type double. Your class should have a full constructor that initializes all the four attributes. Provide a set and a get method for each attribute. In addition, provide a method named getInvoiceTotal that calculates the invoice total, purchasing quantity * price per ite, and returns the invoice total. If the quantity is negative, returns 0. Create an test app named InvoiceTest in the same package that demonstrates class Invoice's capabilities.
- In Kotlin, Write a Circle data class, with a radius as a parameter to the constructor, a custom-coded property for the area, and a sizeRatio() function that takes a reference to another Circle and returns the ratio of the radius of the instance circle (the one you call the function on) to the other circle . Use math.pow and math.PI. Write a main() that creates a circle, prints it (which will print it's automatically generated toString()), prints its radius, creates another circle, and shows the size ratio of the two.Design a class named RegularPolygon that contains:- A private int data field named n that defines the number of sides in the polygon with default value 3.- A private double data field named side that stores the length of the side with default value 1.- A private double data field named x that defines the x-coordinate of the polygon’s center with default value 0.- A private double data field named y that defines the y-coordinate of the polygon’s center with default value 0.- A no-arg constructor that creates a regular polygon with default values.- A constructor that creates a regular polygon with the specified number of sides and length of side, centered at (0, 0).- A constructor that creates a regular polygon with the specified number of sides, length of side, and x- and y-coordinates.- The accessor and mutator methods for all data fields.- The method getPerimeter() that returns the perimeter of the polygon.- The method getArea() that returns the area of the polygon.The formula for…a) Create an enumeration named Departments that contain four sets of values FINANCE, HR, IT, and MARKETING.b) Create a class named PersonDetails that contains fields for a person’s first name (String), last name (String), and address (String). The class haveA constructor that accepts parameters for each field and Get methods for each field.c) Create a class named Employee that contains fields for an employee ID (int), Social Security number (String), personal information (Person object), department (Departments type), and annual salary (double). The class haveA constructor that requires values for each data field.Get methods for each of the data fields.Set methods for each of the data fields.d) Create an application/class named EmployeeSort that allows a user to enter values for an array of 5 Employee objects (create an array of Employee type that will save 5 employee objects). Prompt a user for the data needed to create an employee object. Continue to 2prompt the user for Social…
- MUST BE IN JAVA In an n-sided regular polygon, all sides have the same length and all angles have the same degree (i.e., the polygon is both equilateral and equiangular). Design a class named RegularPolygon that contains: - A private int data field named n that defines the number of sides in the polygon with default value 3. - A private double data field named side that stores the length of the side with default value 1. - A private double data field named x that defines the x-coordinate of the polygon’s center with default value 0. - A private double data field named y that defines the y-coordinate of the polygon’s center with default value 0. - A no-arg constructor that creates a regular polygon with default values. - A constructor that creates a regular polygon with the specified number of sides and length of side, centered at (0, 0). - A constructor that creates a regular polygon with the specified number of sides, length of side, and x- and y-coordinates. - The accessor and…Design a class named PhoneCall with four fields: two strings that hold the 10-digit phone numbers that originated and received the call, and two numeric fields that hold the length of the call in minutes and the cost of the call. Include a constructor that sets the phone numbers to Xs and the numeric fields to 0. Include get and set methods for the phone number and call length fields, but do not include a set method for the cost field. When the call length is set, calculate the cost of the call at three cents per minute for the first 10 minutes, and two cents per subsequent minute. Create the class diagram and write the pseudocode that defines the class. Design an application that declares three PhoneCalls. Set the length of one PhoneCall to 10 minutes, another to 11 minutes, and allow the third object to use the default value supplied by the constructor. Then, display each PhoneCall's values. Create a child class named InternationalPhoneCall that inherits from PhoneCall. Override…Create a class named Person that holds the following fields: two String objects for the person’s first and last name and a LocalDate object for the person’s birthdate. Create a class named Couple that contains two Person objects. Create a class named Wedding for a wedding planner that includes the date of the wedding, the Couple being married, and a String for the location. Provide constructors for each class that accept parameters for each field, and provide get methods for each field.