Advertisement
avidris02

Prisma

Sep 27th, 2022 (edited)
753
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.68 KB | Source Code | 0 0
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6. package mainmenu;
  7.  
  8. /**
  9.  *
  10.  * @author Rae
  11.  */
  12. public class Prisma {
  13.     Segitiga sg = new Segitiga();
  14.     double tinggiP, volume;
  15.     public void setAlas(float a) {
  16.         sg.alas = a;
  17.     }
  18.     public void setTinggiS(float t) {
  19.         sg.tinggi = t;
  20.     }
  21.     public void setTinggiP(float tp) {
  22.         tinggiP = tp;
  23.     }
  24.     public void setVolume() {
  25.         volume = (1d/2 * sg.alas * sg.tinggi) * tinggiP;
  26.     }
  27.     public double getVolume()
  28.     {
  29.         return volume;
  30.     }
  31. }
  32.  
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement