Write a Python3 program to check if 3 user entered points on the coordinate plane creates a triangle or not. Your program needs to repeat until the user decides to quit, and needs to deal with invalid inputs.

Answers

Answer 1

Answer:

tryagain = "Y"

while tryagain.upper() == "Y":

    x1 = int(input("x1: "))

    y1 = int(input("y1: "))

    x2 = int(input("x2: "))

    y2 = int(input("y2: "))

    x3 = int(input("x3: "))

    y3 = int(input("y3: "))

    area = abs(x1 *(y2 - y3) + x2 * (y1 - y3) + x3 * (y1 - y2))

    if area > 0:

         print("Inputs form a triangle")

    else:

         print("Inputs do not form a triangle")

    tryagain = input("Press Y/y to try again: ")

Explanation:

To do this we simply calculate the area of the triangle given that inputs are on plane coordinates i.e. (x,y).

If the area is greater than 0, then it's a triangle

If otherwise, then it's not a triangle.

This line initializes iterating variable tryagain to Y

tryagain = "Y"

while tryagain.upper() == "Y":

The following lines get the coordinates of the triangle

    x1 = int(input("x1: "))

    y1 = int(input("y1: "))

    x2 = int(input("x2: "))

    y2 = int(input("y2: "))

    x3 = int(input("x3: "))

    y3 = int(input("y3: "))

This calculates the area

    area = abs(x1 *(y2 - y3) + x2 * (y1 - y3) + x3 * (y1 - y2))

This checks for the condition stated above.

    if area > 0:

         print("Inputs form a triangle") This is printed, if true

    else:

         print("Inputs do not form a triangle") This is printed, if otherwise

    tryagain = input("Press Y/y to try again: ") This prompts the user to try again with another set of inputs


Related Questions

Give a recursive definition of the set of positive integer powers of 3.That is the set {3,9,27,81,...}

Answers

Answer:

We have set A,

3 ∈ S

n*3 if n ∈ S

Explanation:

A recursion can be defined as a way of defining objects in terms of itself or as parts of itself.

Lets say we a set that is defined as A,

Then the recursive definition of the sets of positive integers with the powers of 3 in A is given as

3 ∈ S

n*3 if n ∈ S

This tells us that 3 is an element of S such that if n is an element of S then in general we would have n*3 to be an element of S

A software developer is creating a variable to hold whole numbers and will perform numeric operations on the values stored in that
variable. Which of the following data types is the BEST for this purpose?

Answers

Answer:

blue 80 Omaha a set hut

Explanation:

A technology that can help a student to increase his or her understanding of the vocabulary used in a classroom is called:_______

a. assistive instruction.
b. UDL technology.
c. hypertext software.
d. adaptive instruction.

Answers

Answer:

c. hypertext software.

Explanation:

In Computer science, a hypertext can be defined as textual informations that are being displayed on a computer system and these texts usually links to other informations (texts) that the user can easily have access to in real-time.

Basically, some developers include encyclopedias and dictionaries in their software database, which makes other necessary informations or contents easier and immediately accessible to the users through the use of hypertexts that is activated by pointing and clicking on the link with a mouse, keypress set or soft touching the screen.

Hence, a technology that can help a student to increase his or her understanding of the vocabulary used in a classroom is called hypertext software.

. Write and execute a query that will determine the average age of customers broken out by the city in which they reside. Note: Make sure that the average age is not truncated to an integer.

Answers

Answer:

SELECT resid_city, avg(convert(float,age))

  FROM customer

 GROUP BY resid_city

Explanation:

SQL or structured query language is a language used to interact with databases. It is a relational database language, used to create, update, and query the content of databases.

The "SELECT" clause in the query statement above is used to read the content of the customer table querying the table based on the average age of customers grouped by their resident cities to return the "resid_city" and the float number of the average age.

