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
anyanavicka [17]
2 years ago
13

Ask the user for five-coordinate pairs. Store each pair as a tuple, and store all the pairs in a list. Print the slope between a

djacent coordinate pairs. So, if you end up with a list of coordinate pairs like this:
[(1, 2), (2, 3), (-3, 3), (0, 0), (2, 6)]
… then your program should print the following slopes:

Slope between (1, 2) and (2, 3): 1.0
Slope between (2, 3) and (-3, 3): 0.0
Slope between (-3, 3) and (0, 0): -1.0
Slope between (0, 0) and (2, 6): 3.0
You’ll need to pack the two values you retrieve from the user into a tuple.

As you go through your pairs of tuples, you can also unpack the variables in them into x1, y1, x2, and y2. That way, computing the slope is as simple as:

slope = (y2 - y1) / (x2 - x1)
Computers and Technology
1 answer:
Margaret [11]2 years ago
8 0

Answer:

y=(1/2) x+3

Explanation:

You might be interested in
The hardware to keep the output data when finished is a
Bess [88]
I believe the answer is modem
4 0
3 years ago
Modify the WordCount program so it outputs the wordcount for each distinct word in each file. So the output of this DocWordCount
stepladder [879]

Answer and Explanation:

package PackageDemo;

import java.io.IOException;

import org.apache.hadoop.conf.Configuration;

import org.apache.hadoop.fs.Path;

import org.apache.hadoop.io.IntWritable;

import org.apache.hadoop.io.LongWritable;

import org.apache.hadoop.io.Text;

import org.apache.hadoop.mapreduce.Job;

import org.apache.hadoop.mapreduce.Mapper;

import org.apache.hadoop.mapreduce.Reducer;

import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;

import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;

import org.apache.hadoop.util.GenericOptionsParser;

public class WordCount {

public static void main(String [] args) throws Exception

{

Configuration c=new Configuration();

String[] files=new GenericOptionsParser(c,args).getRemainingArgs();

Path input=new Path(files[0]);

Path output=new Path(files[1]);

Job j=new Job(c,"wordcount");

j.setJarByClass(WordCount.class);

j.setMapperClass(MapForWordCount.class);

j.setReducerClass(ReduceForWordCount.class);

j.setOutputKeyClass(Text.class);

j.setOutputValueClass(IntWritable.class);

FileInputFormat.addInputPath(j, input);

FileOutputFormat.setOutputPath(j, output);

System.exit(j.waitForCompletion(true)?0:1);

}

public static class MapForWordCount extends Mapper<LongWritable, Text, Text, IntWritable>{

public void map(LongWritable key, Text value, Context con) throws IOException, InterruptedException

{

String line = value.toString();

String[] words=line.split(",");

for(String word: words )

{

Text outputKey = new Text(word.toUpperCase().trim());

IntWritable outputValue = new IntWritable(1);

con.write(outputKey, outputValue);

}

}

}

public static class ReduceForWordCount extends Reducer<Text, IntWritable, Text, IntWritable>

{

public void reduce(Text word, Iterable<IntWritable> values, Context con) throws IOException, InterruptedException

{

int sum = 0;

for(IntWritable value : values)

{

sum += value.get();

}

con.write(word, new IntWritable(sum));

}

}

}

8 0
3 years ago
Universal Containers has a requirement to integrate Salesforce with an external system to control record access.
Alenkasestr [34]

Answer:

C.  Use the SOAP API to maintain the related SObject_share records

Explanation:

In order to ensure that Universal Containers have complete control over the system, the company needs to use certain requirements. This is to ensure that non-authorized persons do not have any access to the information. Based on the information provided in the question, the correct option is option C.

3 0
3 years ago
Consider the following code segment: theSum = 0.0 while True: number = input("Enter a number: ") if number == ": break theSum +=
Strike441 [17]

n where n is the number of chances user takes to enter a blank number and n>=1.

<u>Explanation:</u>

The loop starts with a universal condition where it is initialized using a true value. Hence the iteration count goes to 1. The user is asked to enter a number after 1st iteration. If number is a blank number, the loop is terminated, else the loop goes on until the users enters a blank number. Hence the iterations depend on the number of chances taken by the user to enter a blank number. Since the user is going to enter a number at least once, the minimum value of n will be 1.

4 0
3 years ago
You are trying to access WiFi network at a coffee shop. What protocol will this type of wireless networking most likely use?
monitta
The answer to your question is a password
3 0
3 years ago
Other questions:
  • Solve system of equations. <br>x+2y-z=4<br>2x-y+3z=8 <br>-2x+3y-2z=10
    12·1 answer
  • which student organization helps students with career development by having them become interms to sponsor conferences?
    9·1 answer
  • What natural boundary separated british territory from louisiana?
    7·1 answer
  • A computer that no longer works after having minor repair works done to it may have been damaged by
    8·2 answers
  • The file type ____ identifies a word 2013 document.
    11·1 answer
  • In Python, arrays are usually reserved for
    12·1 answer
  • Why should ERP architecture include a discussion on organizational structure, business processes, and people, instead of just in
    5·1 answer
  • A small business has suffered from a cyber attack, what could be the resultant damage​
    10·1 answer
  • A musical time measurer is a(an)
    10·1 answer
  • Select one or more of the following: Which of these events will cause signal(s) to be generated by the kernel (the operating sys
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!