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
- 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).Design a class named Rectangle to represent a rectangle. The class must have the following: • double data fields named width and height. The default values are 1 for both width and height A no-argument constructor that creates a default bag. A constructor that creates a rectangle with the specified width and height A getParameter() method to return the perimeter. • A getArear() method to return the area of the Rectangle. Create two Rectangle objects. One with width 4.0 and height 10.0. The other object has width 6.3 and height 10.5.Design a class named MyInteger. The class contains: ■ An int data field named value that stores the int value represented by this object. ■ A constructor that creates a MyInteger object for the specified int value. ■ A get method that returns the int value. ■ The methods isEven(), isOdd(), and isPrime() that return true if the value in this object is even, odd, or prime, respectively. ■ The static methods isEven(int), isOdd(int), and isPrime(int) that return true if the specified value is even, odd, or prime, respectively. ■ The static methods isEven(MyInteger), isOdd(MyInteger), and isPrime(MyInteger) that return true if the specified value is even, odd, or prime, respectively. ■ The methods equals(int) and equals(MyInteger) that return true if the value in this object is equal to the specified value. ■ A static method parseInt(char[]) that converts an array of numeric characters to an int value. ■ A static method parseInt(String) that converts a string into an int value. Draw the UML…
- Design a class named MyPoint to represent a point withx- and y-coordinates. The class contains:■■ The data fields x and y that represent the coordinates with getter methods.■■ A no-arg constructor that creates a point (0, 0).■■ A constructor that constructs a point with specified coordinates.■■ A method named distance that returns the distance from this point to aspecified point of the MyPoint type.■■ A method named distance that returns the distance from this point toanother point with specified x- and y-coordinates.■■ A static method named distance that returns the distance from two MyPointobjects.Draw the UML diagram for the class then implement the class. Write a testprogram that creates the two points (0, 0) and (10, 30.5) and displays the distancebetween them.Design a class named StopWatch. The class contains:■ The private data fields startTime and endTime with get methods.■ A constructor that initializes startTime with the current time.■ A method named start() that resets the startTime to the current time.■ A method named stop() that sets the endTime to the current time.■ A method named getElapsedTime() that returns the elapsed time for thestop watch in milliseconds.Draw the UML diagram for the class, and then implement the class. Write a test program that measures the execution time of adding numbers from 1 to 1,000,000.Java - Constructors Create a class named Book that has the following attributes: Publisher - String Year Published - Integer Price - Double Title - String Create a constructor for the class Book that has the parameters from the attributes of the class. After, create a method for the class that displays all attributes. Ask the user for inputs for the attributes and use the constructor to create the object. Lastly, print the values of the attributes. Inputs 1. Publisher 2. Year Published 3. Price 4. Book Title XYZ Publishing 2020 1000.00 How to Win? Sample Output Published: ABC Publishing Year Published: 2022 Price: 150.00 Book Title: Stooping too low Stooping too low is published by ABC Publishing on 2022. It sells at the price of Php150.00.
- Design a class named Triangle that extends the GeometricObject class. The Triangle class contains:■ Three float data fields named side1, side2, and side3 to denote the threesides of the triangle.■ A constructor that creates a triangle with the specified side1, side2, andside3 with default values 1.0.■ The accessor methods for all three data fields.■ A method named getArea() that returns the area of this triangle.■ A method named getPerimeter() that returns the perimeter of this triangle.■ A method named _ _str_ _() that returns a string description for the triangle. For the formula to compute the area of a triangle, see Exercise 2.14. The_ _str_ _() method is implemented as follows:return "Triangle: side1 = " + str(side1) + " side2 = " +str(side2) + " side3 = " + str(side3)Draw the UML diagrams for the classes Triangle and GeometricObject.Implement the Triangle class. Write a test program that prompts the user to enter the three sides of the triangle, a color, and 1 or 0 to indicate…Design a class named MyInteger. The class contains:■■ An int data field named value that stores the int value represented bythis object.■■ A constructor that creates a MyInteger object for the specified int value.■■ A getter method that returns the int value.■■ The methods isEven(), isOdd(), and isPrime() that return true if thevalue in this object is even, odd, or prime, respectively.■■ The static methods isEven(int), isOdd(int), and isPrime(int) thatreturn true if the specified value is even, odd, or prime, respectively.■■ The static methods isEven(MyInteger), isOdd(MyInteger), andisPrime(MyInteger) that return true if the specified value is even, odd,or prime, respectively.■■ The methods equals(int) and equals(MyInteger) that return true ifthe value in this object is equal to the specified value.■■ A static method parseInt(char[]) that converts an array of numericcharactersto an int value.■■ A static method parseInt(String) that converts a string into an int value.Draw the UML…Design a class named CustomerRecord that holds a customer number, name, and address. Include separate methods to 'set' the value for each data field using the parameter being passed. Include separate methods to 'get' the value for each data field, i.e. "return" the field's value. Pseudocode:
- Design a class named StopWatch. The class contains:■■ Private data fields startTime and endTime with getter methods.■■ A no-arg constructor that initializes startTime with the current time.■■ A method named start() that resets the startTime to the current time.■■ A method named stop() that sets the endTime to the current time.■■ A method named getElapsedTime() that returns the elapsed time for thestopwatch in milliseconds.Draw the UML diagram for the class then implement the class. Write a test programthat measures the execution time of sorting 100,000 numbers using selection sort.mau Open Leathing inta... - The class has data members that can hold the name of your cube, length of one of the sides and the color of your cube. - The class has a constructor that accepts the name, length of one of the sides, and color as arguments and sets the data members to those values. - The class has the following methods to set the corresponding data member. setName(string newName) setSide(double newSide) setColor(string newColor) - The class has a method called getVolume() that returns the volume of the cube, calculated by cubing the length of the side. - The class has a method called volumelncrease(double newVolume) that receive the percent the volume should increase, and then the side to the corresponding value. i - For example, 2.5 indicates 2.5% increasing of the volume. So you take the current volume, increase it by 2.5%, and then find the cube root to calculate the new side length. You can use the built in function called cbrt, part of the math library, to find the cube…Create an automobile class that will be used by a dealership as a vehicle inventory program. The following attributes should be present in your automobile class: private string make private string model private string color private int year private int mileage Your program should have appropriate methods such as: default constructor parameterized constructor add a new vehicle method list vehicle information (return string array) remove a vehicle method update vehicle attributes method. All methods should include try..catch constructs. Except as noted all methods should return a success or failure message (failure message defined in "catch"). Create an additional class to call your automobile class (e.g., Main or AutomobileInventory). Include a try..catch construct and print it to the console. Call automobile class with parameterized constructor (e.g., "make, model, color, year, mileage"). Then call the method to list the values. Loop through the array and print to the screen.…