Question: (Please answer this in java and within 4 hours please. Thank you.) Write a program that prompts the user (at the keyboard) for a value

(Please answer this in java and within 4 hours please. Thank you.)

(Please answer this in java and within 4 hours please. Thank you.)

Write a program that prompts the user (at the keyboard) for a value and searches the file numbers.text for that value, printing out the last position where the number appears in the file (the first number in the file is at position 1). If the number does not appear in the file, print out an appropriate message. Continue asking the user for values until they signal end-of-file (in Windows one enters end-of-file at the keyboard by entering Ctl-Z, in Unix end-of-file is indicated by entering CtI-D). The logic is the same as end-of-file on a disk file-- i.e., if your Scanner variable is named 'keyboard', you would have the loop condition 'while (keyboard. hasNextint 0) The name of your class should be Findlast. For example, if the file numbers.text contains 10 23 43 12 1e Here is a sample execution of the program User input is in bold. Your program should replicate the prompts and output: Enter a number: 10 10 last appears in the file at position 9 Enter a number: 29 29 does not appear in the file Enter a number: 9 9 last appears in the file at position 12 Enter a number

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!