Write a program that prompts the user to enter a point (x, y) and checks whether the
Question:
Write a program that prompts the user to enter a point (x, y) and checks whether the point is within the rectangle centered at (0, 0) with width 10 and height 5. For example, (2, 2) is inside the rectangle and (6, 4) is outside the rectangle, as shown in Figure 3.7b.?
Transcribed Image Text:
Enter a point with two coordinates: 2 2 JEnter Point (2.0, 2.0) is in the rectangle Enter a point with two coordinates: 6 4 -Enter Point (6.0, 4.0) is not in the rectangle у-ахis (6, 4) (2, 2) (0, 0) х-ахis (b)
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 77% (9 reviews)
Program Plan Include the necessary variables necessary for the execution of the program Declare all ...View the full answer
Answered By
Akash Goel
I am in the teaching field since 2008 when i was enrolled myself in chartered accountants course
Since then i have an experience of teaching of class XI, XII, BCOM, MCOM, MBA, CA CPT.
5.00+
1+ Reviews
10+ Question Solved
Related Book For
Introduction to Java Programming, Comprehensive Version
ISBN: 978-0133761313
10th Edition
Authors: Y. Daniel Liang
Question Posted:
Students also viewed these Computer science questions
-
Programming Exercise 6.39 gives a method for testing whether three points are on the same line.Write the following method to test whether all the points in the array points are on the same...
-
Write a program that prompts the user to enter two strings and tests whether the second string is a substring of the first string. (Don?t use the indexOf method in the String class.) Analyze the time...
-
Write a program that prompts the user to enter the month and year and displays the number of days in the month. For example, if the user entered month 2 and year 2012, the program should display that...
-
On January 26, Nova Co. borrowed cash from Conrad Bank by issuing a 30-day note with a face amount of $60,000. Assume a 360-day year. a. Determine the proceeds of the note, assuming the note carries...
-
Find cos and tan if sin = 0.4 and /2 < .
-
What is the speedup of going from a 1-issue processor to a 2-issue processor from Figure 4.69? Use your code from 4.28.1 for both 1-issue and 2-issue, and assume that 1,000,000 iterations of the loop...
-
The IRR of this investment is located at which point? a. A b. C c. D d. E
-
The following information is available for The Lucille Corporation for 2014: Instructions 1. Prepare the 2014 statement of cost of goods manufactured. 2. Prepare the 2014 incomestatement. Inventories...
-
Let us consider measuring a scalar parameter with an observation model Zk = 0 + Vk, k = 1,. K where v are independent, Gaussian distributed random variables with = 0 and = 0, V k. Derive the maximum...
-
On January 1, 20X1, Wade Crimbring, Inc., a dealer in used manufacturing equipment, sold a CNC milling machine to Fletcher Bros., a new business that plans to fabricate utility trailers. To conserve...
-
Write a program that prompts the user to enter a point (x, y) and checks whether the point is within the circle centered at (0, 0) with radius 10. For example, (4, 5) is inside the circle and (9, 9)...
-
Write a program that simulates picking a card from a deck of 52 cards. Your program should display the rank (Ace, 2, 3, 4, 5, 6, 7, 8, 9, 10, Jack, Queen, King) and suit (Clubs, Diamonds, Hearts,...
-
The Build-It Construction Company enters into a contract on January 1, 2013, to construct a 20-story office building for $42,000,000. During the construction period, many change orders are made to...
-
Your portfolio consists of Apple and Boeing stock. You are investing $10,000 with 60% of it in Apple stock. Apple has an expected return of 10% and Boeing has an expected return of 14%. How much do...
-
The Poisson's ratio is a measure of the Poisson effect, the phenomenon in which a material tends to expand or contract in directions perpendicular to the direction of tension or compression. Give a...
-
Most Universities have a mission statement. Write a mission statement for your university. Does having a comprehensive mission cause high performance? Justify your answer.
-
What will be the output of the below code #include using namespace std; int factorial (int n) { if (n
-
You have been asked to forecast Orwell's additional funds needed (AFN) for next year. Assuming the firm is operating at only 50% of capacity and using the data in the table below, forecast Orwell's...
-
The T accounts for equipment and the related accumulated depreciation for Trevis Corporation are as follows: In addition, Trevis's income statement reported a loss on the sale of equipment of $1,500....
-
Use nodal analysis to determine voltages v1, v2, and v3 in the circuit Fig. 3.76. Figure 3.76 4 S 3i, 2 A 4A
-
Write a program that animates the partition for a quick sort. The program creates a list that consists of 20 random numbers from 1 to 999. The list is displayed, as shown in Figure 23.22b. Clicking...
-
The implementations of the methods contains(E e), get(int index), indexOf(E e), lastIndexOf(E e), and set(int index, E e) are omitted in the MyLinkedList class. Implement these methods. Define a new...
-
The implementations of the methods addAll, removeAll, retainAll, toArray(), and toArray(T[]) are omitted in the MyList interface. Implement these methods. Test your new MyList class using the code at...
-
Using two-way Set-Associative mapping method, design two-way mapping for cache memory from main memory. Explain why you need each condition and show all intermediate calculation procedures. You must...
-
18) Under the proration approach, the sum of the amounts shown in the subsidiary ledgers will not match the amounts shown in the general ledger because no adjustments from budgeted to actual...
-
Simpson Auto Body Repair purchased $20,000 of Machinery. The company paid $8,000 in cash at the time of the purchase and signed a promissory note for the remainder to be paid in four monthly...
Study smarter with the SolutionInn App