answersLogoWhite

0


Best Answer

// Exercise 3.07 Solution // Larger.java // Program determines the larger of two numbers import javax.swing.*; import java.awt.Graphics; public class Larger extends JApplet { String result; // a string containing the output public void init() { String firstNumber, // first string entered by user secondNumber; // second string entered by user int number1, // first number to compare number2; // second number to compare // read first number from user as a string firstNumber = JOptionPane.showInputDialog( "Enter first integer:" ); // read second number from user as a string secondNumber = JOptionPane.showInputDialog( "Enter second integer:" ); // convert numbers from type String to type int number1 = Integer.parseInt( firstNumber ); number2 = Integer.parseInt( secondNumber ); if ( number1 > number2 ) result = number1 + " is larger."; else if ( number1 < number2 ) result = number2 + " is larger."; else result = "These numbers are equal."; } public void paint( Graphics g ) { // draw results g.drawRect( 15, 10, 270, 20 ); g.drawString( result, 25, 25 ); } }

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a Java applet that asks the user to enter two floating point numbers obtain the two numbers from the user and draws the sum and product of the two numbers?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

The numbers being multiplied together to obtain a product are the what?

factors


What is it when prime numbers are multiplied together to get the original number?

Then, we obtain the multiple or the product of prime numbers.


What are the numbers being multiplied together to obtain a product?

Multiplicand times multiplier equals product


What numbers do you multiply to equal 840?

There are an infinite amount of numbers you can multiply to obtain 840 as the product.


What happens when you mutiply three negative numbers?

You obtain the product of the three numbers A * B * C, with a negative sign.


What are the numbers that you multiply together to get a product called?

The multiplicand is multiplied by the multiplier to obtain the product. They are both also known as factors.


What is the smallest odd number you can obtain from the product of four different prime numbers?

1155, 3x5x7x11=1155.


What is the smallest number you can obtain from the product of four different prime numbers?

2&times;3&times;5&times;7=210


What are numbers you multiply together called?

The multiplicand is multiplied by the multiplier to obtain the product. They are both also known as factors.


What is the largest two digit number you can obtain from a product of two or more prime numbers?

43 + 47 = 90This is a sum, not a product.7 x 13 = 91


How to explain why numbers are a factor pair?

Factors come in pairs because it is necessary to multiply something by something else to obtain a product.


where can i obtain the latest product update on Microwave Cart Oak?

You can obtain all product updates thru the manufacturers website. You must visit the manufacturers website for product updates.