Answer:
In Python
import random
p1 = 0; p2 =0
while(p1 <10 and p2<10):
p1play = random.randint(1,14)
p2play = random.randint(1,14)
print("Player 1 roll: "+str(p1play))
print("Player 2 roll: "+str(p2play))
if p1play > p2play:
p1+=1
print("Player 1 wins this round")
elif p1play < p2play:
p2+=1
print("Player 2 wins this round")
print()
print("Player 1: "+str(p1))
print("Player 2: "+str(p2))
if p1 > p2: print("Player 1 wins")
else: print("Player 2 wins")
Explanation:
See attachment for complete program where comments were used to explain some lines
How does computer hardware and software work together?
Answer:
Computer software controls computer hardware which in order for a computer to effectively manipulate data and produce useful output I think.
Explanation:
What Are the Components of a Web Address? *
Answer:
What Are the Components of a Web Address?
1.Protocol. The first component of a web address is the protocol, which is also known as the scheme. ...
2.Domain Name. The domain name part of the web address is the unique identifier for the website on the internet. ...
3.Domain Extension. ...
4.Path & Filename.
. Which of these perform real-world activities such as eating, sleeping, walking, and running in virtual worlds?
Answer:
all
Explanation:
Answer:
avatars
Explanation: I just took the test
Libby’s keyboard is not working properly, but she wants to select options and commands from the screen itself. Which peripheral device should she use?
A.
voice recognition
B.
microphone
C.
mouse
D.
compact disk
Which option in a Task element within Outlook indicates that the task is scheduled and will be completed on a later
date?
O Waiting on someone else
O In Progress
O Not started
O Deferred
Answer: D: Deferred
Explanation:
took test
For this exercise, you are going to complete the printScope() method in the Scope class. Then you will create a Scope object in the ScopeTester and call the printScope.
The method will print the name of each variable in the Scope class, as well as its corresponding value. There are 5 total variables in the Scope class, some of which can be accessed directly as instance variable, others of which need to be accessed via their getter methods.
For any variable that can be accessed directly, use the variable name. Otherwise, use the getter method.
Sample Output:
The output of the printScope method should look like this:
a = 5
b = 10
c = 15
d = 20
e = 25
public class ScopeTester
{
public static void main(String[] args)
{
// Start here!
}
}
public class Scope
{
private int a;
private int b;
private int c;
public Scope(){
a = 5;
b = 10;
c = 15;
}
public void printScope(){
//Start here
}
public int getA() {
return a;
}
public int getB() {
return b;
}
public int getC() {
return c;
}
public int getD(){
int d = a + c;
return d;
}
public int getE() {
int e = b + c;
return e;
}
}
Answer:
Explanation:
The following is the entire running Java code for the requested program with the requested changes. This code runs perfectly without errors and outputs the exact Sample Output that is in the question...
public class ScopeTester
{
public static void main(String[] args)
{
Scope scope = new Scope();
scope.printScope();
}
}
public class Scope
{
private int a;
private int b;
private int c;
public Scope(){
a = 5;
b = 10;
c = 15;
}
public void printScope(){
System.out.println("a = " + a);
System.out.println("b = " + b);
System.out.println("c = " + c);
System.out.println("d = " + getD());
System.out.println("e = " + getE());
}
public int getA() {
return a;
}
public int getB() {
return b;
}
public int getC() {
return c;
}
public int getD(){
int d = a + c;
return d;
}
public int getE() {
int e = b + c;
return e;
}
}
What is a key consideration when evaluating platforms?
Answer:
The continuous performance of reliability data integrity will lead to the benefit and profit of the platform's regular structure changes. Cleanliness in the platform whereas addresses the straightforward structure of task performance and adequate data integrity.
User ideas for ro blox? I prefer no numbers or underscores.
do what the other person said
A colleague has written a section of the main body of the same financial report. He has a long paragraph with lots of numbers. You suggest that he make this section easier to read by adding _____.
graphics
a reference
columns
a table
Answer:
a table
Explanation:
Answer: a table
Explanation:
An administrator wants to restrict access to a particular database based upon a stringent set of requirements. The organization is using a discretionary access control model. The database cannot be written to during a specified period when transactions are being reconciled. What type of restriction might the administrator impose on access to the database
Answer:
Time of the day and object restrictions
Explanation:
From the question, we understand that the database is not allowed to be accessed at a certain period of time.
Because this has to do with time (period), the administrator will need to set a time of the day object restriction on the database in order to prevent the users from accessing the database objects
1. Add the following method to the Point class:
public double distance(Point other)
Returns the distance between the current Point object and the given other Point object. The distance between two points is equal to the square root of the sum of the squares of the differences of their x- and y-coordinates. In other words, the distance between two points (x1, y1) and (x2, y2) can be expressed as the square root of (x2 - x1)2 + (y2 - y1)2. Two points with the same (x, y) coordinates should return a distance of 0.0.
public class Point {
int x;
int y;
// your code goes here
}
2. Create a class called Name that represents a person's name. The class should have fields named firstName representing the person's first name, lastName representing their last name, and middleInitial representing their middle initial (a single character). Your class should contain only fields for now.
3. Add two new methods to the Name class:
public String getNormalOrder()
Returns the person's name in normal order, with the first name followed by the middle initial and last name. For example, if the first name is "John", the middle initial is 'Q', and the last name is "Public", this method returns "John Q. Public".
public String getReverseOrder()
Returns the person's name in reverse order, with the last name preceding the first name and middle initial. For example, if the first name is "John", the middle initial is 'Q', and the last name is "Public", this method returns "Public, John Q.".
4. Add the following method to the Point class:
public int quadrant()
Returns which quadrant of the x/y plane this Point object falls in. Quadrant 1 contains all points whose x and y values are both positive. Quadrant 2 contains all points with negative x but positive y. Quadrant 3 contains all points with negative x and y values. Quadrant 4 contains all points with positive x but negative y. If the point lies directly on the x and/or y axis, return 0.
public class Point {
private int x;
private int y;
// your code goes here
}
Answer:
Explanation:
The following code is written in Java and creates all of the methods that were requested in the question. There is no main method in any of these classes so they will have to be called from the main method and call one of the objects created method for the code to be tested. (I have tested it and it is working perfectly.)
class Point {
private int x, y;
public void Point(int x, int y) {
this.x = x;
this.y = y;
}
public double distance (Point other) {
double distance = Math.sqrt(Math.pow((other.x - this.x), 2) + Math.pow((other.y - this.y), 2));
return distance;
}
public int quadrant() {
if (this.x > 0 && this.y > 0) {
return 1;
} else if (this.x < 0 && this.y > 0) {
return 2;
} else if (this.x < 0 && this.y < 0) {
return 3;
} else if (this.x > 0 && this.y < 0) {
return 4;
} else {
return 0;
}
}
}
class Name {
String firstName, lastName;
char middleInitial;
public String getNormalOrder() {
String fullName = firstName + " " + middleInitial + " " + lastName;
return fullName;
}
public String getReverseOrder() {
String fullName = lastName + ", " + firstName + " " + middleInitial;
return fullName;
}
}
Assume in the for loop header, the range function has the three arguments: range (1, 10, 3), if you were to print out the value of the variable
in the for loop header, what will be printed out? List the values and separate them with a comma.
Answer:
1, 4, 7
Explanation:
The instruction in the question can be represented as:
for i in range(1,10,3):
print i
What the above code does is that:
It starts printing the value of i from 1
Increment by 3
Then stop printing at 9 (i.e.. 10 - 1)
So: The sequence is as follows
Print 1
Add 3, to give 4
Print 4
Add 3, to give 7
Print 7
Add 3, to give 10 (10 > 10 - 1).
So, it stops execution.
Computers were originally invented to
Group of answer choices
A.to share information on the Internet.
B.make complex mathematical calculations possible and make tasks easier for humans.
C.to play video games.
Answer:
B
Explanation:
It's B because why would it me made to play video games
Answer:
B
Explanation:
A, the internet didnt exist yet, so it cant be this
C, video games would require computers, so its ruled out on a similar basis as the previous
Which lighting technique can often heighten a dramatic story?
No lighting.
Front lighting.
Natural lighting.
Side or back lighting.
Answer:
side or back lighting
Explanation:
big brain
Def locate_substring(dna_snippet, dna): This function takes in two strings, dna_snippet and dna, where dna_snippet is a substring of dna, and returns all locations of the substring as a list of integers. In other words, dna_snippet may exist in multiple locations within dna; you should return the beginning index position of each occurrence of dna_snippet inside of dna. Example: * Sample DNA snippet (substring): "ATAT" * Sample DNA string: "GATATATGCATATACTT" * The returned position list: [1, 3, 9]
Answer:
In Python. The function is as follows:
def locate_substring(dna_snippet, dna):
res = [i for i in range(len(dna_snippet)) if dna_snippet.startswith(dna, i)]
print("The returned position list : " + str(res))
Explanation:
This iterates defines the function
def locate_substring(dna_snippet, dna):
Check for all occurrence
res = [i for i in range(len(dna_snippet)) if dna_snippet.startswith(dna, i)]
print all occrrence
print("The returned all position list : " + str(res))
Following is the Python program to the given question.
PythonAccording to the question,
DNA Series: GATATATGCATATACTTDNA
Snippet: ATAT
Program: def locate_substring (dna_snippet, dna):
start = 0 while True: start = dna.
find(dna_snippet, start) #finding the first occurrence of dna_snippet in dna.
if start == -1: return # if dna.find() returns -1 yield start #Resumes next execution start += 1dna=input ("Enter the DNA sequence: ") dna_snippet=input
("Enter the DNA snippet: ") print(list(locate_substring(dna_snippet,dna )))
Program Explanation: Defining a function.
An infinite loop is being utilized just to produce the indexes from which dna snippet begins.
Determining the initial occurrence of dna snippet inside dna. storing the new occurrences of dna snippet throughout the starting point.
Whenever dna.find() returns minus one, it means there was no occurrence identified and the method should be exited.
Find out more information about Python here:
https://brainly.com/question/26497128
how to learn python ?
Answer:
See below.
Explanation:
To learn python programming language, first, you have to know the basic. Surely, you may recognize this function namely print()
print(“Hello, World!”) — output as Hello, World!
First, start with familiarizing yourself with basic function such as print. Then step up with arithmetic and declare or assign variable then list.
Here are example of functions:
1.) print(argument) — If argument is a string (word-typed), make sure to use “” or ‘’ or else it’ll output an error and say the argument is not defined.
print(“Hi, Brainly”) will output Hi, Brainly
print(2+3) will output 5
Numerical data or numbers do not necessarily require “ “ or ‘ ‘
print(3+3) will output 6 but print(“3+3”) will output 3+3 which is now a string.
2.) type(argument) - this tells you which data/argument it is. There are
< class ‘str’ > which is string, meaning it contains “ “ or ‘ ‘< class ‘int’ > which is integer< class ‘float’ > which is decimal (20.0 is also considered as float, basically anything that contains decimal is all float type)< class ‘list’ > which is a list. List is something that contains elements within square brackets [ ]etc.
Make sure you also do print(type(argument)) as well so it will print out the output.
3.) Arithmetic
+ is additionEx. print(1+3) will output 4
2. - is subtraction
Ex. print(5-4) will output 1
3. * is multiply
Ex. print(4*5) will output 20
4. ** is exponent
Ex. print(5**2) will output 25
5. / is division
Ex. print(6/3) will output 2 — sometimes will output the float type 2.0
6. % is modulo or remainder
Ex. print(7%2) will output 1
4.) Variables
To assign a variable, use =
An example is:
x = 2
y = 5
print(x+y) will output 7
print(type(x)) will output the < class ‘int’ >
These are examples of what you’ll learn in basic of python - remember, programming depends on experience and always focus on it. Keep practicing and searching will improve your skill at python.
NO LINKS OR I WILL DELETE YOUR FORTNITE ACCOUNT
What can you do with the free version of the splice editor
Answer:
can i have ur fortnite account if u hav one and dont use it :) i only say that cuz u mentioned fortnite
Explanation:
with the free version you can add effects (cheap effects) cut the video, crop some parts. and posting leaves a watermark until u buy money
Answer:
It has a 7 day free trial while your using the free version
Explanation:
Why would an organization need to be aware of the responsibilities of hosting
personal data in its platforms?
Answer:
Providing transparent services for platform customers. Following data protection regulations to avoid disruptions from lack of compliance.
See the lseek_example.c file. Modify the lseek_example.c, such that it reads from an input file (named "start.txt") and will print to an output file (named "end.txt") every (1+3*i)th character, starting from the 1st character in the input file. In other words, it will print the 1st character, then skip 2 characters and print the 4th one, then skip 2 characters and print the 7th one, and so on.
For instance, for input file:
ABCDEFGHIJKLM
It will output:
ADGJM
Iseek_example.c file contant:
// C program to read nth byte of a file and
// copy it to another file using lseek
#include
#include
#include
#include
void func(char arr[], int n)
{
// Open the file for READ only.
int f_read = open("start.txt", O_RDONLY);
// Open the file for WRITE and READ only.
int f_write = open("end.txt", O_WRONLY);
int count = 0;
while (read(f_read, arr, 1))
{
// to write the 1st byte of the input file in
// the output file
if (count < n)
{
// SEEK_CUR specifies that
// the offset provided is relative to the
// current file position
lseek (f_read, n, SEEK_CUR);
write (f_write, arr, 1);
count = n;
}
// After the nth byte (now taking the alternate
// nth byte)
else
{
count = (2*n);
lseek(f_read, count, SEEK_CUR);
write(f_write, arr, 1);
}
}
close(f_write);
close(f_read);
}
// Driver code
int main()
{
char arr[100];
int n;
n = 5;
// Calling for the function
func(arr, n);
return 0;
}
Answer:
See the lseek_example.c file. Modify the lseek_example.c, such that it reads from an input file (named "start.txt") and will print to an output file (named "end.txt") every (1+3*i)th character, starting from the 1st character in the input file. In other words, it will print the 1st character, then skip 2 characters and print the 4th one, then skip 2 characters and print the 7th one, and so on.
For instance, for input file:
ABCDEFGHIJKLM
It will output:
ADGJM
Iseek_example.c file contant:
// C program to read nth byte of a file and
// copy it to another file using lseek
#include
#include
#include
#include
void func(char arr[], int n)
{
// Open the file for READ only.
int f_read = open("start.txt", O_RDONLY);
// Open the file for WRITE and READ only.
int f_write = open("end.txt", O_WRONLY);
int count = 0;
while (read(f_read, arr, 1))
{
// to write the 1st byte of the input file in
// the output file
if (count < n)
{
// SEEK_CUR specifies that
// the offset provided is relative to the
// current file position
lseek (f_read, n, SEEK_CUR);
write (f_write, arr, 1);
count = n;
}
// After the nth byte (now taking the alternate
// nth byte)
else
{
count = (2*n);
lseek(f_read, count, SEEK_CUR);
write(f_write, arr, 1);
}
}
close(f_write);
close(f_read);
}
// Driver code
int main()
{
char arr[100];
int n;
n = 5;
// Calling for the function
func(arr, n);
return 0;
}
Explanation:
The process of saving information to a secondary storage device is called...
Answer:
The process of saving information to a secondary storage device is referred to as embedding.
Explanation:
The process of saving information to a secondary storage device is called embedding.
What is embedding?One technique a writer or speaker could use to lengthen a sentence is embedding. When two clauses fall into the same category, they can frequently be nested inside of one another. For illustration: The baked product was presented by Norman. My sister didn't know about it.
Her thumb had the thorn embedded in the surface there, locked onto something. A person or thing is said to be embedded when it is a highly important or powerful part of that person, item, etc. Guilt was deeply engrained in my conscience.
The embedding strategy modifies each video frame slightly in an attempt to try covert or undetectable data concealing.
Thus, it is embedding.
For more information about embedding, click here:
https://brainly.com/question/16911950
#SPJ6
What is the New York Times doing to try to keep up with digital technology?
Answer:
Clover Food Labs: Using Technology to Bring The “Real Food” Movement to Cambridge, ... The New York Times is one of the many companies that has had its existence ... That monthly limit has since been reduced to 10 articles in an attempt to ... which has at least kept pace with the limited expectations for the industry