Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need to make a MyPow application from A guide to programming in java edition 5. It is exercise 12 on page 128. Please help

I need to make a MyPow application from "A guide to programming in java" edition 5. It is exercise 12 on page 128. Please help

creat a MyPow application that uses the formula e^(Y * log(X)) to calculate X^Y. The MyPow application should prompt the user for two numbers and then display the result from the formula and, for comparison, show the same result using the Math pow() method. The application should display output similar to:

Enter a value for x: 7

Enter a value for y: 5

The result from using the formula is: 16806.99999999998

the result from using the Math pow() method is: 16807.0

The Math library provides methods for calculating base 10 and base e (natural) logarithms. The exp() method raises e to a given power:

Class Math (java.lang.Math)

Methods:

log(double num) returns the natural logarithm of num.

log10(double num) returns the base 10 logarithm of num.

exp(double num) returns e raised to the power of num.

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

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions