Need Help a Intro to Java Programming assignment
Design a Area class that has three overloaded static methods areaComputing to calculate the areas of circles, rectangles, and cylinders. Assume that data for circles and cylinders are all doubles and data for rectangles are integers. Code a test program AreaApp by creating at least two objects for each geometric shapes with different hard coded data at your choice for testing.
Answer : please up vote or comment for any query i will update the same .Thanks
Note : - check output images
Program :
Area Class :- Define and declare three areaComputing function to calculate area of rectangle,circle,cylinders
AreaApp main class : -which have main method to call function of Area class
Program : Area.java
class Area
{ //over loading function should have same return
type
public static double areaComputing(double Radius)
//Area of Circle
{
double Area=3.14*Radius*Radius; //pi*RadiusRadius
return Area;
}
public static double areaComputing(int a ,int b) //area of
rectangle
{
return a*b;
}
public static double areaComputing(double height
,double radius) //area of cylinder 2*pi*r*(r+h) total surface
area
{
double
Area=2*3.14*radius*(height+radius);
return Area;
}
}
AreaApp.java
class AreaApp //main class
{
public static void main(String args[])
{
Area A=new Area(); //first
object
Area B=new Area(); //second
objet
System.out.println(A.areaComputing(1.32));
System.out.println(A.areaComputing(10,20));
System.out.println(A.areaComputing(10.1,20.9));
System.out.println(B.areaComputing(1.32));
System.out.println(B.areaComputing(10,20));
System.out.println(B.areaComputing(10.1,20.9));
}
}
Output

Need Help a Intro to Java Programming assignment Design a Area class that has three overloaded...
Java... Write a class that has three overloaded static methods for calculating the areas of the following geometric shapes: • circles -- area = π*radius^2 (format the answer to have two decimal places) • rectangles -- area = width * length • trapezoid -- area = (base1 + base2) * height/2 Because the three methods are to be overloaded, they should each have the same name, but different parameters (for example, the method to be used with circles should only...
Can you please pick Automobile For this assignment. Java Programming Second Inheritance OOP assignment Outcome: Student will demonstrate the ability to use inheritance in Java programs. Program Specifications: Programming assignment: Classes and Inheritance You are to pick your own theme for a new Parent class. You can pick from one of the following: Person Automobile Animal Based on your choice: If you choose Person, you will create a subclass of Person called Student. If you choose Automobile, you will create...
I need some help with programming this assignment.
Programming Assignment 6: A Python Class, Attributes, Methods, and Objects Obiectives .Be able to write a Python class Be able to define class attributes Be able to define class methods .Be able to process input from a text file .Be able to write an application using objects The goal of this programming assignment is to develop a simple image processing application. The application will import a class that creates image objects with...
Hi I need help creating a program in JAVA. This is material from chapter 9 Objects and Classes from the Intro to JAVA textbook. Mrs. Quackenbush's Rent-A-Wreck car rental ..... Mrs. Q asked you to create a program that can help her track her growing fleet of junkers. Of course she expects you to use your best programming skills, including: 1. Plan and design what attributes/actions an automobile in a rental fleet should have (example. Track number of Trucks, SUVs,...
java. do it on eclipse. the same way its instructed Second Inheritance OOP assignment Outcome: Student will demonstrate the ability to understand inheritance Program Specifications: Programming assignment: Classes and Inheritance You are to pick your own theme for a new Parent class. You can pick from one of the following: Person Automobile Animal If you choose Person, you will create a subclass of Person called Student. If you choose Automobile, you will create a...
this is for java programming Please Use Comments I am not 100% sure if my code needs work, this code is for the geometric if you feel like you need to edit it please do :) Problem Description: Modify the GeometricObject class to implement the Comparable interface and define a static max method in the GeometricObject class for finding the larger (in area) of two GeometricObject objects. Draw the UML and implement the new GeometricObject class and its two subclasses...
Part 1: Use principles of inheritance to write code calculating the area, surface area, and volume of rectangular objects. First, write an abstract super class RectangularShape, then write a subclass Rectangle that inherits from the super class to compute areas of rectangles, including squares if there is only one data. Finally, write another subclass Cuboid that inherits from its super class Rectangle above to compute surface areas and volumes of cuboids, including 3 equal sided cube. Must apply code-reusability in...
****Here is the assignment **** Purpose: To write an Object-Oriented application that creates a Java class with several instance variables, a constructor to initialize the instance variables, several methods to access and update the instance variables’ values, along with other methods to perform calculations. Also, write a test class that instantiates the first class and tests the class’s constructor and methods. Details: Create a class called Rectangle containing the following: Two instance variables, An instance variable of type double used...
JAVA :The following are descriptions of classes that you will create. Think of these as service providers. They provide a service to who ever want to use them. You will also write a TestClass with a main() method that fully exercises the classes that you create. To exercise a class, make some instances of the class, and call the methods of the class using these objects. Paste in the output from the test program that demonstrates your classes’ functionality. Testing...
Java Programming Assignment
Write a class named 2DArrayOperations with the following static
methods:
getTotal . This method should accept a
two-dimensional array as its argument and return the total of all
the values in the array. Write overloaded versions of this method
that work with int , double , and long arrays.
(A)
getAverage . This method should accept a
two-dimensional array as its argument and return the average of all
the values in the array. Write overloaded versions of...