1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
qaws [65]
3 years ago
10

Write a program to calculate the farthest in each direction that Gracie was located throughout her travels. Add four print state

ments to the lines of code above that output the following, where the number signs are replaced with the correct values from the correct list:
Computers and Technology
1 answer:
zzz [600]3 years ago
5 0

Answer:

If you're given a set of coordinates that Gracie has travelled to, you can find the farthest in each direction with something like this (I'll use pseudocode in lieu of a specified language):

left = right = top = bottom = null

for each location traveled{

    if left == null or location.x < left {

         left = location.x

    }

    if right == null or location.x > right {

         right = location.x

    }

    // note that I'm assuming that the vertical position increases going downward

    if top == null or location.y < top {

          top = location.y

    }

    if bottom == null or location.y > bottom {

          bottom = location.y

    }

}

As for the four print statements and other information, insufficient information is provided to complete that.

You might be interested in
Some cars are 100 percent efficient at converting energy from gasoline to energy of motion.
zalisa [80]
<span>Some cars are 100 percent efficient at converting energy from gasoline to energy of motion.
This is a false statement.
</span>
5 0
3 years ago
Read 2 more answers
Prove whether each argument is valid or invalid. First find the form of the argument by defining predicates and expressing the h
SSSSS [86.1K]

Answer:

The given argument  ∀x (S(x) ∧ (M(x) V D(x)) --> ¬ A(x)) ∧ S(Penelope) ∧ A(Penelope) -->¬ D(Penelope) is valid.

Explanation:

Solution:

Let us Consider following predicates:

M(x): x missed the class

D(x): x got a detention

S(x): x is a student in the class

A(x): x got an A

Now,

We Express the hypotheses and conclusion as:

The hypotheses: ∀x (S(x) ∧ (M(x) V D(x)) -->  A(x)) and S(Penelope) and A(Penelope)

So,

The Conclusion:  D(Penelope)

Thus,

The Argument:

∀x (S(x) ∧ (M(x) V D(x)) -->  A(x)) ∧ S(Penelope) ∧ A(Penelope) -->D(Penelope)

Then,

The given argument is valid or correct and prove using the inference  rule as follows:

Step                      Premises                    Reason (Rule used)

1.  ∀x (S(x) ∧ (M(x) V D(x)) -->  A(x))                Premise

2. S(Penelope) ∧ (M(Penelope)

  V D(Penelope)) --> ¬ A(Penelope)            Universal instantiation

3.  S(Penelope)                                              Premise

4.  A(Penelope)                                              Premise

5. ¬[S(Penelope) ∧ (M(Penelope)

  V D(Penelope))]                                         2,4, Modus Tollens

6. ¬S(Penelope) V (¬M(Penelope)

  ∧ ¬D(Penelope))                                        De Morgan law

7.¬M(Penelope) ∧ ¬D(Penelope)                 3,6,Disjunctive Syllogism

8¬D(Penelope)                                              7, Simplification

Therefore, the given argument ∀x (S(x) ∧ (M(x) V D(x)) --> ¬ A(x)) ∧ S(Penelope) ∧ A(Penelope) -->¬ D(Penelope) is valid.

3 0
4 years ago
Read 2 more answers
What is the difference between false positives on network-based intrusion prevention systems (NIPS) and false positives on netwo
erma4kov [3.2K]

Answer:

False positives on NIPS are just annoyances; false positives on NIPS cause service outages.

Explanation:

NIPS as its name says, are only prevention, a false positive cause only a false alarm in case of.

On the other hand, NIDS are more seriously because they detect the intrusion itself and most of them lock the system so the intrusion won´t repercuse the company, this is why it can cause service outages.

6 0
3 years ago
Read 2 more answers
Descending selection sort with output during execution
FromTheMoon [43]

Answer:

Check the explanation

Explanation:

Please find the code down

def selection_sort_descend_trace(numbers):

i=len(numbers)

print("Output: ")

for num in range(0,i-1):# traversing from 0 to N-2, total N-1 iterations

val=numbers[num]

start=num+1

end=i

t=0

for j in range(start,end):

if(val<numbers[j]):

remember=j

val=numbers[j]

t=1

if(t==1):# swaping onlf if greater number is available

temp=numbers[num]

numbers[num]=val

numbers[remember]=temp

for p in range(i):# printing

print(numbers[p],end=' ')

print("\n")

if __name__ == "__main__":

print("Enter the integers separated by space: ")

numbers=[int(x) for x in input().split(' ')]

selection_sort_descend_trace(numbers)

Taking input as string and splitting with space as delimiter , converting the split part to integer , finally append in the list.

3 0
4 years ago
Which type of chart is used to chart progress over time?
Morgarella [4.7K]

Answer: Timeline

Explanation:

6 0
3 years ago
Other questions:
  • Distingush between Microkernels andexokernels
    9·1 answer
  • Which of the following is NOT true about high-level programming<br> languages?
    9·2 answers
  • System analysis and design
    8·1 answer
  • What does phishing mean?
    9·2 answers
  • Which of the following information would best be displayed throughout the use of a time line
    11·1 answer
  • What data unit is addressed based on the IP address of the recipient?
    8·1 answer
  • VLSI is the process of creating an integrated circuit (IC) by combing thousands of transistors into a single chip. There are two
    11·1 answer
  • The list listOne is a sorted list of numbers that contains 700 elements. The list listTwo is a sorted list of numbers that conta
    8·1 answer
  • 8. What is the order of growth execution time of the push operation when using the LinkedStack class, assuming a stack size of N
    13·1 answer
  • After 4th collision in ethernet, find the maximum time that the adapter waits until sensing the channel again for a 100 mbps bro
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!