Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Euclidean Adjustments An astronomer is making measurements with his telescope when he notices that his vision field is off by x micronanometers (which we will

Euclidean Adjustments An astronomer is making measurements with his telescope when he notices that his vision field is off by x micronanometers (which we will assume is a measurement that exists) to the right. His telescope can only be moved to the right or to the left, however, and only via his automated, highly-calibrated machinery by certain predetermined fixed integer amounts. If, for example, one of these amounts is 7 micronanometers, then he can move his vision field by any multiple of 7 micronanometers to the left or right. Given a value of x and a set {m1, m2, . . . , mn} of predetermined fixed move- ment amounts, your job will be to advise the astronomer as to which of the movements to choose, how many times the movement should be applied, and the direction of the movement so that he can make his field of vision perfect. You may assume that x is a standard Java integer, but you may want to use the java.BigInteger class for the mi . It is guaranteed that a solution exists. 3 Input/Output The input file (input.txt) in the home directory will consist only of positive integers. The first line will be the value of x. The following lines will hold the values of the mi , one per line. Your output file (output.txt) should hold a sequence of lines with 2 single- space-separated numbers per line. These will be interpreted as instructions for telescope movement. The line mi y will mean to move the telescope mi micronanometers y times. (If y is positive, then it will be moved to the right; if y is negative, then it will be moved to the left.)

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

Auditing Cases An Active Learning Approach

Authors: Mark S. Beasley, Frank A. Buckless, Steven M. Glover, Douglas F. Prawitt

2nd Edition

0130674842, 978-0130674845

More Books

Students also viewed these Accounting questions

Question

Did you print a proof to view color and image consistency?

Answered: 1 week ago