Display the order date and the ship date for all orders that were made April 1 through April 15. List the order date, ship date, order priority, and ship mode. Order the results by order_date. Do you notice anything unusual about the data? [Hint: You will need to join the orders and shipping together and use a join statement. You will need to limit the result set by the date field order_date <= to_date('04/15/2018', 'mm/dd/yyyy')This is what I was able to come up with but it still gave me an error.select orders.order_date, shipping.ship_date, orders.order_priority, shipping.ship_modefrom ordersinner join shipping on orders.order_date = shipping.ship_datewhere Orders.Order_date = Shipping.ship_date AND Order_Date BETWEEN TO_DATE (’04/01/2018’, ‘04/15/2018’)ORDER BY Order_Date;

Answers

Answer:

SELECT Order_date, Ship_Date, Order_priority, Ship_mode

FROM orders

JOIN Shipping ON Orders.Order_id = Shipping.Order_id

WHERE Order_date

BETWEEN TO_DATE('04/01/2018', '%m/%d/%Y') AND TO_DATE('04/15/2018', '%m/%d/%Y')

ORDER BY Order_date

Explanation:

The SQL statement above queries a database with four tables shipping, orders, market and product. The query returns four columns from two tables orders and shipping, returning only rows with order dates between April 1 and April 15 of 2018. The tables are joined with the primary key order_id and the dates are parsed with the to_date function. The result is also ordered by the order_date

Define bit byte and word

Answers

Explanation:

Definitions. Bit = Binary digIT = 0 or 1. Byte = a sequence of 8 bits = 00000000, 00000001, ..., or 11111111. Word = a sequence of N bits where N = 16, 32, 64 depending on the compute

Mad Libs are activities that have a person provide various words, which are then used to complete a short story in unexpected (and hopefully funny) ways. Complete the program to read the needed values from input, that the existing output statement(s) can use to output a short story. Ex: If the input is: Eric Chipotle 12 cars

Answers

Answer:

statement = input("Enter four words separated by a space: ")

split_list = statement.split(" ")

print(f"{split_list[0]} went to {split_list[1]} to buy {split_list[2]} different types of {split_list[3]}")

Explanation:

The python program uses the input function to get user input from the STDIN and the words gotten are splitted to a list, then the items of the list are used as part of a sentence.

Answer:

Playing around with this and came up with this, it took about an hour before I understood what it was wanting.

first_name = input()

generic_location=input()

whole_number= input()

plural_noun= input()

print(first_name, 'went to', generic_location, 'to buy', whole_number, 'different types of', plural_noun)

Explanation:

I didnt understand it at first until I thought about it.  This would be the answer if you are looking for it.

Which TWO objects are likely to have SSD chips in them?
office access card
bank debit card
food service token
discount coupon
business card

Answers

Bank card and discount coupon

Answer:

Bank card and discount coupon

Explanation:

An IT systems engineer creates a new Domain Name System (DNS) zone that contains pointer (PTR) resource records. Which zone type has been created?

Answers

Answer:

SOA

Explanation:

Statement of Authority, or you could also say that the zone that has been created is a reverse lookup

Write a Python program that uses function(s) for writing to and reading from a file:
a. Random Number File Writer Function
Write a function that writes a series of random numbers to a file called "random.txt". Each random number should be in the range of 1 through 500. The function should take an argument that tells it how many random numbers to write to the file.
b. Random Number File Reader Function
Write another function that reads the random numbers from the file "random.txt", displays the numbers, then displays the following data:
The total of the numbers
The number of random numbers read from the file
c. Main Function
Write a main function that asks the user about how many random number the user wants to generate. It them calls the function in a. with the number the user wants as an argument and generates random numbers to write to the file. Next, it calls the function in b.

Answers

import random

def random_number_file_writer(nums):

   f = open("random.txt", "w")

   i = 0

   while i < nums:

       f.write(str(random.randint(1,500))+"\n")

       i += 1

   f.close()

def random_number_file_reader():

   f = open("random.txt", "r")

   total = 0

   count = 0

   for x in f.readlines():

       total += int(x)

       count += 1

   print("The total of the numbers is "+str(total))

   print("The number of random numbers read from the file is "+str(count))

def main():

   random_number_file_writer(int(input("How many random numbers do you want to generate? ")))

   random_number_file_reader()

main()

I hope this helps!

Will, there be any presents this year

Answers

Answer:

no why

Explanation:

Is data science the sexiest job in 21st century according to Harvard business review?

Answers

Answer:

yuppp

Explanation:

i looked it up lol

1. Write a high level algorithm for cooking a cheeseburger.

2. Write a detailed algorithm for cooking the same cheeseburger.

Answers

Answer:

1.  A high level algorithm for cooking a cheeseburger could be:

Heat fry panCook one side of the hamburgerWaitTurn hamburger upside downPut cheese over hamburgerWaitCut hamburger bread in halfPut cooked hamburger inside breadEnd (eat)

2. A detailed algorithm for cooking a cheeseburger could be:

Place fry pan over the stove heaterTurn on heater (max temp)IF fry pan not hot: wait, else continuePlace raw hamburger on fry panIF hamburger not half cooked: Wait X time then go to line 5, else continueTurn hamburger upside downPut N slices of cheese over hamburgerIF hamburger not fully cooked: Wait X time then go to line 8, else continueTurn off heaterCut hamburger bread in half horizontally Put cooked hamburger on one of the bread halves.Put second bread half on top of hamburgerEnd (eat)

Explanation:

An algorithm is simply a list of steps to perform a defined action.

On 1, we described the most relevant steps to cook a simple cheeseburger.

Then on point 2, the same steps were taken and expanded with more detailed steps and conditions required to continue executing the following steps.

In computational terms, we used pseudo-code for the algorithm, since this is a list of actions not specific to any programming language.

Also we can say this is a structured programming example due to the sequential nature of the cooking process.

If a machine cycle is 2 nanoseconds , how many machine cycles occur each second?

Answers

Answer: 5 × 10^8 cycles per second

Explanation:

First and foremost, we should note that 1 nanosecond = 1 × 10^-9 seconds

We are told that the machine cycle is 2 nanoseconds.

The number of machine cycles that occur each second will them be calculated as:

1 = 2 × 10^-9

= 5 × 10^8 cycles per second

The number of machine cycles that occur each second is 5 × 10^8 cycles per second.

If a system's instruction set consists of an 8-bit opcode, what is the maximum number of output signal lines required for the control unit?
A) 8 B) 64C) 128 D) 256

