4.Design a class named Cylinder to represent a cylinder. Tw194164 Class contains: Two double data fields
Q: The following UML diagram indicates the different classes and the inheritance structure used. Using…
A: As per the question statement, It is asked to write JAVA code.
Q: Write an application that allows the user to view image files. The application should use either a…
A: Hi there, Please find your solution below, I hope you would found my solution useful. Thank you!
Q: We safeguard online communication. Data Networking protects packets throughout development (NON).…
A: In the context of the Next-Generation Network (NDN), data-centric protection refers to the…
Q: Give the output of the following java program code.
A: import java.awt.*; public class SimpleExample extends Frame{ SimpleExample(){ Button b =…
Q: The following function is intended to recursively determine if a string is a palindrome (the same…
A: def palindrome(the_string): if len(the_string)<=1: return True elif…
Q: GoGreen is a cash-only juice bar that sells a variety of organic prepared juice beverages. Tourists…
A: I attached your answer below.
Q: Procedure: 1. Write a simple information system that will store and display the complete information…
A: /here we have to use Inheritance to achieve this goal. //Create all classes in single package and…
Q: Design a JAVA GUI for a calculator which performs only multiplication and division functions. There…
A: The ask is to design a JAVA GUI for a calculator which performs only multiplication and division…
Q: Write a program that draws a summer scene using 4 of the 7 methods listed below. (Python)
A: The answer is given below.
Q: (Stopwatch) Design a class named StopWatch. The class contains: 1 Private data fields startTime and…
A: As per our company guidelines, we are supposed to answer only one question per post and kindly…
Q: Instructions Create a simple 5-question quiz with three (3) choices that will display the score of…
A: The ask is to write a Java Program using JDoodle to build a Quiz with following details: - Quiz…
Q: Test assertions in your java code.
A: The Assert class provides several functions to help you test the state of your program as it runs:
Q: JAVA CODE ONLY AND PROVIDE OUTPUT SCREENSHOT
A: I have provided JAVA CODE along with TWO OUTPUT SCREENSHOTS-----------------
Q: Design and implement a calculator using HTML, CSS (with Bootstrap) and JavaScript. The calculator…
A: HTML:- HTML stands for Hyper Text Markup Language Main structure of HTML CODE is as follows:…
Q: Write a program that draws a summer scene using 2 of the 4 methods listed below. (Python)
A: The answer is given below.
Q: Integer numLengths is read from input. Then, numLengths integers are read from input and inserted at…
A: Import necessary libraries:Import the Scanner class for input.Import the ArrayList class for…
Q: public class Holiday { //declaring variables private String name; private int day; private String…
A: Please find the answer below :
Q: Instructions: Using replit as compiler, kindly modify and execute the program. Don't forget to…
A: The java code of this program is implemented below:
Q: JAVA PROGRAM (SEE ATTACHED PHOTO FOR THE PROBLEM) What is the output of the program code? Use comma…
A:
Q: graphical interface that will convert infix to postfix expression.
A: We need to create the Java code to display a GUI and read in the infix expression and then compute…
Q: x4 x(2i) Formula 2: Cos (x) = 1 – 2! = E2o(-1)' (2i)! %3D - 4! 6! Notes: (COnSiudi an ait…
A: The question is to write the java code for the given problem.
Q: To utilize the Scanner class in JAVA, what statement you must put in your source code?
A: Find the statement to be put in the JAVA source code to utilize the Scanner class.
Q: create a trivia game menu. Include the following: 1. Background (using fractals and recursion)…
A: 1. **Design the GUI**: Use Swing or JavaFX to design the graphical user interface for the trivia…
Q: Define a method pyramidVolume with double parameters baseLength, baseWidth, and pyramid Height, that…
A: In this question we have to write a Java code for the given problem statement, we have to just…
Q: PART A The following UML diagram indicates the different classes and the inheritance structure used.…
A: Part A is answered in the following steps as per Expert Bartleby Guidelines. If you want the answers…
Q: 2. Write a class named MonthDays. The class's constructor should accept two arguments: • An integer…
A: Please check the solution below
Q: Create a Java program that asks the user to enter three (3) first names then display the following:…
A: Import required library files. The user is prompted to enter three first names. Based on the names…
Q: a you should choose a proper constructor 2. for this object of the Act a setting an initial value…
A: Here is the approach : Nothing new we have to do just follow the steps provided in the image .…
Q: Expected Output +""" [| o o |] | +-----+
A: We have to print a face in output using java programming
Q: 4.26 The cryptography function crypto() takes as input a string (i.e., the name of a file in the…
A: The cryptography function crypto() takes as input a string.The function should print the file on the…
Solve problem using Java code.
+Output screenshots.
Step by step
Solved in 3 steps with 1 images
- 2. The MyInteger Class Problem Description: Design a class named MyInteger. The class contains: n [] [] A private 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. Methods isEven () and isOdd () that return true if the value is even or odd respectively. Static methods isEven (int) and isOdd (int) that return true if the specified value is even or odd respectively. Static methods isEven (MyInteger) and isOdd (MyInteger) that return true if the specified value is even or odd respectively. Methods equals (int) and equals (MyInteger) that return true if the value in the object is equal to the specified value. Implement the class. Write a client program that tests all methods in the class.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 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.
- 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…1. Create the main method using pythone to test the classes. #Create the class personTypefrom matplotlib.pyplot import phase_spectrum class personType: #create the class constructor def __init__(self,fName,lName): #Initialize the data members self.fName = fName self.lName = lName #Method to access def getFName(self): return self.fName def getLName(self): return self.lName #Method to manipulate the data members def setFName(self,fName): self.fName = fName def setLName(self,lName): self.lName = lName #Create the class Doctor Type inherit from personTypeclass doctorType(personType): #Create the constructor for the doctorType class def __init__(self, fName, lName,speciality="unknown"): super().__init__(fName, lName) self.speciality = speciality #Methods to access def getSpeciality(self): return self.speciality #Methods to manipulate def setSpeciality(self,spc):…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…
- Part A Create a FitnessTracker class that includes three data fields for a fitness activity: a String for the name of the activity as activity, an int for the number of minutes spent participating as minutes, and a LocalDate for the date as date. Create a default constructor that automatically sets the activity to running, the minutes to 0, and the date to January 1 of the current year. Overload the constructor so it receives parameters for each of the fields and assigns them appropriately. Includes methods to get each data field. Part B Create an application that instantiates two FitnessTracker objects. Prompt the user for values for one object, and pass those values to the three constructor parameters. Retain the default constructor values for the other object. Display the values for each object. An example of the program is shown below: Enter activity >> swimming Enter minutes spent swimming >> 90 Enter month >> 2 Enter day >> 24 Enter year >> 2021…Part A Create a FitnessTracker class that includes three data fields for a fitness activity: a String for the name of the activity as activity, an int for the number of minutes spent participating as minutes, and a LocalDate for the date as date. Create a default constructor that automatically sets the activity to running, the minutes to 0, and the date to January 1 of the current year. Overload the constructor so it receives parameters for each of the fields and assigns them appropriately. Includes methods to get each data field. Part B Create an application that instantiates two FitnessTracker objects. Prompt the user for values for one object, and pass those values to the three constructor parameters. Retain the default constructor values for the other object. Display the values for each object. An example of the program is shown below: Enter activity >> swimming Enter minutes spent swimming >> 90 Enter month >> 2 Enter day >> 24 Enter year >> 2021…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. Methods isEven(), isOdd(), and isPrime() that return true if the value is even, odd, or prime, respectively. Static methods is Even(MyInteger), is Odd(MyInteger), and isPrime(MyInteger) that return true if the specified value is even, odd, or prime, respectively. Methods equals(int) and equals(MyInteger) that return true if the value in the object is equal to the specified value.
- Make C# (Sharp): console project named MyPlayList. Create an Album class with 4 fields to keep track of title, artist, genre, and copies sold. Each field should have a get/set property. Your Album class should have a constructor to initialize the title (other 3 variables should default to null or 0). In addition, create a public method in the Album class to calculate amount sold for the album (copies sold * cost_of_album). You determine the cost of each album. Also create a method in the Album class to display the information. Print out of information should look something like this: The album Tattoo You by the Rolling Stones, a Rock group, made $25,000,000. In the main method, create 3 instances of the Album class with different albums, use setters to set values of the artist, genre, and copies sold. And then use getters to display information about each on the console.Create a RightTriangle class given the following design: RightTriangle variables: base, height methods: 2 constructors, 1 that set default values and another that accepts to parameters. setBase - changes the base. Requires one parameter for base. setHeight - changes the height. Requires one parameter for height. getBase - returns the triangle base. getHeight - returns the triangle height. area - returns the area of the triangle (1/2bh) given the current base and heightAttached you will find a Java class called Employee. This class includes a constructor which sets name to blanks and salary to $0.00 and a constructor which sets name to a starting name and salary to a set amount. Additionally, the class includes methods to set the name and salary and return the name and salary. You will create a new class called Manager that inherits from the attached class Employee. Add a field named department of type String. Create a get and set method for the department variable. Supply a method toString that prints the manager's name, department, and salary. But you may not change anything in the Employee class. You will then create a test class that uses the Manager class. The test class should prompt the user to enter name, department and salary. This information should be stored in an array. Upon entry of an employee records, the program should output the information you entered.