1 using static System.Console; 2 class ShapesDemo 3 { static void Main() { // Your code here } 8 } Create a Rectangle is a GeometricFigure 4 whose area is determined by multiplying width by height. 7 Create a Square is a Rectangle in which the width and height are the same. Provide a constructor that accepts both height and width, forcing them to be equal if they are not. Provide a second constructor that accepts just one dimension and uses it for both height and width. The Square class uses the Rectangle 's ComputeArea() method. Create a Triangle is a GeometricFigure whose area is determined by multiplying the width by half the height. In the ShapesDemo class, after each object is created, pass it to a method that accepts a GeometricFigure argument in which the figure's data is displayed. Change some dimensions of some of the figures, and pass each to the display bod ognin
Q: Define a class named Customer with four private attributes: CustomerName: 15-character c-string…
A: class Customer { public static void main (String [] args) Scanner sc = new Scanner (System.in);…
Q: In Java Programming, 2 class needs a no-arg constructor and a constructor that initializes all…
A: Programming instructions: Create a class Employee and ProductionWorker which extends Employee…
Q: Create a class car with make, model, year, OwnerName, RegisNo, Insurers as private fields. Create…
A: We have to define a class Car and it's data member and member functions.
Q: QUESTION 1 PROBLEM: Consider the elevator in the Faculty of Engineering (5 storey). Write a program…
A: Class is a custom user-defined data type that encapsulates the data members and member functions…
Q: Create a simple C++ program with the 3 following classes. Use separate header and source files for…
A: main.cpp:#include "PlayerClass.h"#include <iostream>using namespace std;/*This is the main…
Q: Create another C++ class and call it Car. The Car class inherits form Vehicle class and has another…
A: #include <iostream>using namespace std; // to convert int to stringstring toString(int num){…
Q: Analyse the following code. public class Test { int x; public Test(String t) {…
A: Given: Analyse the following code. public class Test { int x; public Test(String t) {…
Q: Create a class named Employee with two variables Name,Salary and a method named Employee…
A: A class can be denoted as a unit that consists of data and functions, in a single unit. It acts as a…
Q: A) Your class should support the following functions: Constructor which takes: Type, Manufacture…
A: Summary: In this question, we need to create a constructor and driver program to perform the given…
Q: 32.5 QUESTION 3 Create an object called Circle. Declare the following integer variables for the…
A: Solution: Create a class Circle and declare the variables radius,diameter as integer types and pi…
Q: answer the following question by writing a python code: 5- Create the “Testing” file that does the…
A: Algorithm: Start Copy and paste the given code Then in the main method, create objects of…
Q: reate a class called Point which will have 2 co-ordinate value x & y and will be able to calculate…
A: class Point { double x,y; Point(double a,double b) { x=a;y=b; } double dist(Point ob) { return…
Q: // Creates a Breakfast class // and instantiates an object // Displays Breakfast special information…
A: Given Program: using System;using static System.Console;using System.Globalization;class DebugNine2{…
Q: 4. Define the Circle2D class that contains: > Two double data fields named x and y that specify the…
A: Program:…
Q: The classes DateInfo and Student in different packages 1. Create two packages, calendar, and…
A: The classes DateInfo and Student in different packages 1. Create two packages, calendar, and…
Q: 1. The Rockford Daily Clarion wants you to design a class named Issue. Fields include the issue…
A: ANSWER:-
Q: Create a class called Complex for performing arithmetic with complex numbers. Write a program to…
A: The solution as given below steps :
Q: Create a class Employee that has a field for storing the complete name of the employee (first and…
A: Create a class Employee that has a field for storing the complete name of the employee (firstand…
Q: Use Java Programming Language Please Provide a Code that works Properly Loan Account Class:…
A: The asked code for the Java program has been provided in the next step.
Q: Create an abstract class named Book. Include a String field for the book’s title and a double field…
A: Note: In the question, there are two classes are provided with the "main()" function. In the below…
Q: Create a program that invokes static methods and uses static variables. Procedure: 1. Develop a…
A: SavingsAccount.java RunSavingsAccount.java
Q: (b) Create a class car with make, model, year, OwnerName, RegisNo, Insurers as private fields.…
A: Find Source Code for program in step 2
Q: 2. Design a class named Aquarium that has As data fields Three double data fields length, width, and…
A: First of all, we need to define the Fish class in which name attribute is define and that be…
Q: Create a class called Point which will have 2 co-ordinate value x & y and will be able to calculate…
A: Given: Create a class called Point which will have 2 co-ordinate value x & y and will be able…
Q: Consider class Shape which is inherited by three classes Triangle, Circle and Square. Class Shape…
A: In this program we need to create 4 classes/ Shape: In shape class constructor will be able to find…
Q: Create a class called Point which will have 2 co-ordinate value x & y and will be able to calculate…
A: Write the C++ code as follows: Define the class Point with two data members representing coordinate…
Q: Write a program that has a base class named FlightCrew. This class should have three data members:…
A: Summary: In this question, using the class concept in C++ we need to generate a bonus amount for…
Q: 2. Create a class that will convert a dollar to peso, the class must accept 1 value as arguments,…
A:
Q: In this exercise, you have to create a class called Point which can calculate distance between two…
A: Here I ahve copied the code from the question and defined the methods and constructor to produce the…
Q: Consider class Shape which is inherited by three classes Triangle, Circle and Square. Class Shape…
A: answer in step 2
Q: Design a class named a Rectangle to represent a rectangle. The class should contain the following:…
A: Solution - Programming language - Java All solution steps are included in program code as comments.…
Q: A. Write a Java Program that includes the following details You are tasked to develop a program to…
A: public class Hospital{ //declare the member variables private int hospitalId; private…
Q: The following is to be completed using C#. Create a class named Square that contains a field for the…
A: Actually, the code has given below:
Q: Create a class called Point which will have 2 co-ordinate value x & y and will be able to calculate…
A: The ask is to do the following: - Create a class Point with 2 coordinates x and y. - Calculate the…
Q: Question 1 ( Java Programming) 1. Create a class called Parents with private variables of type…
A: import java.util.Scanner; //1. Create a class called Parentsclass Parents { private String…
Q: Using Java Create a constructor named Exam that assigns "Good luck" to a previously declared String…
A: Note: As per company guidelines, only the first three parts are solved. Kindly send the remaining…
Q: Define a class Student to create Student Objects. The class defines two variables for its objects:…
A: Code in Java: import java.util.*; class Student{ //instance variables name and avg(Average)…
Q: Public class secret private int x; private static int y; public static int count; public int z;…
A: Dear learner, hope you are doing well, I will try my best to answer this question. Thank You!!
Q: class gene { public: gene( ); gene(string n, string cl); string get_genename( ); //required…
A: (a) class gene{ public: gene() { name=""; chromosomal_location=""; }…
Q: 5. Design a class named Person and its two subclasses named Student and Employee and Faculty and…
A: As per bartleby guidelines for more, than one question only 1st one is to be answered. Please upload…
Q: assenger p, Seat s, double price) Before you create the Ticket object: i. Use the wizard to generate…
A: PassengerName.java //PassengerName Class to be used as parameter for Passenger Class public class…
Q: USE JAVA LANGUAGE Create a constructor named Exam that assigns "Good luck" to a previously declared…
A: Note :- As per our company guidelines we are supposed to answer ?️only first 3 sub-parts. Kindly…
Q: Derive the class ExtClock from the class Clock by adding a data member to store the time zone. Add…
A: public class Main{ public static void main(String[] args) { ExtClock c1=new ExtClock(); //create…
Q: Create a class called Rational for performing arithmetic with fractions. Write a program to test…
A: Java Code : import java.util.Scanner; class Rational { private int numerator; private int…
Q: 1. Create a class called House which has the following members- Private - no_of_room,…
A: Start Create a class name "House" declare private variable inside class and its getters and setters…
Q: 1 using static System.Console; 2 class ShapesDemo 3 { static void Main() { abstract class…
A: Netezza is the appliance of IBM, whereas it is not used in big data to provide high storage; it is…
Q: Define a class named Money that stores a monetary amount. The class should have two private integer…
A: C++ allows organizing the data member and member functions that work on that data in such a way that…
Q: The surface area and volume of a sphere are given by following formulas, where R is the Sphere's…
A: Answer: Java Source Code: import java.util.*;import java.lang.*;import java.io.FileWriter; import…
Q: Consider the following class: 1.Write its default constructor 2.Write a code to declare an object…
A: 1. Default constructor A default constructor is an empty constructor. Here, the class name is Dog.…
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 2 images
- TODO 2 Complete the TODO by finding the locations of the data samples for each iris flower type. Hint: Use the code for how we found all the setosa_locs as an example! Using iris_df, find the location of all the data sample locations for the versicolor class which has a label of 1. To do so, use NumPy's np.where() function. Using iris_df, find the location of all the data sample locations for the virginica class which has a label of 2. To do so, use NumPy's np.where() function. setosa_locs = np.where(iris_df['class'] == 0)[0] # TODO 2.1versicolor_locs = # TODO 2.2virginica_locs = todo_check([ (type(versicolor_locs) is np.ndarray, "'versicolor_locs' is not type np.ndarray. Make sure you indexed np.where() currently!"), (type(virginica_locs) is np.ndarray, "'virginica_locs' is not type np.ndarray. Make sure you indexed np.where() currently!"), (versicolor_locs[0] == 50, "'versicolor_locs' has an incorrect value"), (virginica_locs[0] == 100, "'virginica_locs' has an…Using Java ((Abstract Class and Interface)) 13.11 (The Octagon class)) Write a class named Octagon that extends faces. Assume that all eight sides of the Comparableand Cloneable inter-be computed useing the fllowing formula : area =(2 + 4 / square root of 2)* side * side Draw the UML diagram that involves Octagon, GeomtricObject,Comparable and Cloneable. Write a test program that create a new Object using the clone method and comoare the two object using the compareTo method.in the image below the Red "X" denotes the horse has fallen While the Race class is almost complete, it still contains some errors that need attention: import java.util.concurrent.TimeUnit;import java.lang.Math; /** * A three-horse race, each horse running in its own lane * for a given distance * * @author McFarewell * @version 1.0 */public class Race { private int raceLength; private Horse lane1Horse; private Horse lane2Horse; private Horse lane3Horse; public Race(int distance) { raceLength = distance; lane1Horse = null; lane2Horse = null; lane3Horse = null; } public void addHorse(Horse theHorse, int laneNumber) { if (laneNumber == 1) { lane1Horse = theHorse; } else if (laneNumber == 2) { lane2Horse = theHorse; } else if (laneNumber == 3) { lane3Horse = theHorse; } else { System.out.println("Cannot add horse to lane " + laneNumber + " because there is no such…
- This question involves the design of a class that will be used to produce practice problems. The following StudyPracticeinterface represents practice problems that can be used to study some subject. public interface StudyPractice. { /**Returns the current practive problem */ String getProblem(); /** Changes to the next practice problem */ void nextProblem(); } The MultPractice class is a StudyPracticethat produces multiplication practice problems. A MultPractice object is constructed with two integer values: first integer and initial second integer. The first integer is a value that remains constant and is used as the first integer in every practice problem. The initial second integer is used as the starting value for the second integer in the practice problems. This second value is incremented for each additional practice problem that is produced by the class. For example, a MultPractice object created with the call new MultPractice (7, 3)would be used to create the practice…Write a c++ oop code following these instructions only. Class Scene: capture_date : int draw() : void // Abstract method Class Landscape: area : double render(): void Class FlightSimulator: It has aggregation relationship with abstract class Redefine draw() function that has only a print statement of “Drawing Scene”. Class MountainScene: Call render function of Landscape as mentioned in diagram. (a) Add a function getArea() in 'Scene' class. Class Scene: capture_date : int draw() : void // Abstract method getArea() : string // Displays 'Area of Scene' Class CityScene: draw() : void getArea() : string // Displays 'Area of City Scene' Class MountainScene: draw() : void getArea() : string // Displays 'Area of Mountain Scene' (b) 1- Create a pointer of Scene class 2- Assign object of MountainScene class to the pointer created in part 1 3- Call getArea() through the pointer 4- Report the output you get in part 3ONLY PYTHON CODE! Crops grow only when the Nitrogen is within a particular range. Construct a crop class that will take the name of a crop, its lower Nitrogen value, and its higher Nitrogen value: Raspberry – Nitrogen content b/n 1 and 3 Apple – Nitrogen content b/n 1 and 4 Squash – Nitrogen content b/n 2.5 and 4 Pumpkin – Nitrogen content b/n 3 and 5 Onion – Nitrogen content b/n 2.5 and 5 Create 4 fields of farm land: f1, f2, f3, and f4, using Python classes that have a Nitrogen content of 1, 2, 3, and 4 respectively. Then, create a function in the field code that will take a crop and return if it will be able to grow in the field or not. Create a list for each crop that tells the farmer which plot they could plant the crop in. Ouput: Raspberry can be planted in f1 Raspberry can be planted in f2 Raspberry can be planted in f3 Apple can be planted in f1 Apple can be planted in f2 Apple can be planted in f3 Apple can be planted in f4 Squash can be planted in f3 Squash can be planted…
- This is the question - Create an abstract NewspaperSubscription class with fields for the subscriber name, address, and rate. Include get and set methods for the name field and get methods for the address and subscription rate; the setAddress() method is abstract. Create two subclasses named PhysicalNewspaperSubscription and OnlineNewspaperSubscription. The parameter for the setAddress() method of the PhysicalNewspaperSubscription class must contain at least one digit; otherwise, an error message is displayed and the subscription rate is set to 0. If the address is valid, the subscription rate is assigned $15. The parameter for the setAddress() method of the OnlineNewspaperSubscription class must contain an at sign (@) or an error message is displayed. If the address is valid, the subscription rate is assigned $9. Code I was given - public class DemoSubscriptions { public static void main(String args[]) { PhysicalNewspaperSubscription pnsGood = new…Please help with this problem ASAP! Create a class definition named Substance that can set and read the Substance’s name andmass (in kilograms) and compare 2 Substance objects with the less_than function. Create aclass definition named Fluid that inherits Substance and can set and get the Fluid’s viscosity(how thick it is) from 0.0 to 1.0. Then create an Ink class definition and implementationwhich inherits Fluid and can set and get the Ink’s color (red 00-FF, green 00-FF, blue 00-FF)as a HEX triplet string. A passed color should be validated; it must be 6 characters long andonly contain the “0123456789ABCDEF” characters.help me asap within 30 min plz use python Design TomCruise class and DulquerSalman class which inherit from Actor class so that the following code provides the expected output.You can not change any of the given code. Do not modify the given parent class.Note: add_movie() method in both child classes should work for any number of parameters and assume parameters will be even numbers.class Actor: def __init__(self, name, rating, industry): self.name = name self.rating = rating self.industry = industry def add_movie(self, *info): pass def __str__(self): s = f"Name: {self.name}\nRating: {self.rating}\nIndustry: {self.industry}" return s# Write your codes here.tom_cruise = TomCruise("Tom Cruise", 9.5, "Hollywood", 0)tom_cruise.add_movie("Knight & Day", "Action", "Top Gun", "Action", "Jerry Maguire", "Romance", "Jack Reacher", "Thriller", "The Firm",…
- Create an abstract NewspaperSubscription class with fields for the subscriber name, address, and rate. Include get and set methods for the name field and get methods for the address and subscription rate; the setAddress() method is abstract. Create two subclasses named PhysicalNewspaperSubscription and OnlineNewspaperSubscription. The parameter for the setAddress() method of the PhysicalNewspaperSubscription class must contain at least one digit; otherwise, an error message is displayed and the subscription rate is set to 0. If the address is valid, the subscription rate is assigned $15. The parameter for the setAddress() method of the OnlineNewspaperSubscription class must contain an at sign (@) or an error message is displayed. If the address is valid, the subscription rate is assigned $9. Finally, write an application that declares several objects of both subscription subtypes and displays their data fieldsc# programMake a class called Employees, with attributes Name, Gender, Experience, Salary and ID.Make a delegate called EligiblePromo. This delegate takes an employees object as a parameter and returns a boolean value indication whether or not the employee should be promoted.Make a PromoteEmployee() method that takes an arraylist of Employees and delegate of type EligiblePromo as parametersNB: PromoteEmployee() methos loops through each Employees object and passes it to the delegate(25)JAVA PROGRAM ASAP *********** THIS PROGRAM MUST WORK IN HYPERGRADE AND PASS ALL THE TEST CASES. Please create a program BECAUSE IT IS. MY HOMEWORK ASSIGNMENT with the following parts which are down below: The left index is inclusive and the right index is exclusive. 1. public static void bubbleSort(int[] array, int left, int right) { // your code here } 2. public static void insertionSort(int[] array, int left, int right) { // your code here } 3. public static void selectionSort(int[] array, int left, int right) { // your code here } Test Case 1 Please enter a space separated list of numbers to sort or type QUIT to exit:\n4 3 2 1ENTERSorting first half of the array using Bubble Sort algorithm:\n3 4 2 1\nSorting second half of the array using Bubble Sort algorithm:\n4 3 1 2\nSorting the array using Bubble Sort algorithm:\n1 2 3 4\nSorting first half of the array using Insertion Sort algorithm:\n3 4 2 1\nSorting second half of the array using Insertion…