Answers

Answer:

D. 256

Explanation:

Given

[tex]Instructions = 8\ bit[/tex]

Required

Determine the maximum number of output

To get the required value, we make use of the following:

[tex]Maximum = 2^n[/tex]

Where n is the bits of the opcode.

i.e.

[tex]n = 8[/tex]

Substitute 8 for n in [tex]Maximum = 2^n[/tex]

[tex]Maximum = 2^8[/tex]

[tex]Maximum = 256[/tex]

Hence, option D answers the question

Visual Design includes 4 elements: shapes, texture, lines and form.

Question 6 options:
True
False

Answers

Answer:

Explanation:

The answer is false

Because the 4 elements are shapes texture colour and size

Best of Luck
for your work and
d
Best wishes for you
.​

Answers

oh, why thank you same to you

Awwwww thank you
( please mark brainliest)

Edhesive Intro to CS Code Practice 1.8


I am pretty sure I got it right. But it keeps telling me that I have an EOF error on the E input.

Answers

Questions:

CS Code Practice 1.8  Question 1:

Write a code that accepts the user's age as an input, then print their age in 10 years.

CS Code Practice 1.8  Question 2:

Write a code that accepts a whole number as an input, subtracts 5 and print the answer

Answer:

Question 1:

currentage = int(input("Enter your age: "))

print("Your age in 10 years is "+str(currentage + 10))

Question 2:

userinput = int(input("Enter a whole number: "))

print(str(userinput)+" - "+str(5)+" = "+str(userinput - 5))

Explanation:

There are two questions in this category and I don't know which of them you need; So, I answered both.

Question 1:

This line prompts user for age

currentage = int(input("Enter your age: "))

This line adds 10 to user input and prints the result

print("Your age in 10 years is "+str(currentage + 10))

Question 2:

This line prompts user for a whole number

userinput = int(input("Enter a whole number: "))

This line subtracts 5 from the whole number and prints the result

print(str(userinput)+" - "+str(5)+" = "+str(userinput - 5))

Write the HTML for a paragraph that uses inline styles to configure the background color of green and the text color of white.

Answers

Answer:

The full form of HTML is Hyper Text markup Language

Explanation:

HTML stands for Hyper Text Markup Language. It is a programming language. It is a standard markup language that is designed for the documents to be displaced in the web browser. It is used to structure the content of a web page.

The HTML is

<html>

<body>

<p style="bg-color:green;" "color=white;">This is paragraph study</p>

</body>

</html>

Starting at time 0, a new process p of length 3 arrives every 4 time units. Starting at time 1, a new process q of length 1 arrives every 4 time units. Determine the ATT under FIFO, SJF, and SRT.

Answers

Answer:

