Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The DoFunFormulas class should implement a main method that does the following: 1) Instantiates an object of type FunFormulas (that is, creates an object of

image text in transcribedimage text in transcribed

The DoFunFormulas class should implement a main method that does the following: 1) Instantiates an object of type FunFormulas (that is, creates an object of type FunFormulas). 2) Checks to make sure that one string is passed into the main method via the command line when the main method in the DoFunFormulas class is executed. If a string is not passed into the main method via the command line, the main method should print an error and exit 3) If one string is present in the String array passed as a parameter to the main method, the program should call the method to calculate the formula specified by the string passed in via the command line (that is, one of the five methods to compute formulas implemented in the FunFormulas class: sd, 1s, wi, dt, or sa) NOTE: If the argument entered on the command line does not exactly match the name of one of the methods implemented in the FunFormulas class, your program should print out an error and exit. For example, below are example runs of our solution consisting of the DoFunFormulas and FunFormulas classes (User input is in BOLD font): \$ java DoFunFormulas DD ERROR: Formula DD is not recognized, Type: sd compute storm distance is to compute distance to lightning strike wi to compute weight of ice cube dt to computer distance traveled sa to compute skin area \$ java DoFunFormulas ERROR: 1 command line argument required: Two letter name of function to compute. Type: sd compute storm distance ls to compute distance to lightning strike wi to compute weight of ice cube dt to computer distance traveled sa to compute skin area \$ java DoFunFormulas sd Enter diameter of storm in miles: 20 5 The storm will last: 6.085806194501846 hours

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

SQL Server Query Performance Tuning

Authors: Sajal Dam, Grant Fritchey

4th Edition

1430267429, 9781430267423

More Books

Students also viewed these Databases questions

Question

What did they do? What did they say?

Answered: 1 week ago