Advertisement
Guest User

Untitled

a guest
Apr 6th, 2020
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package com.twiejk;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class berekening {
  6.  
  7.     Scanner scanner = new Scanner(System.in);
  8.  
  9.     final double som = 1.41;
  10.     double mof1;
  11.     double mof2;
  12.     double sprongMaat;
  13.  
  14.  
  15.  
  16.     public berekening (double mof1, double mof2, double sprongMaat){
  17.         this.mof1 = mof1;
  18.         this.mof2 = mof2;
  19.         this.sprongMaat = sprongMaat;
  20.     }
  21.  
  22.     public berekening () {
  23.         System.out.println("Enter mof1:");  
  24.         this.mof1 = scanner.nextDouble();
  25.         System.out.println("Enter mof2:");  
  26.         this.mof1 = scanner.nextDouble();
  27.         System.out.println("Enter sprongMaat:");  
  28.         this.mof1 = scanner.nextDouble();
  29.     }
  30.  
  31.     public double getMof1() {
  32.         return mof1;
  33.     }
  34.  
  35.     public double getMof2() {
  36.         return mof2;
  37.     }
  38.  
  39.     public double getSprongMaat(){
  40.         return sprongMaat;
  41.     }
  42.  
  43.     public double getResult(){
  44.         double result = sprongMaat * som - (mof1 + mof2);
  45.         return result;
  46.     }
  47.  
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement