Answered step by step
Verified Expert Solution
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
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started