Computer Networking: A Top-Down Approach (7th Edition)
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
Bartleby Related Questions Icon

Related questions

Question

Java: Abstraction using Interface

6:30 O
artner and do this aa a O
ul 59
Create a program that will String input.
Based on the number of inputs, the
program will decide what shape it is. (1
input
rectangle, 3 inputs - triangle). The program
will then display the shape type, details,
circle, 2 inputs
square or
-
-
perimeter and area.
Justines-MacBook-Pro:classes Justines java -jar Shape.jar 15
Type: Circle
Radius: 15
Perimeter: 94.2
Area: 706.5
Justines-MacBook-Pro:classes Justines java -jar Shape.jar 1z 24
Type: Rectangle
Length: 24
Width: 12
Perimeter: 72.0
Area: 288.0
Justines-MacBook-Pro:classes Justines java -jar Shape.jar 1z 12
Type: Square
Side: 12
Perimeter: 48.0
Area: 144.0
Justines-MacBook-Pro:classes Justines java -jar Shape.jar 9 15 12
Type: Triangle
Sides: 9, 15, 12
Perimeter: 36.0
Area: 54.0
Justines-MacBook-Pro:classes Justines java -jar Shape.jar 9 15 12 8
Invalid input
Java File Layout
Shape/
E classes
E Circle.class
E Rectangle.class
E Shape.class
E Shape.jar
Square.class
E TestShape.class
E Triangle.class
- mani fest.txt
- src
E Circle.java
E Rectangle. java
E Shape.java
E Square.java
E
TestShape. java
- Triangle.java
2 directories, 14 files
UML Diagrams
Shape (interface)
+ getPerimeter() : double
+ getArea() : double
+ getDetails() : void
Circle limnlements Shane)
Triangle (implements Shape)
expand button
Transcribed Image Text:6:30 O artner and do this aa a O ul 59 Create a program that will String input. Based on the number of inputs, the program will decide what shape it is. (1 input rectangle, 3 inputs - triangle). The program will then display the shape type, details, circle, 2 inputs square or - - perimeter and area. Justines-MacBook-Pro:classes Justines java -jar Shape.jar 15 Type: Circle Radius: 15 Perimeter: 94.2 Area: 706.5 Justines-MacBook-Pro:classes Justines java -jar Shape.jar 1z 24 Type: Rectangle Length: 24 Width: 12 Perimeter: 72.0 Area: 288.0 Justines-MacBook-Pro:classes Justines java -jar Shape.jar 1z 12 Type: Square Side: 12 Perimeter: 48.0 Area: 144.0 Justines-MacBook-Pro:classes Justines java -jar Shape.jar 9 15 12 Type: Triangle Sides: 9, 15, 12 Perimeter: 36.0 Area: 54.0 Justines-MacBook-Pro:classes Justines java -jar Shape.jar 9 15 12 8 Invalid input Java File Layout Shape/ E classes E Circle.class E Rectangle.class E Shape.class E Shape.jar Square.class E TestShape.class E Triangle.class - mani fest.txt - src E Circle.java E Rectangle. java E Shape.java E Square.java E TestShape. java - Triangle.java 2 directories, 14 files UML Diagrams Shape (interface) + getPerimeter() : double + getArea() : double + getDetails() : void Circle limnlements Shane) Triangle (implements Shape)
UML Diagrams
Shape (interface)
+ getPerimeter() : double
+ getArea() : double
+ getDetails() : void
Triangle (implements Shape)
Circle (implements Shape)
- sideA :int
- sideb :int
- sidec :int
PI : float (final - 3.14)
radius: int
Rectangle (implements Shape)
Square (implements Shape)
- length : int
- width : int is greater than width)
(note that length
- side : int
expand button
Transcribed Image Text:UML Diagrams Shape (interface) + getPerimeter() : double + getArea() : double + getDetails() : void Triangle (implements Shape) Circle (implements Shape) - sideA :int - sideb :int - sidec :int PI : float (final - 3.14) radius: int Rectangle (implements Shape) Square (implements Shape) - length : int - width : int is greater than width) (note that length - side : int
Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Recommended textbooks for you
Text book image
Computer Networking: A Top-Down Approach (7th Edi...
Computer Engineering
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:PEARSON
Text book image
Computer Organization and Design MIPS Edition, Fi...
Computer Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science
Text book image
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:9781337569330
Author:Jill West, Tamara Dean, Jean Andrews
Publisher:Cengage Learning
Text book image
Concepts of Database Management
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning
Text book image
Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education
Text book image
Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY