Answer:
Online text:1,3,4
not online text:2,5
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;
}
}
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
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.
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.
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;
}
}
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
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
When machining rotors, what is the reason for setting the indexing collars to zero?
A. To know how much metal was taken off of each side.
B. To make sure that no cut exceeds .010 inch
C. To determine the proper cut speed of the Brake Lathe.
D. To measure the depth of the grooves on the rotor surface.
Answer:
To determine the proper cut speed of the brake lathe
To determine the proper cut speed of the brake lathe reason for setting the indexing collars to zero.
What is indexing collars?
Thus, they can have a maximum of 256 colors, which is the amount of colors that 8 bits of information can specify (28 = 256). Fewer colors are produced by lower bit depths, which also result in smaller files. At the conclusion of this chapter, in Section 19.8, this is covered.
"Indexed color" refers to the fact that a color table contains the palette—the collection of colors—of the image. A reference (or "index") to a table cell containing the pixel's color is present in each pixel of the image.
By choosing Image Mode Color Table in Photoshop, you can view the table for an indexed color image.
Therefore, To determine the proper cut speed of the brake lathe reason for setting the indexing collars to zero.
To learn more about indexing collars, refer to the link:
https://brainly.com/question/12608731
#SPJ2
. 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
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:
User ideas for ro blox? I prefer no numbers or underscores.
do what the other person said
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.
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 child’s game, War, consists of two players each having a deck of cards. For each play, each person turns over the top card in his or her deck. The higher card wins that round of play and the winner takes both cards. The game continues until one person has all the cards and the other has none. Create a program that simulates a modified game of War.
The computer will play both hands, as PlayerOne and PlayerTwo, and, for each round will generate two random numbers and compare them.
If the first number is higher, PlayerOne’s score is increased by 1 and if the second number is higher, PlayerTwo’s score is increased by 1.
If there is a tie, no score is incremented.
When one "player" reaches a score of 10, that player should be deemed the winner and the game ends.
The range of numbers should be 1-13 to simulate the values of cards in the deck.
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
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:
How should employees behave during interactions with clients and co-works
Answer:always be nice and welcoming
Explanation:
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
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
In a word processing program, under which tab or menu option can you adjust the picture brightness?
Explanation:
You must have selected a picture in order the tab format to be available. you should click the picture then you want to change the brightness for and u under picture tools, on the format tab,in the adjust group, click corrections.grade 11 essay about the year 2020
Answer:
This 2020 have a new normal class because of CO VID-19 Disease have more students and teachers patient the teachers is preparing a module to her/his student and the student is answering are not learning lesson because of the COV ID-19 the whole word enduring to that pandemic and all fronliners is the hero in this pandemic because all frontliners is helping the people to we heal and to healed that virus.
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
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.
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
pharmaceutical company is using blockchain to manage their supply chain. Some of their drugs must be stored at a lower temperature throughout transport so they installed RFID chips to record the temperature of the container. Which other technology combined with blockchain would help the company in this situation?
Answer:
Artificial Intelligence (AI)
Explanation:
Artificial Intelligence (AI)
In this question, the answer is "Artificial intelligence", it is used as the simulation of human intelligence processes by machines, especially computer systems, which is called artificial intelligence.
Expert systems, natural language, voice recognition, and object detection are just a few of the specific uses of AI.Its convergence of blockchain technologies such as AI can accelerate machine learning and allow AI to produce and exchange financial goods.The blockchain enables secure storage and data sharing or anything else of value. In this, the data is analyzed, and insights and derived from it to generate value.Learn more:
Artificial intelligence: brainly.com/question/17146621
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
The computer scientists Richard Conway and David Gries once wrote: The absence of error messages during translation of a computer program is only a necessary and not a sufficient condition for reasonable [program] correctness. Rewrite this statement without using the words necessary or sufficient.
Answer:
A computer program is not reasonably correct if it has no error messages during translation.
Explanation:
First, we need to understand what the statement means, and we also need to identify the keywords.
The statement means that, when a program does not show up error during translation; this does not mean that the program is correct
Having said that:
We can replace some keywords as follows:
absence of error messages := no error messages
how to check if serial interface is dte ot DCE?
If you can see the DTE/DCE cable, you can tell by looking which router has the DCE interface connected to it - the letters "DTE" or "DCE" will either be molded into the connector itself, or if it's an older cable there should be a little piece of tape on the cable that tells you what the interface type is.
Consider two different implementations, M1 and M2, of the same instruction set. There are three classes of instructions (A, B, and C) in the instruction set. M1 has a clock rate of 60MHz and M2 has a clock rate of 80MHz. The average number of cycles of each instruction class and their frequencies (for a typical program) are as follows:
Instruction Class M1-cycles M2-cycles/ Frequency
/instruction class instruction class
A 1 2 50%
B 2 3 20%
C 3 4 30%
a. Calculate the average CPI for each machine, M1 and M2.
b. Calculate the CPU execution time of M1 and M2.
Explanation:
A.)
we have two machines M1 and M2
cpi stands for clocks per instruction.
to get cpi for machine 1:
= we multiply frequencies with their corresponding M1 cycles and add everything up
50/100 x 1 = 0.5
20/100 x 2 = 0.4
30/100 x 3 = 0.9
CPI for M1 = 0.5 + 0.4 + 0.9 = 1.8
We find CPI for machine 2
we use the same formula we used for 1 above
50/100 x 2 = 1
20/100 x 3 = 0.6
30/100 x 4 = 1.2
CPI for m2 = 1 + 0.6 + 1.2 = 2.8
B.)
CPU execution time for m1 and m2
this is calculated by using the formula;
I * CPI/clock cycle time
execution time for A:
= I * 1.8/60X10⁶
= I x 30 nsec
execution time b:
I x 2.8/80x10⁶
= I x 35 nsec
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:
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.