Sei sulla pagina 1di 3

170220 FM-BINUS-AA-FPT-66/R7

Practicum Case
COMP6153
Operating System
Computer Science O181-COMP6153-GA01-04

Valid on Even Semester Year 2019/2020 Revision 00

Learning Outcomes
 Demonstrate the skills in programming to write user programs to interact with the operating system
Topic
 Java Programming 2
Sub Topics
 OOP Concept
 Inheritance
 Polymorphism
Soal
Case
LINK
https://drive.google.com/drive/folders/1HsGaSU4fRknJLfao2t6v3fNfM2lfttIh

Shape Manager

You are asked to build an Object Oriented application for calculate shape called Shape
manager. You are assigned to make a program with description below:

 Show current shape and application menu that consists of:


1. Create Shape
2. Calculate Area
3. Calculate Circumference
4. Exit

Halaman : 1 dari 3
Page 1 of 3
170220 FM-BINUS-AA-FPT-66/R7

Figure 1. Screenshot of Menu

 If user chooses Create Shape (Menu 1):


o Ask user to input shape to be created. Validate shape must be “Square”, “Triangle”,
or “Circle”.

Figure 2. Screenshot of Input Shape

o Then ask user to input the shape’s attribute according to the chosen shape, validate
each attribute must be between 1 and 100:
Shape Attribute
Square Side
Triangle Base, Height
Circle Diameter

Figure 3. Screenshot of View Current Shape

Halaman : 2 dari 3
Page 2 of 3
170220 FM-BINUS-AA-FPT-66/R7

o After user fulfills all validations, the shape will created and shown in main menu.

 If user chooses Calculate Area (Menu 2):


o The application will calculate the shape’s area with the following formula:
Shape Area
Square Side²
Triangle Base x Height x 0.5
Circle Π x (Diameter x 0.5)²

Figure 4. Screenshot of Calculate Shape Area

 If user chooses Calculate Circumference (Menu 3):


o The application will calculate the shape’s circumference with the following formula:
Shape Circumference
Square Side x 4
Triangle Base + (Side x 2)
Circle Π x Diameter

Figure 5. Screenshot of Calculate Shape Circumference

o If user’s current shape is Triangle, the program needs to count the side first with the
following formula:

Side = √ (Base * 0.5)² + Height²

 If user chooses Exit (Menu 4), the program will exit.

If you do not understand, please ask your assistant!

Halaman : 3 dari 3
Page 3 of 3

Potrebbero piacerti anche