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
Using a text editor, create a file that contains a list of at least 15 six-digit account numbers. Read in each account number an
Zanzabum

Answer:

See explaination

Explanation:

/File: ValidateCheckDigits.java

import java.io.BufferedWriter;

import java.io.File;

import java.io.FileWriter;

import java.io.IOException;

import java.util.Scanner;

public class ValidateCheckDigits {

public static void main(String[] args) {

String fileName = "numbers.txt"; //input file name

String validFileName = "valid_numbers.txt"; // file name of the output file

//Open the input file for reading and output file for writing

try(Scanner fileScanner = new Scanner( new File(fileName));

BufferedWriter fileWriter = new BufferedWriter( new FileWriter(validFileName))) {

//Until we have lines to be read in the input file

while(fileScanner.hasNextLine()) {

//Read each line

String line = fileScanner.nextLine().trim();

//calculate the sum of first 5 digits

int sum = 0;

for(int i = 0; i < 5; i++) {

sum += Integer.parseInt( line.charAt(i) + "");

}

//Get the last digit

int lastDigit = Integer.parseInt(line.charAt(5)+"");

//Check if the remainder of the sum when divided by 10 is equal to last digit

if(sum%10 == lastDigit) {

//write the number in each line

fileWriter.write(line);

fileWriter.newLine();

System.out.println("Writing valid number to file: " + line);

}

}

System.out.println("Verifying valid numbers completed.");

} catch(IOException ex ) {

System.err.println("Error: Unable to read or write to the file. Check if the input file exists in the same directory.");

}

}

}

Check attachment for output and screenshot

4 0
3 years ago
A unit of measurement that describe the rate that electricity flows through a wire is an
Savatey [412]
AMPERE - a unit of measure for the flow of the current in a circut
8 0
3 years ago
The manufacturer doesn't need it the buyer doesn't want it the user doesn't know they're using it
Vikentia [17]
That means that the production vause a loss in supply and demand
6 0
3 years ago
What is Digital Access, and why is it important for YOUR generation?
Harman [31]

“Our students were born with a mouse in their hands. The pervasive nature of digital culture has altered the way they think, and the way they learn. Education today is completely out of sync with this new reality.” an excerpt from Understanding the Digital Generation. The New ConnectionsThis eye-opening presentation provides a comprehensive look at how the pervasive nature of digital culture has and continues to change the brains of our students. As a result of these changes, they have developed learning styles and preferences which are in contrast to the traditional pedagogical approach. The New Connections provides a clear description of 10 core learning attributes of digital learners, and a pragmatic look at how we can teach effectively in an age when new technologies cascade onto the new digital landscape at an astonishing rate. Because of digital bombardment and the emergence of the new digital landscape, today’s youth process information, interact and communicate in fundamentally different ways than any previous generation before them. Meanwhile, many of us, having grown up in a relatively low-tech, stable, and predictable world, are constantly struggling with the speed of change, technological innovation, and the freedom to access the overwhelming sea of information online—all defining characteristics of the digital world of both today, and the swiftly-approaching future. Strategies That Work provides a comprehensive profile of several core learning attributes of digital learners, and the core teaching, learning, and assessment strategies that can be used to appeal to their digital lifestyle and learning preferences. You’ll gain a clear understanding of various research-based strategies to optimize learning for the digital generation in the new digital landscape.

7 0
3 years ago
Nothin to see here just browsin
velikii [3]

Answer:

What????

What does that mean??????????????????????????????????

4 0
2 years ago
Other questions:
  • Write a Python function merge_dict that takes two dictionaries(d1, d2) as parameters, and returns a modified dictionary(d1) cons
    5·1 answer
  • Why should you delete files from your computer? (multiple answers can be chosen)
    5·2 answers
  • What are examples of some Exotic currencies?
    14·1 answer
  • Changes in the ownership of a file do not change the amount of data that is considered to belong to a user.
    12·1 answer
  • Rebooting the computer is a good troubleshooting technique.<br><br> True<br> False
    6·2 answers
  • You can access various sites on the WWW by using hyperlinks or by______. A. entering a key word for your search B. following dir
    12·2 answers
  • Many major employers routinely monitor the performance of their employees through the computers and telephones they use. Employe
    12·1 answer
  • What output is produced by the following code? Integer first = new Integer(7); Integer second = first; if (first == second) Syst
    15·1 answer
  • Which command is used to copy entire folder structures between volumes or across a network while maintaining all NTFS file permi
    10·1 answer
  • 2. Which of the following is a shortcut key to Exit from any operation?
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!