answer.
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
weqwewe [10]
2 years ago
7

Write a Python function called simulate_observations. It should take no arguments, and it should return an array of 7 numbers. E

ach of the numbers should be the modified roll from one simulation. Then, call your function once to compute an array of 7 simulated modified rolls. Name that array observations.
Computers and Technology
1 answer:
Bas_tet [7]2 years ago
6 0

Answer:

import random

def simulate_observations():

   #this generates an array of 7 numbers

   #between 0 and 99 and returns the array

   observations = random.sample(range(0, 100), 7)

   return observations

#here,we call the function created above and print it

test_array = simulate_observations()

print(str(test_array))

You might be interested in
Explain working principle of computer?​
Sonbull [250]

Answer:

The working principle of the computer system. Computers do the work primarily in the machine and we can not see, a control center that converts the information data input to output. This control center, called the central processing unit (CPU), How Computers Work is a very complex system.

Explanation:

5 0
2 years ago
#Write a function called string_finder. string_finder should #take two parameters: a target string and a search string. #The fun
adoni [48]

Answer:

I am writing a Python program:

def string_finder(target,search): #function that takes two parameters i.e. target string and a search string

   position=(target.find(search))# returns lowest index of search if it is found in target string

   if position==0: # if value of position is 0 means lowers index

       return "Beginning" #the search string in the beginning of target string

   elif position== len(target) - len(search): #if position is equal to the difference between lengths of the target and search strings

       return "End" # returns end

   elif position > 0 and position < len(target) -1: #if value of position is greater than 0 and it is less than length of target -1

       return "Middle" #returns middle        

   else: #if none of above conditions is true return not found

       return "not found"

#you can add an elif condition instead of else for not found condition as:

#elif position==-1    

#returns "not found"

#tests the data for the following cases      

print(string_finder("Georgia Tech", "Georgia"))

print(string_finder("Georgia Tech", "gia"))

print(string_finder("Georgia Tech", "Tech"))

print(string_finder("Georgia Tech", "Idaho"))

Explanation:

The program can also be written in by using string methods.

def string_finder(target,search):  #method definition that takes target string and string to be searched

       if target.startswith(search):  #startswith() method scans the target string and checks if the (substring) search is present at the start of target string

           return "Beginning"  #if above condition it true return Beginning

       elif target.endswith(search):  #endswith() method scans the target string and checks if the (substring) search is present at the end of target string

           return "End" #if above elif condition it true return End

       elif target.find(search) != -1:  #find method returns -1 if the search string is not in target string so if find method does not return -1 then it means that the search string is within the target string and two above conditions evaluated to false so search string must be in the middle of target string

           return "Middle"  #if above elif condition it true return End

       else:  #if none of the above conditions is true then returns Not Found

           return "Not Found"

6 0
1 year ago
An aviation tracking system maintains flight records for equipment and personnel. The system is a critical command and control s
sergeinik [125]

Answer:

offline backup solution

Explanation:

In such a scenario, the best option would be an offline backup solution. This is basically a local and offline server that holds all of the flight record data that the cloud platform has. This offline backup server would be updated frequently so that the data is always up to date. These servers would be owned by the aviation company and would be a secondary solution for the company in case that the cloud platform fails or the company cannot connect to the cloud service for whatever reason. Being offline allows the company to access the database regardless of internet connectivity.

5 0
1 year ago
CHALLENGE ACTIVITY 2.9.1: Coordinate geometry. Determine the distance between points (x1, y1) and point (x2, y2), and assign the
Burka [1]

Answer:

<em>import java.util.Scanner;</em>

<em>public class TestClass {</em>

<em>    public static void main(String[] args) {</em>

<em>        Scanner input = new Scanner(System.in);</em>

<em>        System.out.println("Enter value for x1, x2, y1, y2");</em>

<em>        double x1 = input.nextDouble();</em>

<em>        double x2 = input.nextDouble();</em>

<em>        double y1 = input.nextDouble();</em>

<em>        double y2 = input.nextDouble();</em>

<em>        double xVal = Math.pow((x2-x1),2);</em>

<em>        double yVal = Math.pow((y2-y1),2);</em>

<em>        double distance = Math.sqrt(xVal+yVal);</em>

<em>        System.out.println(distance);</em>

<em>    }</em>

<em>}</em>

Explanation:

The code is written in Java Programming Language.

This code simply implements the formula for the distance between two points given as

distance =\sqrt{(x2-x1)^{2}+(y2-y1)^{2}  )}

The scanner class is used to prompt and receive all the variables that are declared.

Note that we used two special Java methods (Math.pow and Math.sqrt)

7 0
2 years ago
Java uses interfaces to provide the benefits of multiple inheritance. A superclass object is a subclass object. A subclass is of
WITCHER [35]

COMPLETE QUESTION

Which of the following is false?

a. A subclass is often larger than its super class.

b. A super class is object is a subclass object.

c. The class following the extends keyword in a class declaration is that direct super class of the class being declared.

d. Java uses interfaces to provide the benefits of multiple inheritance

Answer:

B) A super class is object is a subclass object.

Explanation:

In object oriented programming, the concept of inheritance is greatly utilized, this refers to deriving a class from another class. The derived class is the sub-class and it is derived from its super class, as a matter of fact in Java programming language, all classes are derived from some other class. Objects are made from classes with their state (fields) and behavior (methods) since objects are made from classes, the objects of the super class will not be the same as that of the subclass.

4 0
2 years ago
Other questions:
  • Refer to the exhibit. pc1 issues an arp request because it needs to send a packet to pc3. in this scenario, what will happen nex
    9·1 answer
  • An online game is played with two dice. In this context, explain what is meant by decomposition in a simple way.
    15·1 answer
  • Topological sort requires only a tiny addition to the DFS algorithms. Exactly one of the following data structures is required t
    9·1 answer
  • A file concordance tracks the unique words in a file and their frequencies. Write a program that displays a concordance for a fi
    6·1 answer
  • Write a class for a Cat that is a subclass of Pet. In addition to a name and owner, a cat will have a breed and will say "meow"
    9·1 answer
  • Assign decoded_tweet with user_tweet, replacing any occurrence of 'TTYL' with 'talk to you later'. Sample output with input: 'Go
    14·2 answers
  • Write a method called makeStars. The method receives an int parameter that is guaranteed not to be negative. The method returns
    6·1 answer
  • Which of the following option is correct about HCatalog?
    14·1 answer
  • A ____ is a software implementation of a computer that executes programs as if it were a real physical computer within the physi
    15·1 answer
  • Design a program that asks the user for a series of names (in no particular order). After the final person’s name has been enter
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!