Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need your help please it's urgent and very important for me and I don't have enough time please please it's JAVA I need please

I need your help please it's urgent and very important for me and I don't have enough time please please it's JAVA I need please the correct answers with the output thank you in advance for helping me thanks a lot .

1. Write a program to calculate the midpoint of two 2D coordinate points. (1) Among them, the Point class represents two-dimensional coordinate points, and has private member variables x and y, representing the values of the abscissa and ordinate, initialized by the constructor. (2) Four methods setX (), getX (), sexY (), getY () are used to set and obtain the coordinates. In addition, a member method midPoint (Point p), which takes a Point object as a parameter, calculates the midpoint of the two coordinates, and returns a new two-dimensional point. It is required to reflect the encapsulation characteristics in the program. Instantiate two two-dimensional points (4, 5) and (6, 8) in the main function of the class Test. Calculate the midpoint of the two by calling the midPoint of one of them and return a new two-dimensional point, and outputs the x and y of the new point. ==============={{ 2. Write the following method that returns true if the list is already sorted in increasing order. public static boolean isSorted(int[] list) Write a test program that prompts the user to enter a list and displays whether the list is sorted or not. Here is a sample run.

image text in transcribed

Note that the first number in the input indicates the number of the elements in the list. This number is not part of the list.

Enter list: 8101516619111 tnter The list is not sorted The list is already sorted

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

Step: 3

blur-text-image

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

Essentials of Database Management

Authors: Jeffrey A. Hoffer, Heikki Topi, Ramesh Venkataraman

1st edition

133405680, 9780133547702 , 978-0133405682

More Books

Students also viewed these Databases questions

Question

2 The main characteristics of the market system.

Answered: 1 week ago