subject

Create an application named percentages whose main() method holds two double variables. assign values to the variables. pass both variales to a method named computepercent() that displays the two values and the value of the first number as a percentage of the second one. then call the method a second time, passing the values inreverse order. save as percentages. java

i'm prety much done, i just need this modified to not prompt the user for any information. you

public class percentages {

public static void main(string[] args) {
string inputnumber;
double number1;
double number2;

inputnumber = joptionpane. showinputdialog(null,"plese enter the first number");
number1 = double. parsedouble(inputnumber);
inputnumber = joptionpane. showinputdialog(null,"plese enter the second number");
number2 = double. parsedouble(inputnumber);

computepercent(number1,number2);
computepercent(number2,number1);

}

public static void computepercent(double num1, double num2)
{
joptionpane. showmessagedialog(null, num1 + " is " + num1/num2*100 + "% of " + num2);

}

}

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 17:00
Which of the following is not contained on the slide show toolbar? a. next button b. slide button c. close button d. pen tool
Answers: 1
question
Computers and Technology, 23.06.2019 15:20
In a game with three frames, where will the objects on layer 1 appear? a. next to the play area b. in the middle of the game c. behind everything else d. in front of everything else
Answers: 1
question
Computers and Technology, 24.06.2019 03:30
Which explains extrinsic motivation? a)motivation in which there is a reward b)motivation that is personally satisfying c)motivation that is personally meaningful d)motivation in which the subject is interesting
Answers: 1
question
Computers and Technology, 24.06.2019 17:40
Create a file called favorite_foods, and list your favorite foods, entering five or six or more. press enter after each favorite food so it appears on its own line (make certain you also press enter after the final food item). after the file is created, add two more foods you like that are not on the list (press enter after the final food item). view the list of foods to make certain the two items you added appear at the end of the list
Answers: 2
You know the right answer?
Create an application named percentages whose main() method holds two double variables. assign value...
Questions
question
English, 29.01.2021 07:30
question
Biology, 29.01.2021 07:30
question
Mathematics, 29.01.2021 07:30
question
Mathematics, 29.01.2021 07:30
Questions on the website: 13722363