Write an application that asks the user to enter one integer, obtains it from the user and
Question:
Write an application that asks the user to enter one integer, obtains it from the user and displays whether the number and its square are greater than, equal to, not equal to, or less than the number 100. Use the techniques shown in Fig. 2.15.
Fig. 2.15
Transcribed Image Text:
System.out.print ("Enter first integer: "); // prompt int number1= input.nextInt(); // read first number from user System.out.print("Enter second integer : "); // prompt int number2 = input.nextInt(); // read second number from user if (number1 == number2) System.out.printf("%d ==%d%n", number1, number2); } if (number1 != number2) { System.out.printf("%d != %d %n", number1, number2); } if (number1 < number2) { System.out.printf("%d < %d%n", number1, number2); } if (numberl> number2) { } if (number1 = number2) { System.out.printf("%d >= %d%n", numberl, number2); System.out.printf("%d > %d%n", numberl, number2); } } // end method main. } // end class Comparison Enter first integer: 777 Enter second integer: 777 777 == 777 777 = 777 Enter first integer: 1000 Enter second integer: 2000 1000 2000 1000 2000 1000 < 2000 Enter first integer: 2000 Enter second integer: 1000 2000 1000 2000 1000 2000 1000
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 0% (1 review)
Based on the information given and referring to the techniques shown in Fig 215 what youre being asked to do here is write a Java application that get...View the full answer
Answered By
Vineet Kumar Yadav
I am a biotech engineer and cleared jee exam 2 times and also i am a math tutor. topper comunity , chegg India, vedantu doubt expert( solving doubt for iit jee student on the online doubt solving app in live chat with student)
5.00+
2+ Reviews
10+ Question Solved
Related Book For
Java How To Program Late Objects Version
ISBN: 9780136123712
8th Edition
Authors: Paul Deitel, Deitel & Associates
Question Posted:
Students also viewed these Computer science questions
-
Write an application that asks the user to enter two integers, obtains them from the user and prints the square of each, the sum of their squares, and the difference of the squares (first number...
-
Write a program that reads three integer numbers from the user and prints the numbers in ascending order. 2. Write a Java program to check whether a number is divisible by 5 and 11 or not. 3. Write a...
-
4. An ice hockey puck travels with a speed of 15 m/s straight towards the extended goal line when it receives a quick blow from a hockey stick. The puck weighs 160 g and receives an impulse from the...
-
a. Find the probability of getting exactly 1 girl in 10 births. b. Find the probability of getting 1 or fewer girls in 10 births. c. Which probability is relevant for determining whether 1 is an...
-
(Three Differences, Multiple Rates, Future Taxable Income) During 2010, Graham Co.'s first year of operations, the company reports pretax financial income of $250,000. Graham's enacted tax rate is...
-
A 6 mm thick sheet of polished 304 stainless steel is suspended in a comparatively large vacuum-drying oven with black walls. The dimensions of the sheet are 30 cm x 30cm, and its specific heat is...
-
Velocity ratio is the ratio of distance moved by _____ to distance moved by _____.
-
Revenue allocation, bundled products Heavenly Resorts operates a five-star hotel with a world- recognized championship golf course. Heavenly has a decentralized management structure, with three...
-
Mayweather Auto Inc. (Mayweather) sold a new limited-edition SUV to Frakes Ltd. (Frakes) on June 1, for $170,000. The SUV has a normal selling price of $185,000 and thus the price charged to Frakes...
-
Write an application that inputs three integers from the user and displays the sum, average, product, smallest and largest of the numbers. Use the techniques shown in Fig. 2.15. The calculation of...
-
Write an application that displays the numbers 1 to 4 on the same line, with each pair of adjacent numbers separated by one space. Use the following techniques: a) Use one System.out.println...
-
Data set: Years of service of 26 New York state troopers Construct a frequency distribution and a relative frequency histogram for the data set using five classes. Which class has the greatest...
-
Describe the various forms of sterilization.
-
Give two arguments for and two arguments against partial-birth abortions.
-
Describe a patients rights during labor disputes.
-
Do you agree that eugenic sterilization should be allowed? Why or why not?
-
Should a married woman be allowed to abort without her husbands consent?
-
In many situations, a seller of an item entertains bids from a number of buyers but allows one buyer to obtain the good by matching the highest competing offer. Consider the owner of a house who must...
-
It is possible to investigate the thermo chemical properties of hydrocarbons with molecular modeling methods. (a) Use electronic structure software to predict cHo values for the alkanes methane...
-
Consider the following recursive mergesort algorithm (another classic divide and conquer algorithm). Mergesort was first described by John Von Neumann in 1945. The basic idea is to divide an unsorted...
-
Matrix multiplication plays an important role in a number of applications. Two matrices can only be multiplied if the number of columns of the first matrix is equal to the number of rows in the...
-
Consider the following portions of two different programs running at the same time on four processors in a symmetric multicore processor (SMP). Assume that before this code is run, both x and y are...
-
Prepare the entries for the transactions using a general journal. 1. Discarding an asset. a. On January 4, shelving units, which had a cost of $6,640 and had accumulated depreciation of $6,160, were...
-
Autonomous aggregate expenditures decreases by $200 million, the marginal propensity to consume is 0.50, marginal propensity to invest is 0.25, and the marginal propensity to import is 0.10....
-
These are selected account balances on December 31, 2025. Land $147000 Land (held for future use) 220500 Buildings 1176000 Inventory 294000 Equipment 661500 Furniture 147000 Accumulated Depreciation...
Study smarter with the SolutionInn App