Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

11:37 Watch App Enter URL of file DISPLAY WATCHES Natches will be displayed here. You should enter the entire URL of a file containing watch

image text in transcribed

11:37 Watch App Enter URL of file DISPLAY WATCHES Natches will be displayed here. You should enter the entire URL of a file containing watch data in the EditText field labeled Enter URL of file. Such a text (data) file (located on the Web) will contain data for three different watches. Let each data item sit on its own line in the text file. (The file will therefore contain 18 lines of data in total.) For example, the first six lines of the file might look like: Invicta Pro Diver battery 200 stainless steel 119.99 Your app should have a Main Activity method that responds to a press of the button Display Watches and does the following: (a) Creates three Watch objects. (Make certain to declare three separate Watch references and use these in the object creation process. You can use an array of watches (references) for this or even a listbut it is not required.) (b) Reads all the watch data from the data file into the three respective Watch objects that you created. (c) Displays all the data for the three watches (retrieved from the objects) in the TextView below the button. (d) Displays the average water resistance of the three watches (as a real number) in the TextView below the watch data. Display this value to one decimal place (for example, 40.3 meters). (e) Displays the average price of the three watches in the TextView below the watch data. As usual for money, display the value to two decimal places (for example, $300.59). Reminder: Do not forget to include the two lines in the "onCreate method of the Main Activity pertaining to the thread policy. See the handout on App File Input. Also, don't forget to give the app "Internet" permission. 11:37 Watch App Enter URL of file DISPLAY WATCHES Natches will be displayed here. You should enter the entire URL of a file containing watch data in the EditText field labeled Enter URL of file. Such a text (data) file (located on the Web) will contain data for three different watches. Let each data item sit on its own line in the text file. (The file will therefore contain 18 lines of data in total.) For example, the first six lines of the file might look like: Invicta Pro Diver battery 200 stainless steel 119.99 Your app should have a Main Activity method that responds to a press of the button Display Watches and does the following: (a) Creates three Watch objects. (Make certain to declare three separate Watch references and use these in the object creation process. You can use an array of watches (references) for this or even a listbut it is not required.) (b) Reads all the watch data from the data file into the three respective Watch objects that you created. (c) Displays all the data for the three watches (retrieved from the objects) in the TextView below the button. (d) Displays the average water resistance of the three watches (as a real number) in the TextView below the watch data. Display this value to one decimal place (for example, 40.3 meters). (e) Displays the average price of the three watches in the TextView below the watch data. As usual for money, display the value to two decimal places (for example, $300.59). Reminder: Do not forget to include the two lines in the "onCreate method of the Main Activity pertaining to the thread policy. See the handout on App File Input. Also, don't forget to give the app "Internet" permission

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

Oracle 10g SQL

Authors: Joan Casteel, Lannes Morris Murphy

1st Edition

141883629X, 9781418836290

More Books

Students also viewed these Databases questions

Question

Name two physical symptoms of technology overuse:

Answered: 1 week ago

Question

1. What is a security? LOP8

Answered: 1 week ago

Question

2. What are the two main functions of the financial system? LOP8

Answered: 1 week ago