Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a package named Q2. Create a java class named MathBugs which includes the header with your information. Use the Scanner class to take a

image text in transcribed

Create a package named Q2. Create a java class named MathBugs which includes the header with your information. Use the Scanner class to take a user input. The program should prompt the user to enter a two-digit number between 11 and 99 inclusive without any zero. No data-validation is required. Store this number in a variable called num. You can assume that the user will enter a 2-digit number without any zeros Use arithmetic operators (no mark will be awarded if arithmetic operators are not use) to determine the first and second digit of the number the user entered. Assign them to variables called tensDigit and UnitsDigit. For example, if the user entered 25, then the tensDigit equal to 2 and Units Digit will be 5. Now find the root-mean-squared (RMS) value of these two digits. The RMS of two numbers x and y is given by the formula: . |x2 + y2 RMS = 2 Print your final output on the screen using the printf() command and make sure to include up to 2 decimal places only. For example, if user enters 25, the RMS will be 3.81 NOTE: Use appropriate type of variable (int, double, float etc.). this question you must NOT use Strings and treat everything as numbers/ numerical data. You will be marked on this

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

Advanced MySQL 8 Discover The Full Potential Of MySQL And Ensure High Performance Of Your Database

Authors: Eric Vanier ,Birju Shah ,Tejaswi Malepati

1st Edition

1788834445, 978-1788834445

More Books

Students also viewed these Databases questions

Question

2. Compare the sales and service departments at Auto World.

Answered: 1 week ago