Question: -What is the violated object-oriented concept? Fix the problem (not programmatically, you just need to explain how it can be fixed) 1. public class Position{

-What is the violated object-oriented concept? Fix the problem (not programmatically, you just need to explain how it can be fixed) 1. public class Position{ public double latitude; public double longitude; } public class PositionUtility { public static double distance( Position p1, Position p2 ) { // Calculate and return the distance //between the specified positions. } public static double heading(Position p1, Position p2 ) { // Calculate and return the heading // from position p1 to position p2 } }

2. class Flight { String flight_num; String destination; Date departure; Date arrival; String pilot; Flight [] pilot_scheduled_flights; ... }

3. class BankAccount{ String customer; int number; double balance; public BankAccount (String cust, double balance) { } void deposit (double amount){ balance+=amount; } void withdraw (double amount){ balance-=amount; } } class BankApp { pubic static void main (String[] args){ BankAccount acc1 = new BankAccount(toto, 123, 10000); //withdraw acc1.balance = Acc1.balance -100; } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!