Question: CS 151 Spring 2022 - Program #3 Write a program that asks the user for the (x,y) coordinates for a point on the xy plane.
CS 151 Spring 2022 - Program \#3 Write a program that asks the user for the (x,y) coordinates for a point on the xy plane. Make these double precision variables. Compute the distance between the point and the origin using the following formula and print the result on the monitor. distance =(x2+y2) Use Scanner with nextDouble () to get input from the user. Use Math.sqrt 0 to compute the square root. a+v2=cc=a2+b2 Here is a run of the program: Start your source flle with comments that describe it: // CS 151 PROGRAM ASSIGMENT #3 // Distance Calculation /. Your Name // Date These lines will be the first seven lines of your source file. Of course, use your actual name and the actual date as indicated. Make sure that your source file is neatly indented. Look at the book's examples of good and bad indenting. The program Casmileage, java in the text would be good to look at for this
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
