Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need help with fixing the errors in this java program! The output should be: Enter a integer value: 14 Enter a integer value: 4 Enter

Need help with fixing the errors in this java program! The output should be:

Enter a integer value: 14

Enter a integer value: 4

Enter a integer value: 11

Enter a double value: 9.8

The power of 14 and 4 is: 38416.0

The maximum value of 14 and 4 is: 14

The minimum value of 14 and 4 is: 4

The square root value of 11 is: 3.3166247903554

The rounded value of 9.8 is: 10.0

This is the program currently with the errors that need fixed:

image text in transcribed

image text in transcribed

Thank you so much in advance!

BonusBug04.java + 1/ 3/ 4 import java.lang. Math; 5 public class BonusBug 04 6\{ public static void main(String args[]) \{ Scanner keyboard = new Scanner(System.in); Double power, squareRoot, num4, rounded; int num1, num2, num3, maximumValue, minimumValue; System.out.println("Enter a integer value: "); num1 = keyboard. nextInt () ; System.out.println("Enter a integer value: "); num2 = keyboard.nextInt () ; System.out.println("Enter a integer value: "); num3 = keyboard.nextInt () ; System.out.println("Enter a double value: "); num4 = keyboard nextDouble (); / power = Math.pow ( num1, num2 ); System.out.println("The power of "+ num 1+ "and " + num 2+ " is : " power); /* max method will return the maximum value of two arguments / maximumvalue = Math max( num 1, num 2); System.out.println("The maximum value of " - num + " and " + num2 + "is : " + maximumValue); /* min method will return the maximum value of two arguments */ minimumValue = Math minimum( num1, num2 ); System.out.println("The minimum value of "+ num 1+" and "+ num 2+" is : + minimumValue); /* Squareroot method will return the double value of a double argument */ squareroot= Math.sqrt(num3); System.out.println("The square root value of " + num3 + " is : " squareRoot); /* round method will return the closet value of the number without decimal places */ rounded = Math.round(num4); System.out.println("The rounded value of + num4 +" is : + rounded); \}

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

Oracle 10g Database Administrator Implementation And Administration

Authors: Gavin Powell, Carol McCullough Dieter

2nd Edition

1418836656, 9781418836658

More Books

Students also viewed these Databases questions