Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

ASSIGNMENT 1 Due Date: Wednesday, 19th Jan, 11:59 PM PST Requirement: Consider 4 integers: x1,y1, x2 and y2. Calculate the distance between two points

image

ASSIGNMENT 1 Due Date: Wednesday, 19th Jan, 11:59 PM PST Requirement: Consider 4 integers: x1,y1, x2 and y2. Calculate the distance between two points (x, y) and (x2, y2). Create a java class LastnameFirstnameA1.java and pass 4 numbers as command-line arguments to calculate the distance between two points. Make sure the program prints usage if arguments are not passed while executing it. java LastnameFirstnameAl Usage: java LastnameFirstnameA1 Run and execute the program using IntelliJ IDEA as well as Command Prompt. To run this java program in IntelliJ IDEA, edit run/debug configurations as follows: Program arguments 3456 To run the program using command prompt/terminal: 1. Make sure the java path is set on the terminal by running java -version command on the prompt. In case it does not work then please follow links below to set path on the terminal. For mac OS visit this link. For Windows visit this link. 2. Go to the directory where your LastnameFirstnameA1.java file is created/saved and run: To compile and run the program, execute below commands. javac Lastname FirstnameAl java java LastnameFirstnameA13456 Sample Test Cases: Test Case 1-java LastnameFirstnameAl 3456 Output - Distance between (3,4) and (5,6) is 2.83 Program Completed Test Case 2-java LastnameFirstnameA1-10-15-12-18 Output - Distance between (-10,-15) and (-12,-18) is 3.61 Program Completed

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

Introduction To Java Programming And Data Structures Comprehensive Version

Authors: Y. Daniel Liang

12th Edition

0136520235, 978-0136520238

More Books

Students also viewed these Programming questions

Question

Explain differences of abstract writting and its effectiveness?

Answered: 1 week ago

Question

Explain the steps involved in training programmes.

Answered: 1 week ago

Question

What are the need and importance of training ?

Answered: 1 week ago