Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.twiejk;
- import java.util.Scanner;
- public class berekening {
- Scanner scanner = new Scanner(System.in);
- final double som = 1.41;
- double mof1;
- double mof2;
- double sprongMaat;
- public berekening (double mof1, double mof2, double sprongMaat){
- this.mof1 = mof1;
- this.mof2 = mof2;
- this.sprongMaat = sprongMaat;
- }
- public berekening () {
- System.out.println("Enter mof1:");
- this.mof1 = scanner.nextDouble();
- System.out.println("Enter mof2:");
- this.mof1 = scanner.nextDouble();
- System.out.println("Enter sprongMaat:");
- this.mof1 = scanner.nextDouble();
- }
- public double getMof1() {
- return mof1;
- }
- public double getMof2() {
- return mof2;
- }
- public double getSprongMaat(){
- return sprongMaat;
- }
- public double getResult(){
- double result = sprongMaat * som - (mof1 + mof2);
- return result;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement