(Geometry: intersecting point) Write a method that returns the intersecting point of two lines. The intersecting point of the two lines can be found by using the formula given in
public static double[] getIntersectingPoint(double [][] points)
The points are stored in a 4-by-2 two-dimensional array points with (points [0] [0], points [0] [1] ) for (x1 , y1 ). The method returns the intersecting point or null if the two lines are parallel. Write a program that prompts the user to enter four points and displays the intersecting point. See Programming Exercise 3.25 for a sample run.
Trending nowThis is a popular solution!
Chapter 8 Solutions
Introduction to Java Programming and Data Structures, Comprehensive Version (11th Edition)
Additional Engineering Textbook Solutions
Starting Out with Python (4th Edition)
C Programming Language
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
Modern Database Management
C++ How to Program (10th Edition)
Artificial Intelligence: A Modern Approach
- (Intro to Java) explain the answers to the below questions using step-by-step explanation.arrow_forwardProblem 1: Complete the isExactReverse() method in Reverse.java as follows: The method takes two Strings x and y as parameters and returns a boolean. The method determines if the String x is the exact reverse of the String y. If x is the exact reverse of y, the method returns true, otherwise, the method returns false. Other than uncommenting the code, do not modify the main method in Reverse.java. Sample runs provided below. Argument String x "ba" "desserts" "apple" "regal" "war" "pal" Argument String y "a" "stressed" "apple" "lager" "raw" "slap" Return Value false true false true true falsearrow_forwardPlease help using javaarrow_forward
- (Intro to Java) Explain the answers to the below questions. include a written answer to the question using step-by-step explanation 1. Write a method called arrayTimesFive The method takes one array of doubles as a parameter It multiplies each element in the array by 5 and stores the result It returns nothingarrow_forward9. answer previous chapters, you continued to modify the MarshallsRevenue program. Now, modify the program so that the major functions appear in the following individual methods: GetMonth - This method prompts for and returns the month GetNumMurals - This method prompts for and returns the number of murals scheduled and is called twice -- once for interior murals and once for exterior murals ComputeRevenue - This method accepts the number of interior and exterior murals scheduled, accepts the month they are scheduled, displays the interior and exterior prices, and then returns the total expected revenue DataEntry - This method fills an array with customer names and mural codes and is called twice -- once to fill the array of interior murals and once to fill the array of exterior murals GetSelectedMurals - This method continuously prompts for mural codes and displays jobs of the corresponding type until a sentinel value is entered. using System; using static System.Console; using…arrow_forward(language: Intellij-Java) Part One: Create a method which takes two int parameters and swaps them. Print the values before and after swapping. (Example: ‘before swap: x = 5, y = 10; after swap: x=10, y=5). Part2: Write a method which gets a value from the user and convert that value from Celsius to Fahrenheit: - For Celsius to Fahrenheit conversion use: F = 9*C/5 + 32 - Print the result of the conversion Part3: Create a method which takes an integer array input from the user and reverses the elements in the array. Print the reversed array. - For example, the expected “reversed” result for an array [5,33,0,8,2] is [2,8,0,33,5] - Don't use any inbuilt/existing array reverse method. Try to write the reversing logicarrow_forward
- a.Write the method that finds the first 4 numbers out of 100 randomly generated numbers. After the numbers are generated in main, they should be sent to the method given as an example below and the smallest four numbers should be found. Write the numbers found on the console screen in the main method.(will be coded in java) Method name: public static int[] smallestFindFirstFourth(int[] array) Note: Sorting algorithms or ready-made functions will never be used. b.In the attached city list.txt file, the names of the provinces in Turkey are given in a single line according to the format given in Figure 1. In the application you will write, write the city names read from this file into the license plate list.txt file in the format shown in Figure 2. In more descriptive terms, citylist.txt is a file given to you. license plate list.txt is the file you will get with your code. city list: Adana, Adıyaman, Afyon, Ağrı, Amasya, Ankara, Antalya, Artvin, Aydın, Balıkesir, Bilecik, Bingöl, Bitlis,…arrow_forwarda.Write the method that finds the first 4 numbers out of 100 randomly generated numbers. After the numbers are generated in main, they should be sent to the method given as an example below and the smallest four numbers should be found. Write the numbers found on the console screen in the main method.(will be coded in java) Method name: public static int[] smallestFindFirstFourth(int[] array) Note: Sorting algorithms or ready-made functions will never be used. b.In the attached city list.txt file, the names of the provinces in Turkey are given in a single line according to the format given in Figure 1. In the application you will write, write the city names read from this file into the license plate list.txt file in the format shown in Figure 2. In more descriptive terms, citylist.txt is a file given to you. license plate list.txt is the file you will get with your code. city list: Adana, Adıyaman, Afyon, Ağrı, Amasya, Ankara, Antalya, Artvin, Aydın, Balıkesir, Bilecik, Bingöl, Bitlis,…arrow_forwardtask4-Change Summation Integers problem to Finding the minimumproblem. Make sure you properly wrote/updated all text messages, method names,and math calculations.Hint: You can use java.lang.Math.min() method.Example: System.out.printf("The min of the integers %4d and %4d and %4dis %7d\n", a, b, c, MinTest(a, b, c));Submit the source code files (.java files) and the console output screenshotsarrow_forward
- (Needs to write a java program. The imput file that the code will be tested on will be really large, but a code that can work on the provided sample in the picture should work just fine) An image is an array, or a matrix, of pixels (picture elements) arranged in columns and rows. RGB is one of the models used in color pixels. In a color image, each RGB pixel is an integer number which contains the mixture of red, green and blue colors. In this assignment, you will be provided with an image data file, image.dat. The first line in data file contains the height (rows) and width (columns) of the image. The following lines gives the red, green and blue color integer values for each pixel. The following sample.dat is given as an example: (The given example can be seen on the picture down) According to this input file, the image has 4 rows and 2 columns. The pixel at [0][0] has red value 117, green value 117 and blue value 245. Write a Java program that reads from the given input file and…arrow_forward(Learning Objective: students will be able to apply their knowledge of the built-in random package to generate simulations of simple phenomena.) Write a function: • dicesim(D1,D2,trials) that takes as input the number of sides on die 1 (D1) and die2 (D2) and the number of trials. Your function should repeatedly sum pairs of random numbers between 1 and D1 and 1 and D2 and keep track of how many times each sum occurs. The function returns a numpy array with the fraction each sum of rolls occured. Since the numbers are chosen at random, the fractions will differ some from run to run. One run of the function print(p22.dicesim(6,6,10000)) resulted in: [0. 0. 0.0259 0.0615 0.0791 0.1086 0.139 0.1633 0.1385 0.114 0.0833 0.0587 0.0281] or displayed using the code from Section 16.1.1.: PMF of X Note: you should submit a file with only the standard comments at the top and the function. The grading scripts will then import the file for testing.arrow_forwardUse java See the image for requirementsarrow_forward
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning