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 < .
-
In 2013, the top three donors of foreign aid were the United States, Great Britain, and Germany. The total amount of their aid was $63.5 billion. Together, Great Britain and Germany donated $0.5...
-
Is flowcharting useful in analyzing the resources required to implement a system?
-
Refer to the information in Problem 24-3A. Pebco Companys actual income statement for 2011 follows. Required 1. Prepare a flexible budget performance report for 2011. Analysis Component 2. Analyze...
-
Aunt Clarisse has promised to leave you an annuity that will pay $100 next year and grow at an annual rate of 4%. The payments are expected to go on indefinitely and the interest rate is 9%. What is...
-
A manufacturing firm has collected information on the number of defects produced each day for the past 50 days. The data have been described by the accompanying Minitab box-and-whisker plot. a. What...
-
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,...
-
John Cleaver's grandfather died in 2015 and left him a trunk that had been locked in his attic for years. At the bottom of the trunk John found a packet of 50 U.S. Savings Bonds that had never been...
-
What do you think the reaction of the staff would be if a company switched from being organized on departmental lines to being based on activities so that staff worked in multi- disciplinary teams?...
-
How do you decide whether or not a transaction is material?
-
By this stage of the book you should have a good knowledge of the purpose of manage- ment accounting and the techniques used. List three changes that you would like to see incorporated into...
-
To gain assurance that all inventory items in a client's inventory listing schedule are valid, an auditor most likely would trace a. Inventory tags noted during the auditor's observation to items...
-
Do you think that the structure of a manufacturing account makes it easy to follow? Are you clear about the meaning of each individual item? What does the information tell you about the cost of...
-
What is the difference between the symbol for the effect size for simple linear regression and the symbol for the effect size for multiple regression?
-
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...
-
Arguer creates the impression that you might be socially left behind or that everyone is engaged in a certain activity and it appeals to our desire to want to be included in the latest trend. Fallacy...
-
There's no missing information or reference. That's the complete information. Thank you ACTUARIAL SCIENCE QUESTION LIFE CONTINGENCIES HURRY UP PLEASE AND PLEASE SOLVE IT ALL CORRECTLY I WILL VOTE
-
Different cash flow. Given the cash inflow in the following table, LOADING... , what is the present value of this cash flow at 5 % , 1 1 % , and 2 7 % discount rates? Question content area bottom...
Study smarter with the SolutionInn App