A.T= Arrival Time B.T= Burst Time C.T= Completion Time T.T = Turn around Time = C.T - A.T W.T = Waiting Time = T.T - B.T ATT=sum of all Turn-around time / total no of process FIFO (first in first o

Write a value function called sugarScaled with the following three parameters: A real-number scale that defaults to 1.7.
A whole-number naturalSugarLevel that is a sugar amount in grams.
A whole-number artificialSugarLevel that is a sugar amount in grams.
The function adds the two sugar levels, multiplies the sum by the scale, and returns that value from the function.

Answers

Explanation:

const double scale = 1.7;

int sugarScaled(double scale, int naturalSugarLevel, int artifiialSugarLevel){

   return scale * (naturalSugarLevel + artifiialSugarLevel);

}

5.14 Describe how the compare and swap() instruction can be used to provide mutual exclusion that satisfies the bounded-waiting requirement. (15 pts)

Answers

Answer:

Explained below

Explanation:

Compare and Swap(C&S) is simply an atomic operation whereby the compare and swap operations are automatically executed.

Now compare and Swap basically needs 3 arguments namely:

- 2 old values which we will label X and Y

- 1 new value which is written in X that we will call Z

Thus, we now have; C & S = {X, Y, Z}

To explain this well, let X be a variable where X has a value of 7.

Now, if a programmer gives a program me that X be multiplied by 2,then what C&S operation will do is;

I) Y = X where Y is a new variable.

II) Result = C&S(X, Y, X*7)

Variable X is global and this means that mere than one process and more than 1 thread can see the variable X.

Now, if a process named P1 wants multiply the variable X by 7 using C&S operation, it will first make a local copy of variable X (which in this case is now the new variable Y). After that it will atomically compare X & Y and if they are equal, it will replace X with 10X.

However, if they are not equal, P1 will re-read value of X into Y and carry of C&S instruction again.

use the drop-down menus to complete the statements about using column breaks in word 2016

Answers

Answer: layout, section, number, more options

Explanation:

Just did it on edge 2020

Answer:layout

Section

Number

More options

Explanation: got an A on the test

lits q4 plz help...in the end i'll mark brainiest

Answers

HTTPS is a more secure and highly advanced version of http

//CODEvoid f(int a){while(a--) {static int n = 0;int x = 0;cout << "n: " << n++ << " ,x: " << x++ << endl;}}int main(){f(3);return 0;}Question: What is the output of the above code?

Answers

Answer:

The static n variable is incremented twice and the results printed in the console but the output of the x variable remains constant.

Explanation:

The while loop in the C++ source code increments the n variable as the argument of the function "a" is decremented. The n variable output is 0,1, and 2 while the x variable is 0 for every iteration.

Who designed the Apple I computer in 1976?

Answers

Answer:

Steve Wozniak

Answer:

Steve Wozniak

Explanation:

Describe two circumstances where access services might get implemented by organizations please.​

Answers

Answer:

Answered below

Explanation:

Remote access enables access to an organisations network from remote places. Certain conditions require such access. An organisation might require their workforce to work from home especially in this coronavirus health pandemic situation. Therefore remote access is necessary.

Also attending to customers needs, virtual meetings and connections to workers and clients all over the world, can only be made possible by the implementation of secured remote access, by the organisation.

Computer Hardware and Maintenance
Question 1 of 5
A protocol for maintaining technology and supplies may answer
questions such as:
What is the replacement life for each piece of equipment?
All of these answers
What should supplies be ordered?
When will security updates and enhancements be applied?
Submit Ansv

Answers

Answer:

All of these answers

Explanation:

A computer's physical components must be inspected, updated, and maintained over time to keep them functioning at their best. This process is known as hardware maintenance. Thus, option B is correct.

What is the best way for hardware Maintenance?

Regular hardware maintenance typically aids companies in avoiding unforeseen problems like device damage and severe data loss.

Regular hardware repair of servers and other physical parts enables businesses to retain their operational integrity and keep a stable IT infrastructure.

While corrective maintenance entails replacing or repairing a system or its components after they have already failed, preventive maintenance encompasses actions that can be taken to keep the system operating.

Therefore, Preventive and corrective maintenance are the two key elements of system upkeep.

Learn more about Hardware here:

https://brainly.com/question/28146743

#SPJ2

How do entrepreneurs traditionally use computers? check all of the boxes that apply.​

