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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 16:30, jngonzo1226
Which of the following statements best describes it careers?
Answers: 2
image
Computers and Technology, 23.06.2019 01:10, brooklynneramos9956
Problem 1 - hashing we would like to use initials to locate an individual. for instance, mel should locate the person mark e. lehr. note: this is all upper case. generate a hash function for the above using the numbers on your telephone. you know, each letter has a number associated with it, so examine your telephone keypad. generate 512 random 3 letter initials and take statistics on a linked list array size 512 to hold this information report how many have no elements, 1 element, 2 elements, does this agree with the hashing statistics distribution?
Answers: 1
image
Computers and Technology, 23.06.2019 12:50, tommy4260
Which syntax error in programming is unlikely to be highlighted by a compiler or an interpreter? a variable name misspelling a missing space a comma in place of a period a missing closing quotation mark
Answers: 1
image
Computers and Technology, 24.06.2019 00:30, louie8656
Match the sentence fragment in the first column with the appropriate ending in the second column. a little per favore?
Answers: 1
You know the right answer?
Create an application named percentages whose main() method holds two double variables. assign value...

Questions in other subjects:

Konu
Biology, 22.03.2021 20:00
Konu
Mathematics, 22.03.2021 20:00
Konu
History, 22.03.2021 20:00
Konu
Mathematics, 22.03.2021 20:00
Konu
Mathematics, 22.03.2021 20:00