Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

java as simple as they can Assignment2C: Useless Conversions: Many message boards and chat applications allow users to set up bots, small scripts that automatically

java as simple as they can
image text in transcribed
Assignment2C: Useless Conversions: Many message boards and chat applications allow users to set up "bots", small scripts that automatically respond when they detect certain words in a message. In our opinion, one of the more amusing bots is the "Useless Converter" bot. When it encounters a standard unit of measure like meters or miles, it converts the value into an unusual format such as "number of sandwiches" or "length of laptops" and responds with this information. For this lab, you are going to replicate this bot with two different "useless" units of measure. You will prompt the user to to enter a number in miles. Then, you will convert that value into the number of refrigerators that would fit in that distance. You will also convert the original value into the number of candy bars that would fit in that distance. Finally, you will print out both numbers to the user. Important Note: For the Jurposes of this assignment, 1 candy bar converts to 0.0000848327 miles, and 1 refrigerator converts to 0.00105745 miles. You will need to save these values as CONSTANTs, and use them in your equations. Since we can't have half of a refrigerator, you'll need to cast the final result to a long data type after you've performed the conversion. The algorithm output is as shown below, with user input in bold. Save your source code in a file called Assignment2C (with a file extension of .cpp, .cs or .java) Sample Output: Enter a number of miles: 14.3 You: I walked 14.3 miles today #fitnessgoals Useless Conversion Bot: Wow, 14.3 miles is 13523 refrigerators long! Useless Conversion Bot: 14.3 miles is also 168567 candy bars long! Useless Conversion Bot: That's a lot

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

Advances In Databases And Information Systems 23rd European Conference Adbis 2019 Bled Slovenia September 8 11 2019 Proceedings Lncs 11695

Authors: Tatjana Welzer ,Johann Eder ,Vili Podgorelec ,Aida Kamisalic Latific

1st Edition

3030287297, 978-3030287290

More Books

Students also viewed these Databases questions

Question

Assessment of skills and interests.

Answered: 1 week ago

Question

Psychological, financial, and career counseling.

Answered: 1 week ago