Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help coding this in Java Write a program that prompts the user (at the keyboard) for a value and searches the file uberstext

I need help coding this in Java

image text in transcribed

Write a program that prompts the user (at the keyboard) for a value and searches the file uberstext 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 Ct-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.hasNextintO) The name of your class should be FiadLast. For example, if the file beret contains. 18 23 43 12 23 18 16 Here is a sample execution of the program User input is in bold. Your pogram 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

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

More Books

Students also viewed these Databases questions

Question

link to code:...

Answered: 1 week ago

Question

9. Describe the characteristics of power.

Answered: 1 week ago

Question

10. Describe the relationship between communication and power.

Answered: 1 week ago