Write a program that takes as input two opposite corners of a rectangle: (x1,y1) and (x2,y2) – float or integer only. Finally, the user is prompted for the coordinates of a third point (x,y). The...

1 answer below »

Write a program that takes as input two opposite corners of a rectangle: (x1,y1) and (x2,y2) – float or integer only. Finally, the user is prompted for the coordinates of a third point (x,y). The program should print Boolean value True or False based on whether the point (x,y) lies within the rectangle. At the end of each run, the user should be prompted to ask whether then want to continue.














question-

Create a program that prompts the user to enter two numbers as the starting and ending limits of a range. Continue asking if the starting number is greater than the ending limit. The program must display:



a. The remainder of dividing the numbers in the range (both included) by 5.


b. The average of all odd numbers


Note:
Do not use Python’s internal functions for average and maximum.














question-

Write a program that takes a digit input value between 0 and 9 and converts it to an equivalent English word (For example, if the user enters 0, the program should display "you entered zero.", or if the user enters 2, the program should display "you entered two."). The program continues to ask the question and display the output until the user enters -5 as an input.











question-






  1. Write a program that display the following pattern:




    *****

    ****

    ***

    **

    *




  2. Update your previous code to get the user's number of * in the first line. The user should in put a value between 1-10. For example, if the user input 7 the output should be:




    *******

    ******

    *****

    ****

    ***

    **

    *




Tip: You need to use loop and if condition in your code.

Answered 3 days AfterSep 18, 2022

Answer To: Write a program that takes as input two opposite corners of a rectangle: (x1,y1) and (x2,y2) – float...

Baljit answered on Sep 19 2022
53 Votes
1. Program to check whether given number lies inside the Rectangle.
Code:-
def Point_lies(i,k,m,j,
l,n):
if m>i and n>j and n return True
else:
return False
ch='y'
while ch=='y' or ch=='Y':
i=float(input("Enter x1:"))
j=float(input("Enter y1:"))
k=float(input("Enter x2:"))
l=float(input("Enter y2:"))
m=float(input("Enter x3:"))
n=float(input("Enter y3:"))
print(Point_lies(i,k,m,j,l,n))
print("Do you want to continue?;=y/n")
ch=input()2.
Code:-
def remainder_(x,y):
for j in range(x,y+1):
...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here