design a class named Rectangle to represent a rectangle. The class contains: ▪ Two double data fields named width and height that specify the width and height of the rectangle. The default values are 1 for both width and height. ▪ A no-arg constructor that creates a default rectangle. ▪ A constructor that creates a rectangle with the specified width and height. ▪ A method named getArea () that returns the area of this rectangle. ▪ A method named getPerimeter () that returns the perimeter. Draw the UML diagram for the class then implement the class. Write a test program that creates two Rectangle objects-one with width 4 and height 40, and the other with width 3.5 and height 35.9. Display the width, height, area, and perimeter of each rectangle in this order.
Q: Array: dq 39, 15, 23, 81, 45, 24, 64, 93, 64, 21, 19, -7, 93, 48, 123, 44 Using the array "Array"…
A: In computer science and programming, arrays are fundamental data structures used to store…
Q: between the following
A: In the field of cryptography and information security, the ideas of letter frequency, avalanche…
Q: Python code: Using a for loop, ask the user for 5 integers. Print the third input.
A: 1. Initialize an empty list called user_inputs to store the user's integers.2. Using a for loop with…
Q: Please provide a drawn diagram either online tools or hand written for Question 2b to better…
A: One Way : Chinese PM ----> Japanese Translator ----> German Translator ----> French PMReply…
Q: Which of the following are false. A Java variable can begin with the underscore…
A: The objective of the question is to identify which of the given statements about Java variables and…
Q: Consider the schema R=ABCDEG and the set of functional dependencies F={BC→AG, BG→CD, C→AE, D→AG} 2a)…
A: To address each part of your question:2a) Determine the keys of the schema:To find the keys of the…
Q: 4- Let us consider the following grammar with the given production rules: E-> I E-> E+E E-> E* E E->…
A: Leftmost Derivation: Leftmost derivation is a parsing technique used in formal grammar theory. It's…
Q: The files provided in the code editor to the right contain syntax and/or logic errors. In each case,…
A: After correcting the code, I have provided JAVA CODE along with CODE SCREENSHOT and OUTPUT…
Q: I need help with this in html,re-create the home page using Bootstrap so it looks like the following…
A: I have provided a possible HTML code for your task; check it out in the explanation…
Q: Question 2 Given the table X: X(A, B, C, D, E, F, G, H) And the functional dependencies: A -> {C, H}…
A: Normal form is used to reduce redundancy in databases. Types of normal form:1 NF2 NF3 NF4 NF5 NF
Q: Q1. Using the layer models in Figure 1, describe the ordering and delivery of a pizza, indicating…
A: The scenarios demonstrate the complexities of intercultural and technological communication issues…
Q: 2.9 Give a context-free grammar that generates the language A = {a¹b¹c|i=j or j = k where i, j, k ≥…
A: A Context-Free Grammar (CFG) is like a set of rules for building sentences in a language. Think of…
Q: Explain the role of computer chess as it relates to
A: In this step, we'll delve into the role of computer chess and its broader implications, examining…
Q: How could data collection using an interview protocol and an analysis plan using thematic analysis…
A: Hybrid Learning, blending traditional face-to-face instruction with online components, has emerged…
Q: Which of the following statements is false? The FXML code is integrated with the program logic…
A: Navigating through the various statements concerning JavaFX and Scene Builder provides insight into…
Q: def custom_transform(data): """ Transform the `spiral.csv` data such that it can be more…
A: Data transformation is essential in machine learning and data analysis to improve data…
Q: (III) Assume the alphabet Σ = {a,b). Give the set all strings over Σ of length less than or equal to…
A: To solve this problem, we first need to list all possible strings over the alphabet Σ={a,b} of…
Q: Explain the challenges of storing and managing big data
A: In the digital age, the proliferation of data from diverse sources has given rise to what is…
Q: I need help with MATLAB programming. I was working on a program that would give the both values of…
A: The MATLAB program aims to calculate both sine and cosine values for a given set of angles. By…
Q: Prove that the following compound propositions are logically equivalent by using the laws of…
A: Logical Connectives: Logical connectives are symbols used to combine or modify propositions to form…
Q: Loop invariants 2000 Consider the following code, assuming that i, x, y, and n are integers, with n…
A: In this question we have been provided with the code which talks about the loop invariants, which…
Q: 2. Specify the read and write rights in the following access control matrix for a system that…
A: The Biba model is an access control framework aimed at safeguarding data integrity. It restricts…
Q: 3. Are the languages L₁ and L₂ below over the alphabet Σ = {a,b,c} regular or non-regular? Justify…
A: A regular language is a set of strings formed by a specific pattern or structure that can be…
Q: If someones ID in a country has 3 values from (0,1) followed by 2 letters in english alphabet.…
A: Curious approximately the range of feasible IDs in a system using numbers and letters? This…
Q: 8 Outline different data transformation methods. Examine the methods such as: min-max, z-score and…
A: Data normalization in data mining involves transforming and rescaling data to a standard format,…
Q: In c++ Write a function that receives a string containing a 16-bit binary integer. The function…
A: since you have Posted multiple questions, we will provide the solution only to the specific sub…
Q: s) Write a Java program that fine an integer array with length of 10. pulate the array with random…
A: Java program that sorts the array using bubble sort, selection sort, and insertion sort. Bubble…
Q: Conditional Formatting Which of the following is NOT a conditional formatting option in Excel?…
A: In Excel, conditional formatting allows you to automatically apply formatting—such as colors, icons,…
Q: Your company is considering using N-version programming—with three software development firms and…
A: The stakes are excessive when navigating a guided missile, demanding unwavering reliability and…
Q: b. Discuss the role of feedback loops in the rapid prototyping and concurrent design process
A: Rapid Prototyping: Quickly creating basic versions of a product to test ideas and gather feedback…
Q: Can you help me with a regular expression problem related to section L of question 1.18? To tackle…
A: A theoretical model called a Deterministic Finite Automaton (DFA) is used to identify patterns in…
Q: What is risk acceptance in cybersecurity?
A: Risk acceptance in cybersecurity refers to the conscious decision to accept the potential…
Q: Q8. I have a pipelined CPU design with 7 stages. How many clock cycles would it take to execute N…
A: To determine the number of clock cycles required to execute N instructions in a pipelined CPU with 7…
Q: Using HTML , CSS, and Java Script create a dashboard. Include in the dashboard a side bar ( 3…
A: Using HTML, CSS, and JavaScript to create a dynamic and interactive dashboard requires combining a…
Q: You're developing a Python program for "AdventureGear Outfitters," an online adventure gear store.…
A: Online adventure gear company AdventureGear Outfitters serves outdoor lovers. This Python program…
Q: 2. Write a function usolve, analogous to function 1solve in section 7.2.2, to solve an upper…
A: In this question we have to develop a MATLAB function named usolve, which is used to solve a system…
Q: How can the field of artificial intelligence incorporate ethical considerations and address…
A: Significant advantages and efficiency result from the incorporation of artificial intelligence (AI)…
Q: what are all the LTS versions of Java / the JDK?
A: Java Development Kit (JDK) is a comprehensive software development kit used to develop Java-based…
Q: AHPA #11: Changing Grades *use c programming language * Create a C function (switcher) that will…
A: The objective of the question is to create a function in C programming language that will receive a…
Q: Given a 2D list of characters and a list of tuples containing replacement pairs, write Python code…
A: In this question you asked to write a Python program that takes a 2D list of characters and a list…
Q: 3. Let - (10-¹6 1) A = b-(3) and b = Here we will see the effect of using a tiny element as a pivot.…
A: The system to be solved is:A⋅x=bwhere matrix A and vector b are given by:Solving the linear system…
Q: create a grammatically correct and logically flowing a paragraph from the topic material that…
A: Human-Computer Interaction (HCI) refers to the study and design of the interaction between humans…
Q: Consider the Queue Abstract Data Type (ADT), Q, defined over some generic type T and defined using…
A: The question given above has 3 subparts; at part 1, it is asked to define operations Enqueue(Q, T)…
Q: Write in F# language (F sharp) -> do not use Python, C++, C#, C, Java, etc… The following: In F#…
A: F# code :-1(* 2Author: [Your Name] 3Originality: I assert that this code is original and has been…
Q: How will you troubleshoot a performance issue if the information available in Task Manager is not…
A: Any fault or decline in a system, application, or process's speed, responsiveness, or efficiency is…
Q: Can you assist me in resolving a regular expression challenge pertaining to section K of problem…
A: In this question we have to provide regular expression and state diagram for DFA's recognizing…
Q: In order to allow the user to enter data from the keyboard, we use an object from the ____ class.…
A: The objective of the question is to identify the class in Java that allows user to enter data from…
Q: All member variables should - in most cases - be declared with this access specifier.…
A: The question is asking about the most appropriate access specifier for member variables in most…
Q: .What is the 16-bit hexadecimal representation of each of the following signed decimal integers? −…
A: Kindly note that as per the rules I am allowed to answer only the first question incase of multiple…
Q: As you build a GUI, recall that it's often easier to manipulate layouts and controls via window than…
A: High-level, object-oriented Java programming was created by Sun Microsystems, which was later…
Trending now
This is a popular solution!
Step by step
Solved in 5 steps with 4 images
- Write a class called Book having the following data members: title (String), author1 (String), author2(String), publisher (String), yearPublication (int), isbn (String), accessionNum (long), issuedTo (LibMember). Include following public methods in the class: Default constructor (without any parameters), constructor with 6 parameters (except for issuedTo – initialize issuedTo to null), set and get methods for all attributes, equals and toString. NOTE: The ISBN is a unique 13 digit number assigned by the publisher. It is like barcode. As there can be multiple copies of a book in a library, the libraries assign a unique number, called accession number, to every book in the library to keep track of the books in the library. Assume that accession number starts from 1001.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).Implement a class named Rectangle to represent a rectangle using Java 1) Class name: Rectangle; accessibility: public 2) The class contains: Two private double data fields named width and height that specify the width and height of the rectangle. 3) A no-arg constructor that creates a default rectangle: data fields are 1 for both width and height. 4) A constructor that creates a rectangle with the specified width and height. 5) A public method named setWidth that sets the value of width 6) A public method named getWidth that returns the value of width 7) A public method named setHeight that sets the value of height 8) A public method named getHeight that returns the value of height 9) A public method named getPerimeter() that returns the perimeter. 10) A public method named getArea() that returns the area of this rectangle. 11) Draw the UML class diagram 12) Write a test file that creates two Rectangle objects: one with width 4 and height 40 and the other with width 3.5 and…
- Solve B please(A) Write a class called Course having data members: courseNum (String such as ITCS214), courseName (String such as Data Structures), credits (int), section (int). Include the following public methods in the class: Default constructor (without any parameters), constructor with 4 parameters, set and get methods for all attributes, equals and toString methods (B) Write a class called Student having following data fields: idNum (long), firstName (String), lastName (String), gender (char), email (String), coursesRegistered (ArrayList of type Course). Note that coursesRegistered is a list of type ArrayList (Java class) in which each element is of class type Course. The coursesRegistered is the list of courses in which the student is currently registered. It has following methods: Default constructor (without any parameters), constructor with 5 parameters (except for coursesRegistered), set and get methods for all attributes, equals, and printCoursesRegistered. The list…Write a class called LibMember having the following data members: firstName (String), lastName (String), gender (char), cprNum (long), teleNum (String), booksIssued (array of type Book, size = 10) and numBooksIssued (int). Include following public methods in the class: Default constructor (without any parameters), constructor with 5 parameters (except for booksIssued and numBooksIssued – initialize nubBiiksIssued to 0), set and get methods for all attributes, equals and toString.1. Create a class called Student, with the following attributes/variables:a. studentName (String)b. studentNumber (int)sc. regYear(long)d. faculty(String)e. department(String)2. Add the following methods in Student:a. accessors and mutators for all variablesb. toString methodi. Formulate your toString so that it only shows studentName,studentNumber and faculty3. Create a class called MyFriends, with the following attributes variables:a. studentArray(Student[])4. Add the following methods in MyFriends:a. fillArrayi. Using scanner ask how many students does the user want to inputii. Capture user input for all of his friends(Of course we are assuming all your friends would be similarUWC students, go ask around and meet new friends, alsopreferably not in the same Computer Science department … ifpossible … only if possible)b. maini. Call the fillArray methodii. Count how many Computer Science studentsiii. If half or more students are Computer Science students, thendisplay “You … need more…
- Java ProgramFollowing the example of the Circle class in Section 9.2, design a class named Rectangle to represent a rectangle. The class contains:- Two double data fields named width and height that specify the width and height of the rectangle. Thedefault values are 1 for both width and height.- A no-arg constructor that creates a default rectangle.- A constructor that creates a rectangle with the specified width and height.- A method named getArea() that returns the area of this rectangle.- A method named getPerimeter() that returns the perimeter Draw the UML diagram for the class then implement the class. Write a test program that creates two Rectangle objects—one with width 4 and height 40, and the other with width 3.5 and height 35.9. Display the width, height, area, and perimeter of each rectangle in this order.Create a class Course, which has one field: String courseName Create the constructor, accessor, and mutator for the class. Then, in the main method of this class, create an instance of the class with the name "CST1201". Write an equivalent while statement to replace the following for statement for (int i=2; i<100; i=i+2) { System.out.println(i); }Please write the Java code for a Phone class that represents a mobile phone, as detailed below: It should have instance variables (attributes) for make, model, color (all stored as Strings) and capacity (stored as int: the storage capacity in GB) Please define one constructor with parameters for all those attributes. The Phone class will be immutable, except its storage capacity can be changed. So please write only one mutator method, called .setCapacity. Please write accessor methods for each instance variable. Please write a .toString() method to display all the Phone's information. Please write a .equals method to compare two Phone objects, returning true if all their attributes are the same. Finish the Jave program to show the outputs bellow: Code: class Main { public static void main(String[] args) { Phone craigPhone, bettoPhone, tobyPhone; craigPhone = new Phone("Samsung", "Galaxy S21 5G", "Phantom Violet", 256); bettoPhone = new Phone("Apple", "iPhone 13 Pro",…
- Given this class, please add the requested methods in the designated spaces provided. Instance methods: a) Write two constructors that will initialize the instance variables for a Student instance as follows: 1) Write a constructor that takes in three parameters – an int, a String, and a double. The constructor will assign them to the ID, name, and GPA instance variables respectively. 2) Write a no-argument (zero-parameter) constructor that will set the ID to - 1, the name to “No name assigned”, and the GPA to –1.0. b) Write an accessor method for the name variable. c) Write a mutator method for the GPA variable. d) Write a toString() method that will display all three instance variables on a single line, with a | (vertical bar) character between each one. e) Write an equals() method that returns true only if all three instance variables are equal. public class Student { // declare instance variables here private int ID; private String name; private double GPA;Design a public class named Rectangle to represent a rectangle following the example of the Circle class we did in Lesson #5. The Rectangle class contains:• Data fields:o private double data field width with default value 2o private double data field length with default value 3• Two constructor methods:o A no-argument constructor that creates a default rectangle with the default valueso A constructor that creates a rectangle with the specified width and length in the formal parameters• Instance methods:o A public method named getPerimeter() that returns the perimeter of the rectangle (double)o A public method named getArea() that returns the area of the rectangle (double)o Public getter methods to access the data fields, specifically:▪ getWidth()▪ getLength()o Public setter methods to set the data fields to values passed in▪ setWidth (double newWidth)▪ setLength(double newLength)INFO 1214 –Assignment 3Page 2Write a simple test program call TestRectangle like we did in class that…Write a Java class called HotelRoom that represents a hotel room. The class will contain the following attributes: •RoomNo (int) •PhoneNumber (string) •Capacity (int) – Number of people that room can accommodate. •Grade (int) – Grade of room ranging 1-5, 5 being most valuable. Your class should have a constructor that takes a single parameter: RoomNo. The necessary accessors (i.e. get methods) and mutators (i.e. set methods) for class variables: Room number only accessor Phone number both mutator and accessor Capacity both mutator and accessor Grade both mutator and accessor 2.Write a Java class called Hotel that represents a hotel. The class will contain the following attributes: •Name (string) •ReceptionPhone (string) •RoomList (ArrayList of HotelRoom's) hotel class should have a constructor that takes two parameters: Hotel name and reception phone. The necessary accessors (i.e. get methods) and mutators (i.e. set methods) for class variables: Hotel name only accessor Reception phone…