Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

-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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Big Data With Hadoop MapReduce A Classroom Approach

Authors: Rathinaraja Jeyaraj ,Ganeshkumar Pugalendhi ,Anand Paul

1st Edition

1774634848, 978-1774634844

More Books

Students also viewed these Databases questions

Question

Understand the role of risk and uncertainty in insurance

Answered: 1 week ago

Question

Apply your own composing style to personalize your messages.

Answered: 1 week ago

Question

Format memos and e-mail properly.

Answered: 1 week ago