Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Matthew Chapman
- //COMP101 Assignment 3
- //import scanner
- import java.util.Scanner;
- //Define class
- public class FlatLand{
- //define attributes
- private double x1;
- private double x2;
- private double y1;
- private double y2;
- //constructor
- public FlatLand(double x1, double x2, double y1, double y2){
- x1 = x1;
- x2 = x2;
- y1 = y1;
- y2 = y2;
- }
- public static double dist (){
- public double p = 1; /*error occurs here "illegal start of expression/*
- return((Math.pow((Math.pow((x1-y1),p))-(Math.pow((x2-y2),p)),(1/p))));
- }
- public static double distcheb (){
- return(Math.max((Math.abs(x1-y1)),(Math.abs(x2-y2))));
- }
- }
Add Comment
Please, Sign In to add comment