Answers

Answer:

to manage financial records

to e-mail clients

to communicate with clients on social networking sites

to catalog tax records

Explanation:

These are the options;

apply.

to manage financial records

to create advertisements

to communicate with clients on social networking sites

to catalog tax records

to e-mail clients

to complete taxes automatically

to create invoice

A computer which is a machine that make use of instructions to carry out operation in a arithmetic or logical ways through computer programming. Computer is of many help to business today because it can carry out many tasks.Entrepreneurs can traditionally use computers in different ways such as in;

✓ management of financial records

✓e-mailing of clients

✓ communicating with clients on social networking sites

✓ cataloging tax records

select all the apply. Effective presentations

Answers

Answer:are influenced by their setting, are consistent in their message, and are tailored to their audience.

Explanation:

Correct on Edge 2020

Other Questions
Lucy needs to lift a crate to a shelf 20 m high. She does 12,000 J of work on a machine to help her. The machine exerts a force of 500 N to lift the crate. A _________ is a turning effect caused by a force. What type of adaptation do most plants use? If n = 5.3 cm and p = 6.25 cm, what is the measure of angle ? Rodriguez Company pays $342,225 for real estate with land, land improvements, and a building. Land is appraised at $260,000; land improvements are appraised at $104,000; and a building is appraised at $156,000. Required: 1. Allocate the total cost among the three assets. 2. Prepare the journal entry to record the purchase. As the u.s. acquired more terrotory, the differences in regions of the north,south,and the west became an issue that contributed to the political divide of the nation, eventually becoming a main cause of the u.s. civil war Which of the following must be true in order to write a bi-conditional statement?A.) the conditional statement B.) both the conditional statement and its converseC.) the converse of the conditional statement D.) neither the conditional statement nor its converse Helppppp me pleaseeeee. The Joint Commission is the main organization that oversees this for hospital, laboratories, nursing homes, and ambulatory healthclinics?a. Accreditation b. ethics committee c. standards of practiced. risk management department pls help I need the answer quick! What important item was forgotten during the inaugural process with George Washington? PLZ HELP BC MY TEACHER IS NOT A GOOD TEACHER (this is science)Suppose water, carbon dioxide, and nitrogen were not recycled. What effects might this have on life on Earth? Ricky wants to start a farm and grow wheat. Where would be the best place for him to relocate?A. Canadian ShieldB. West CoastC. interior plainsD. Rocky Mountains Mothers Against Drunk Driving (MADD) can BEST be described as which type of organization?A.interest groupB.political action committeeC.nongovernmental organizationD.advocacy group URGENT! I need the answer for number three!What should I replace the word *little* with?? PRACTICE 2Read the text below and correct the underlined errors.For each question, write the correct word in the space provided. They can also save the QR codeimages in their phones and share the QR codes *for* (2) family members and friends. This will helpfacilitate donations to non-governmental organisations (NGOs) such as Kembara Soup Kitchenand Yayasan Generasi Muda just to name a *little* (3). PLEASE PLS PLS PLS HELP ASAP!!! WILL GIVE BRAINLIEST IF RIGHT ANSWERS l will give you 15 pointsHELPPPPPPMEEEEEEEEEEEThe deep blue color of the starch and iodine solution disappears when it reacts with saliva. Which of the following best explains the rate of disappearance of the color when the substances in the test tubes were mixed? Faster in Bath 1 as molecules collide more frequently in Bath 1 than Bath 2 Faster in Bath 2 as molecules collide more frequently in Bath 2 than Bath 1 Faster in Bath 1 as molecules move slower in Bath 1 than Bath 2 Faster in Bath 2 as molecules move slower in Bath 2 than Bath 1 Explain why 49 has two possible square roots Question 3 of 10Which of the following entrepreneurial businesses is most likely to have aglobal impact?A. A restaurant that specializes in regional cuisineB. A business that sellslow cost clothingthat is manufacturedoverseasC. An agency that sends home health aids to the homes of disabledseniorsD. A business that grows and sells local artisanal breads andcheeses How did new tools benefit early farmers? Choose three answers.A.New tools saved early humans labor and time.B.New tools allowed early humans to grow plants without water.C.New tools allowed early humans to plant and harvest more food.D.New tools helped early humans develop new seeds for planting.E.New tools helped early humans prepare the soil and harvest grains quickly.