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 14:30
Create a pseudocode design to prompt a student for their student id and the titles of the three classes they want to add. the solution should display the student’s id and a total bill. • bill a student using the following rules: o students can only add up to 3 classes at a time.
Answers: 3
question
Computers and Technology, 23.06.2019 11:30
In cell h5 enter a formula that will calculate the percentage of attendees that went to the altamonte springs job fair in 2018.
Answers: 1
question
Computers and Technology, 24.06.2019 03:40
4. does the kernel phenotype distribution support the idea that the cob is the result of a dihybrid cross? what information supports your answer? if a dihybrid cross (i.e. f1 to f2 of standard mendelian crosses) is not indicated what conditions might contribute to this finding.
Answers: 2
question
Computers and Technology, 24.06.2019 10:10
Scanning the road can be thought of as a
Answers: 2
You know the right answer?
Create an application named percentages whose main() method holds two double variables. assign value...
Questions
Questions on the website: 13722361