Design a class named a Rectangle to represent a rectangle. The class should contain the following: a. Two double data fields named width and height that specify the width and height of the rectangle. b. A no-arg constructor that creates a rectangle with width 1 and height 1. c. A constructor that creates a default rectangle with the specified width and height. d. The accessor and mutator functions for all the data fields. e. A function named getArea() that returns the area of this rectangle. n A function named getPerimeter() that returns the perimeter. Draw the UML diagram for the class. Implement the class. Write a test program that creates two Rectangle obiects. Assign width 4 and height 40 to the first obiect
Q: 4- The instruction delay(1000) mean wait for a second. 5- Void setup() function is used to…
A: These are the questions related to Arduino programming. Final answers in next step. Arduino…
Q: What exactly is a point of view? What exactly is a point of view? Are there actual instances of the…
A: Perspective is derived from the Latin word meaning "to look through" or "to perceive," and all of…
Q: If a class does not have a function Object() { [native code] } declared for it, then how are objects…
A: Answer: In object-oriented programming, an object is an abstract data type specified by a developer…
Q: What is the Toolbox's role in the Visual Studio environment?
A: Given: The user interface is comprised of a variety of controls, all of which are included inside a…
Q: What are the benefits and drawbacks of having global connection to the cloud?
A: Answer the above question are as follows
Q: Explain what is meant by the phrase "virtual machine security."
A: Introduction: Virtual Machine Security: Virtualized security, or security virtualization, refers to…
Q: Cloud computing and social networking blogs
A: Introduction What is networking blog: The purpose of a blog is to provide information on your…
Q: What is the CPU time if the number of instructions executed by the program is 500, cycles per…
A: Answer : option C i.e., 500000 sec. The parameters given in the given question are NUMBER OF…
Q: Use cloud computing and social networking blogs to better grasp the subject matter.
A: In addition to storing data, social networks now use clouds for various additional purposes. For…
Q: y's technology. W
A: A computer is a digital electronic machine that can be modified to complete groupings of…
Q: What does it mean when someone asks about the basic service set configuration of a wireless network?…
A: Start: BSS is a network architecture that stands for basic service set. It allows wireless devices…
Q: A Learning Outcomeb is associated with this criteria. What's the difference between UDP and TCP,…
A: TCP: We need a congestion policy, TCP, which employs a congestion window to prevent network…
Q: plz need asp tha
A: import java.util.*; import java.util.Scanner; class Disk{ private String title; private int…
Q: C. Video class inherits the class Disk. It has as attributes two Strings director and description.…
A: Given :
Q: Compare and contrast the most significant links that may be made between mobile devices and cloud…
A: Mobile cloud computing uses a computer cloud to deliver applications to mobile devices. These mobile…
Q: Give me 5 vulnerabilities and 5 Risk for Web or database server level control
A: answer is
Q: 29. Compute each of these sums. a. Zies(i2 + 1) where S = {1, 3, 5, 7). b. [4i=0(k. 2¹) c. [2i=0…
A:
Q: IX) Represent (-76) 10 in a) Sign Magnitude form and b) Sign 1's Complement form. c) Sign 2's…
A: Answer a and b: a->11001100 b-> 10110011…
Q: What exactly is meant by "deadlock avoidance"? What steps should be taken to achieve this goal…
A: Start: A deadlock occurs when two computer programmes that share the same resource effectively…
Q: Explain the details about the abstract Class InputStream that includes read(), skip(), available(),…
A: InputStream class is the superclass of all the io classes for example addressing an information…
Q: ivate te Sub Form_Click() Dim Spe e Speed= 75 If (Speed >75) The 60 Else If (Speed > 50) Then Fee se…
A: The solution for the above problem is as follows Initially it contains multiple if else
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: A global company opens several branches in Pakistan. Imagine you're hired to build the company's…
A: Networking in the workplace: It establishes relationships with other business people as well as…
Q: In the OSI model, the presentation layer is responsible for a variety of tasks, including…
A: The application layer of the OSI model performs much of the same functions as the presentation…
Q: Is there a reason why every computer has a central processing unit?
A: INTRODUCTION: The central processing unit (CPU) instructs the computer on how to solve an issue.…
Q: = Write a program to calculate the Area and volume for a
A: Given : Note:Since programming language is not mentioned i used c language.
Q: What is wireless network "infrastructure mode"? If the network isn't in infrastructure mode, what…
A: The network is considered infrastructure mode when a personal computer is connected to either a…
Q: How many of the computer's components get their power from the power supply directly, as opposed to…
A: Given: Power ranges from 50 to 150 watts. Your motherboard is likely to use 50 to 150 watts, and…
Q: Between Go-back-N or selective-repeat, which one makes more efficient use of network bandwidth?…
A: Find the required answer given as below :
Q: A technician with a PC is using multiple applications while connected to the internet. How is the Pc…
A: A computer is able to keep track of the data flow between application sessions and has the ability…
Q: Analyze how mobile devices and cloud computing are similar and how they differ in terms of the most…
A: Introduction: Cloud computing on the go cloud computing is used to provide programs to mobile…
Q: What exactly is the memory unit of a computer? Describe the numerous distinct categories of computer…
A: A computer's memory can be measured in bits, bytes, kilobytes, megabytes, and gigabytes, among other…
Q: Have a comprehensive understanding of the notion of social networking. What precisely is meant by…
A: SOCIAL MEDIA NETWORKING concept has a goal of connecting people across the world. Social media sites…
Q: i sequence sequence starts with 0 and 1 (positions 1 and 2). Each next element is a sum of two…
A: Given : The Fibonacci sequence sequence starts with 0 and 1 (positions 1 and 2). Each next element…
Q: - Write an HTML code to create a table with four rows and tow columns to store names and phones.
A: The HTML code along with the snapshot of code and output is given below:
Q: You're interested in learning more about social networking blogs, as well as cloud computing and…
A: Introduction: Instagram, Facebook, and Tumblr are examples of social networking sites that contain…
Q: What methods do hackers use in the process of social engineering in order to get a user's login id…
A: Before stealing data or managing a system with malware or RATs, hackers use this method to get a…
Q: What method of communication is used in a local area network that is wireless?
A: Local Area Network: A local area network (LAN) is a collection of computers and peripheral devices…
Q: The study of computers What are the many families of RAM that may be used in a computer?
A: RAM: RAM is an acronym for Random Access Memory. When a computer or laptop's power is switched off,…
Q: Describes SSL protocol.
A: The Secure Sockets Layer, or SSL, protocol was developed as an industry standard for the safe…
Q: What's with all the talk about cloud computing and social networking blogs?
A: Cloud computing is a preferred term for anything that involves handing over hosted offerings over…
Q: Parallel electrical conducting lines are used to link the various components on the motherboard of a…
A: Given: Considering the advantages and disadvantages of utilizing a personal computer rather than one…
Q: At the time of runtime, the attribute of a control, in the same way that the attribute of other…
A: Attribute Control Charts are a subset of control charts explicitly designed for monitoring issues…
Q: Then then, why should anybody bother encrypting their data anyway?
A: Find the required answer given as below :
Q: There are a range of standard utilities and diagnostic tools available for network administration…
A: A range of standard utilities and diagnostic tools is available for network administration and…
Q: 1) Write simple instructions (simple program) that will add two consecutive bytes of data storied…
A: According to the Bartleby guideline, we are supposed to answer only one question at a time. Kindly…
Q: nderstand social media. Autonomous computing versus cloud computing: what's the difference? These…
A: Autonomic Computing is the PC's ability to self-govern itself through flexible development that…
Q: What advancements in routeing and switching technologies have occurred throughout time?
A: Given: A routing switcher is a standard component that may be found in a broad variety of TV…
Q: Investigate in detail the blogs associated with social media platforms and cloud computing in…
A: The social media platform is an internet-based system for exchange, sharing, and information…
Q: When it comes to computer operating systems, is it feasible to make a distinction between the two…
A: Given: Operating System (OS) Dual Mode An mistake in one programme may have a negative impact on…
in c++
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 2 images
- Given main(), complete the FoodItem class (in file FoodItem.java) with constructors to initialize each food item. The default constructor should initialize the name to "Water" and all other fields to 0.0. The second constructor should have four parameters (food name, grams of fat, grams of carbohydrates, and grams of protein) and should assign each private field with the appropriate parameter value. Ex: If the input is: Water the output is: Nutritional information per serving of Water: Fat: 0.00 g Carbohydrates: 0.00 g Protein: 0.00 g Number of calories for 1.00 serving(s): 0.00 Ex: If the input is: M&M's 10.0 34.0 2.0 3.0 where M&M's is the food name, 10.0 is the grams of fat, 34.0 is the grams of carbohydrates, 2.0 is the grams of protein, and 3.0 is the number of servings, the output is: Nutritional information per serving of M&M's: Fat: 10.00 g Carbohydrates: 34.00 g Protein: 2.00 g Number of calories for 1.00 serving(s): 234.00 Number of calories for 3.00 serving(s):…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.The client needs a program to store data on sandwiches, including bread name, filling name, and calories (cal) Testing values for get and set methods are bread name: “whole-wheat”, filling: “tuna”, and calories 250.50 Testing values for overloaded constructor are bread name: “rye”, filling: “chicken”, and calories 300.25 Using the word problem above, design a class with the needed fields, a no parameter constructor, an overloaded constructor with three parameters, and needed methods (gets sets). Document your design using a detailed UML Class diagram. Part 2 Write the Java code for the class Follow your UML class diagram and code the class you designed. Use Java coding conventions for identifiers: class, constructor, field, variable, and method names Mark fields private, constructor and methods public. Select and use appropriate data types for the fields as well as method parameters as needed. Comment your code as requested and demonstrated in the course. Part 3 Test the…
- (After reading the instructions given in the pictures attached, read the following) Class membersdoctorType Class must contain at least these functionsdoctorType(string first, string last, string spl); //First Name, Last Name, Specialty void print() const; //Formatted Display First Name, Last Name, Specialtyvoid setSpeciality(string); //Set the doctor’s Specialtystring getSpeciality(); //Return the doctor’s SpecialtypatientType Class must contain at least these functionsvoid setInfo(string id, string fName, string lName,int bDay, int bMth, int bYear,string docFrName, string docLaName, string docSpl,int admDay, int admMth, int admYear,int disChDay, int disChMth, int disChYear);void setID(string);string getID();void setBirthDate(int dy, int mo, int yr);int getBirthDay();int getBirthMonth();int getBirthYear();void setDoctorName(string fName, string lName);void setDoctorSpl(string);string getDoctorFName();string getDoctorLName();string getDoctorSpl();void…My professor has given me additional information for this question: Create a class named CollegeCourse that includes data fields that hold thedepartment (for example, ENG), the course number (for example, 101), thecredits (for example, 3), and the fee for the course (for example, $360). All of thefields are required as arguments to the constructor, except for the fee, which iscalculated at $120 per credit hour. Include a display() method that displaysthe course data. Create a subclass named LabCourse that adds $50 to the coursefee. Override the parent class display() method to indicate that the course isa lab course and to display all the data. Write an application named UseCoursethat prompts the user for course information. If the user enters a class in any ofthe following departments, create a LabCourse: BIO, CHM, CIS, or PHY. If theuser enters any other department, create a CollegeCourse that does not includethe lab fee. Then display the course data. Save the files as…Write a program to create a class named 'height', containing variable 'feet', 'inch'. Create two objects of the class, set some value to the first class. Then increment that object by 1 and assign this object to the second object. Display the results of both object after the procedure is completed.
- Hi there, I have attached the errors, the assignemnt is bleow and my code below that. PLease could you help fix these errors? Thank you so much in advance. Kind regards assignment: Make a class student (in student.py) that stores the following information for a student: Name (name) Student number (student_nr) Points per assignment (points_per_assignment) Exam grade (exam_grade) a) Behind each point of information is the name of the parameter to the initializer method. Store this information from the parameters in the object's attributes with the same name. b) Add a method course_points() which returns the number of course points the student has gotten. Example: mary = Student("Mary", 15789613, [10, 9, 8, 10, 9, 10], 9)print(mary.course_points()) > 121 The calculation of the course points is explained in the course overview, course setup slides (Links to an external site.) and the first lectureLinks to an external site.. c) Add a method grade() which returns a the final grade…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…Java Question - Using the bottom code, create another class named "DigitalBook" as a subclass of the given "Book" class. Then, Make sure that the "DigitalBook" class contains two constructors: (1) one is the default constructor that takes no parameter, and (2) the other is a parameterized constructor that take 6 parameters. Be sure to use the “super” keyword in the constructors of the "DigitalBook" class. In the “main()” method of the “EX12_1” class, create four instances: “b1”, “b2”, d1”, and “d2”. Let “b1” and “b2” be the instances of the “Book” class, and let the “d1” and “d2” be the instance of the “DigitalBook” class. Be sure to use the specified constructor (as shown in attached picture) to initialize these instances. The Final Output is shown in the attached pictures. Please make sure that no errors show up in the Java Compiler when testing the code. Thank you. Add the following code to the "class Book" code (Below the ___ line). public class EX12_1{public static void…
- Java Question - Using the bottom code, create another class named "DigitalBook" as a subclass of the given "Book" class. Then, Make sure that the "DigitalBook" class contains two constructors: (1) one is the default constructor that takes no parameter, and (2) the other is a parameterized constructor that take 6 parameters. Be sure to use the “super” keyword in the constructors of the "DigitalBook" class. In the “main()” method of the “EX12_1” class, create four instances: “b1”, “b2”, d1”, and “d2”. Let “b1” and “b2” be the instances of the “Book” class, and let the “d1” and “d2” be the instance of the “DigitalBook” class. Be sure to use the specified constructor (as shown in attached picture) to initialize these instances. The Final Output is shown in the attached pictures. Add the following code to the "class Book" code (Below the ___ line). public class EX12_1{public static void main(String[] args){/////add your code here}}…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…