Write a C++ program that prompt the user to enter the coordinate of two points (x1, y1) and (x2,y2), and displays the slope of the line that connects the two points.

Answers

Answer 1

Answer:

#include<iostream>

using namespace std;

int main(){

   float x1,x2;

   float y1,y2;

   float slope;

   cout<<"Enter the value of first point(x1,y1): ";

   cin>>x1>>y1;

   cout<<"\nEnter the value of second point(x2,y2): ";

   cin>>x2>>y2;

   slope = (y2-y1)/(x2-x1);

   cout<<"Slope is: "<<slope<<endl;

}

Explanation:

First include the library 'iostream' for perform the operation of input/output.

after that, write the main function and declare the variable of points.

use the output command 'cout' for display the message on the screen.

use the input command 'cin' for store the value enter by user into the variable.

after that, use the formula to find the slope:

[tex]slope=\frac{(y_{2}-y_{1})}{(x_{2}-x_{1})}[/tex]

Note: All values declare in the code is float type means decimal value. but you can enter integer value as well.

finally, cout is used to display the output slope on the screen.


Related Questions

how much should an organization consider moving into the cloud before full outsourcing starts making more business sense

Answers

Answer:

47

Explanation:

capital steez

47 hope this helped:))

A collection of computers and other devices that are connected together to enable users to share hardware, software, and data, as well as to communicate electronically with each other is called ______

Answers

The correct answer is: Computer network

A VPN: provides secure, encrypted communications using Telnet. is an Internet-based service for delivering voice communications. is an encrypted private network configured within a public network. is a proprietary networking service technology developed by individual corporations. is more expensive than a dedicated network.

Answers

Answer and Explanation:

VPN is an encrypted private network configured within a public network.

Typical applications are for employees accessing corporate network (private) through Internet (public).  Encryption and credentials contribute to security despite using a public network.

rocessor A has a CPI 1.2 and a clock rate of 1 GHz. Processor B has a CPI of 2.0 and a clock rate of 2 GHz. Processor C has a dock rate of 2.5 GHz (400 ps/cycle) and a CPI of 2.6. All three processors implement the same instruction set. Determine the time per instruction for each processor and write it in the correct spot. Which processor is faster? How many times faster is it than the slowest processor?

Answers

Explanation & answer:

To understand technical questions, it is necessary to understand all technical terms used.

Here,

CPI = cycles per instruction

clock rate = number of cycles the processor generates.

                   1 GHz = 1,000,000,000 cycles per second

                             = 1 nanosecond / cycle.

Processor A

CPI = 1.2 cycles per instruction

Frequency 1 GHz.

time per instruction,

Ta = (1.2 cycles/instr. )/ 1 GHz

= (1.2 cycles / instr. ) / (1 cycle / nanosecond)

= 1.2 nanoseconds / instruction

Processor B

CPI = 2.0 cycles per instruction

Frequency 2 GHz.

time per instruction,

Tb = (2.0 cycles/instr. )/ 2 GHz

= (2 cycles / instr. ) / (2 cycles / nanosecond)

= 1.0 nanosecond / instruction

Processor C

CPI = 2.6 cycles per instruction

Frequency 2.5 GHz.

time per instruction,

Tc = (2.6 cycles/instr. )/ 2.5 GHz

= (2.6 cycles / instr. ) / (2.5 cycles / nanosecond)

= 1.1 nanoseconds / instruction

The fastest is Tb = 1.0 nanosecond/instruction

The slowest is Ta = 1.2 nanoseconds/instruction

The ratio fastest/slowest = 1.2/1.0 = 1.2 times as fast

Note: cycles per instructions (CPI) are always in whole number cycles. CPI for different instructions may vary according to complexity of instruction.  Decimal CPI usually indicates the value is a weighted mean of the set of instructions.

What does technological convergence mean, with examples?

Answers

Answer:

Technological convergence is a term describes the layers of abstraction that enable different technologies t inter operate efficiently as a converged system. Convergent services such as VoIP, IPTV, Smart TV and others tend to replace the older technologies.

Explanation:

As a feature of society convergence can spur economic growth and change how people communicate on a global basis. A good way t evaluate the previous generations, items such as CD player, cassette deck, console TV or corded telephone each served only one function, whereas a single modern handheld computing device can meld several of those functions with hardly any user intervention required.

Final answer:

Technological convergence is the integration of different technologies into new products and services, such as smartphones and smart TVs, that impact various aspects of the economy and society. Countries in the converging economy invest in technology to catch up with leaders, incorporating advancements into their systems to improve productivity and quality.

Explanation:

Technological convergence refers to the trend where technologies that were initially quite distinct and unrelated combine to create new products and services that change how we live and work. Throughout the converging economy, countries invest in both physical and human capital to catch up with technology leaders, thus integrating technology into various aspects of their economies.

Examples of technological convergence include smartphones, which combine the functions of a phone, a camera, a web browser, and a music player, and smart TVs, which incorporate internet streaming, traditional broadcasting, and interactive media. Another example is modern agricultural practices that blend information technology, improved crop genetics, and advanced machinery to increase food production efficiency.

Technology, including new ways of organizing work, like the assembly line, and innovative methods for quality assurance in factories, represents a broad category of both tangible inventions and systemic innovations that drive productivity and quality improvements in numerous industries.

Lisa granted the CREATE TABLE privilege WITH ADMIN OPTION to Sharon. Sharon granted the privilege to Bob. If Lisa’s privileges are revoked, who else will lose their privileges?

A. Only Bob

B. Only Sharon

C. Both Bob and Sharon

D. No one else will lose their privileges

Answers

Answer:

D

Explanation:

As it's not fair if they all lose there privileges

What is the aim of Software Engineering?

Answers

Answer:

The basic objective of software engineering is to develop methods and procedures for software development that can scale up for large systems and that can be used consistently to produce high-quality software at low cost and with a small cycle of time.

Explanation:

Continue to learn. The fact that learning never stops is the most crucial fact that every software developer should understand.

What is the main role of Software Engineering?

Making stable and efficient software is software engineering's main goal. Software engineering's goal is to create high-quality software.

Because particular software is required in practically every sector, business, and function, software engineering is crucial. As time passes, it becomes increasingly crucial: if something fails within your application portfolio, a prompt, effective fix must be made.

The majority of us began our careers with monolithic systems running on company-owned servers. Software was created using antiquated programming languages and had expensive licensing fees.

Therefore, The primary goal of software engineering is to create scalable methodologies and processes for creating software for large systems.

Learn more about Software Engineering here:

https://brainly.com/question/10339061

#SPJ2

Which disc store compacity for full lenght movie? dvd or cd

Answers

DVDS have a lot more available bytes for use compared to a CD. Movies are typically take up a LOT of space- so DVDS are your best option

Discus the pros and cons of Internal cloud service and External cloud service for both Infrastructure as a service and Application as a service.

Answers

Answer:

Internal Cloud:

An Internal Cloud is also known as a Corporate Cloud. It's a cloud computing service model that is implemented within an organization's dedicated resources and infrastructure. It also apply virtualization mechanism, shared storage and network resources to facilitate full control of an organization's cloud environment.

External Cloud:

An external cloud is a cloud solution that exists outside of an organization's physical boundaries. It allows companies to rent software and delivered security over the web, integrated to the back-end system. The services delivering through cloud solution will match that to a private cloud, but all the physical resources are external to the organization.

The Pros and Cons of the cloud services:

On the up side:

1: Fast start-up:

Cloud computing allows you to test your business plan very quickly for little money. It has changed the game of entrepreneurs. On the launch day, you have the confidence that you scale the world.

2: Business agility:

Cloud computing changes the whole world pattern of agility at a much lower cost.

3: Faster product development:

It reduced the moving applications and data time (one cloud to another) drop from weeks to minutes.

On the down side:

1: Bandwidth could bust your budget:

The network cost would be so large that you might buy the cloud storage rather than paying someone else for it.

2: Limited control and flexibility:

Since the remote software is being used, it usually lacks the features of an application running locally.

3: Increased Vulnerability:

As we know that the cloud based solutions are exposed on the public internet and are a more vulnerable target for malicious users and hackers. Nothing on the internet is completely secure and even the biggest players suffers from serious attacks and security breaches.

In order to "print" the data in an object, the class should override the _____ method.

String
toString
StringValue
Value

Answers

Answer:

toString is right Answer

Explanation:

If you want to represent any object as a string, toString() method comes into existence.  

The toString() method returns the string representation of the object.

If you print any object, java compiler internally invokes the toString() method on the object. So overriding the toString() method, returns the desired output, it can be the state of an object etc. depends on your implementation.

Write the formal descriptions of the following sets: (a) The set containing the numbers 5, 9, and 27. (b) The set that contains all the natural numbers less than 2. (c) The set containing the empty string. (d) The set containing nothing at all.

Answers

Answer: a) [tex]=\left \{ 5,\,9,\,27 \right \}[/tex]

(b) [tex]\left \{ x\ : X\varepsilon\mathbb{N} \right \text{and}\ x<2\}= \left \{1 \right \}[/tex]

(c) [tex]\left \{\epsilon \right \}[/tex]

(d) [tex]\left \{\right \}=\phi[/tex]

Explanation:

The formal description of the given sets are as follows :-

a) The set containing the numbers 5, 9, and 27.

[tex]=\left \{ 5,\,9,\,27 \right \}[/tex]

(b) The set that contains all the natural numbers less than 2.

[tex]\left \{ x\ : X\varepsilon\mathbb{N} \right \text{and}\ x<2\}= \left \{1 \right \}[/tex]

(c) The set containing the empty string.

We know that in formal description, the empty string is denoted with [tex]\epsilon[/tex].

Thus, the required set : [tex]\left \{\epsilon \right \}[/tex]

(d) The set containing nothing at all.

[tex]\left \{ \right \}=\phi[/tex]

Explain why, with fast moving mobiles, speed is more dominant in characterizing the use mobility pattern than direction?

Answers

The answer is 42 that is the answer to life

98 POINTS HELP ASAP PLEASE!!!!
You have been asked to create a program for an online store that sells their items in bundles of five. Select the appropriate code that would display how many bundles are available for sale.

A.print(5 // totalItems)
B.print(totalItems // 5)
C.print(totalItems(5) )
D.print(5(totalitems) )

Answers

B. Print(totalitems // 5)

Answer:

B. Print Totalltems // 5

Explanation:

Well, if you learn how to create bundles on Amazon, you can eliminate the competition, set your price, and offer customers a product they’ll absolutely love.

Which of the following is an encryption tool that allows users to encrypt files and folders by simply right-clicking a given object and setting a few options?
a. PowerShell
b. BitLocker
c. Encrypting File System (EFS)
d. Trusted PlatformModule (TPM)

Answers

the answer to this question is C

Final answer:

The encryption tool that enables right-click encryption of files and folders is the Encrypting File System (EFS). It integrates with the Windows file system to protect sensitive data through encryption.

Explanation:

The encryption tool that allows users to encrypt files and folders by simply right-clicking a given object and setting a few options is the Encrypting File System (EFS). When you use EFS, which is a feature available in some versions of the Windows operating system, you can easily encrypt your files and folders to protect sensitive data.

EFS integrates with the file system to provide this seamless encryption process. Other options like BitLocker are used to encrypt entire drives, and PowerShell is a task automation framework, not specifically an encryption tool.

TPM is a hardware-based security feature to store cryptographic keys and does not directly allow users to encrypt files and folders by right-clicking.

A _____ is a modeling tool used in structured systems analysis and design (SSAD) analysis model that helps break down a complex process into simpler, more manageable, and more understandable subprocesses

Answers

A "DATA FLOW DIAGRAM" is a modeling tool used in structured systems analysis and design (SSAD) analysis model that helps break down a complex process into simpler, more manageable, and more understandable subprocesses

Connecting your computers or devices to the ________ immediately exposes them to attack.

A. Ethernet

B. Internet

C. network

D. virtual LAN (VLAN)

Answers

I believe the answer is network.

What is Symmetric and Asymmetric DSL?

Answers

Symmetric DSL. Symmetric Digital Subscriber Line (SDSL) is a kind of one kind of Digital Subscriber Line (DSL) used to provide high-speed Internet connectivity. Symmetric DSL is called “symmetrical” because the upstream and downstream connections have the same bandwidth.

Answer:

Symmetric DSL is called “symmetrical”

Explanation:

_____ is a major factor in the widespread use of global information systems

Answers

Answer:

E-business

Explanation:

Which method will return the first element in an ArrayList employees?

employees.first()
employees.get(1)
employees.get(0)
employees.get()

Answers

Answer:

employees.get(0)

Explanation:

In the programming, the index of ArrayList start from zero.

So, the element start storing in the ArrayList from the zero index.

get() is the function which is used to retrieve or getting the value in the

ArrayList.

The function employees.get(0), it retrieve the element of zero index.

The function employees.get(1), it retrieve the element of first index.

The function employees.first(1), it is wrong calling.

The function employees.get(), it is wrong calling. you have to enter the index value inside the get().

Jack was shocked to witness the sudden drop in performance of his laptop. He also found that the screen saver constant changed and that the taskbar had disappeared. The given problems are symptoms of _____ infections. Select one: a. rootkit b. smishing c. phishing d. bootkit

Answers

Answer: bootkit

This is the answer because the hacker was not trying to get any private information, so a bootkit would be the correct answer. A bookit uses a program to basically destroy your computer from the inside, starting from the motherboard.

Hope this helps!

2. Design a Do-While loop that asks the user to enter two numbers. The numbers should be added and the sum displayed. The loop should ask the user whether he or she wishes to perform the operation again. If so, the loop should repeat; otherwise it should terminate.

Answers

#include <iostream>

#include <string>

main ()

{

   using std::cout;

   using std::cin;

   std::string s;

   do

   {

      cout<<"Type 2 numbers: ";

      int a,b;

      cin>>a>>b;

      cout<<"Sum of your numbers equals to: "<<a+b;

      cout<<"\nType \"Yes\" if you want to continue.";

      cin>>s;

   }while(s=="Yes");

   return 0;

}

Answer:

Program :

#include <iostream> // Header file.

using namespace std;

int main () // Main function which starts the executions

{

   int First_Number,Second_Number; // variable declaration.

   char choice; // Variable declaration.

   do // do while loop

   {

        cout<<"Enter two number for addition"; // user instruction

        cin>>First_Number>>Second_Number; // take a input

        cout<<"The adition of "<<First_Number<<" and "<<Second_Number<<" is: "<<First_Number+Second_Number; //Addition will print

        cout<<"\nType \"Y\" for continue the operation again otherwise press any key"; // User message for choice.

        cin>>choice; // input for choice.

   }

   while(choice=='Y'||choice=='y'); // condition for Do-While loop

   return 0; // return statement.

}

Output:

If the user input are 4,5 and u then the output is 9If the user input are 5,6 and y and 7,8 and u then the output are 11, 15.

Explanation:

The above code is in C++ language.The above program firstly renders a message to enter the two numbers.Then it performs addition operation and then the result will be printed.Then it renders a message for the user choice.If the user enters capital y or small y, then the above operation will continue again.Otherwise, the program will be terminated.

What is Expectation Gap?

Answers

Answer:

According to PakAccountants, "... Expectation gap is the term used to signify the difference in expectations of users of financial statements and auditor's expectation concerning audited financial statements."

“Auditing expectation gap or simply expectation gap is the term used to signify the difference in expectations of users of financial statements and auditor's expectation concerning audited financial statements.” - PakAccounts.com

In the context of intentional computer and network threats a ____ is a programming routine built into a system by its designer

Answers

Answer:

a. backdoor

backdoor (also called a trapdoor) is a programming routine built into a system by its designer or programmer. It enables the designer or programmer to bypass system security and sneak back into the system later to access programs or files.

Answer:

Backdoor

Explanation:

In cellular communication system the appropriate cell shape is circle True/False

Answers

Answer:

True

Explanation:

In cellular communication system the appropriate cell shape is circle.

Is the following an example of social media viral marketing? Indicate your response by selecting yes or no. When you sign onto your favorite social networking website, you get messages from friends who have seen a television show they thought was a "must see!"

Answers

Answer

yo im sorry give me points b

Explanation:

gasefe

how is communication within healthcare different than communication within other industries ?

Answers

Answer:

It has to be more specific and easier to understand because of its importance.

Explanation:

find the inverse function of f(x)= 1+squareroot of 1+2x

Answers

Answer:

Therefore the inverse function of  [tex]f(x)=1+\sqrt{1+2x}[/tex] is [tex]\frac{x^2-2x}{2}[/tex]

Explanation:

We need to find the inverse of function [tex]f(x)=1+\sqrt{1+2x}[/tex]

Function Inverse definition :

[tex]\mathrm{If\:a\:function\:f\left(x\right)\:is\:mapping\:x\:to\:y,\:then\:the\:inverse\:functionof\:f\left(x\right)\:maps\:y\:back\:to\:x.}[/tex]

[tex]y=1+\sqrt{1+2x}[/tex][tex]\mathrm{Interchange\:the\:variables}\:x\:\mathrm{and}\:y[/tex]

[tex]x=1+\sqrt{1+2y}[/tex]

[tex]\mathrm{Solve}\:x=1+\sqrt{1+2y}\:\mathrm{for}\:y[/tex]

[tex]\mathrm{Subtract\:}1\mathrm{\:from\:both\:sides}[/tex]

[tex]1+\sqrt{1+2y}-1=x-1[/tex]

Simplify

[tex]\sqrt{1+2y}=x-1[/tex]

[tex]\mathrm{Square\:both\:sides}[/tex]

[tex]\left(\sqrt{1+2y}\right)^2=\left(x-1\right)^2[/tex]

[tex]\mathrm{Expand\:}\left(\sqrt{1+2y}\right)^2:\quad 1+2y[/tex]

[tex]\mathrm{Expand\:}\left(x-1\right)^2:\quad x^2-2x+1[/tex]

[tex]1+2y=x^2-2x+1[/tex]

[tex]\mathrm{Subtract\:}1\mathrm{\:from\:both\:sides}[/tex]

[tex]1+2y-1=x^2-2x+1-1[/tex]

[tex]\mathrm{Simplify}[/tex]

[tex]2y=x^2-2x[/tex]

[tex]\mathrm{Divide\:both\:sides\:by\:}2[/tex]

[tex]\frac{2y}{2}=\frac{x^2}{2}-\frac{2x}{2}[/tex]

[tex]\mathrm{Simplify}[/tex]

[tex]y=\frac{x^2-2x}{2}[/tex]

Therefore the inverse function of [tex]f(x)=1+\sqrt{1+2x}[/tex] is [tex]\frac{x^2-2x}{2}[/tex]

The binary numbering system uses only two symbols—the digits 0 and 1—to represent all possible numbers. - true or false

Answers

Answer:

True

Explanation:

Binary representation uses only 0 or 1 to represent True = 1, or False = 0. When sequenced with other binary digits, they can form numbers in base 2.

Ex: 0000 equals the number 0

0001 equals the number 1

0010 equals the number 2

0011 equals the number  3

What is the domain and range of the function f(x) = |x - 2| ??

Answers

Answer:

Domain is R, range is x≥0.

Explanation:

You can plug in any value for x to get an outcome for f, however, the outcome is always ≥0.

Which of the following statements is true of offshore outsourcing?a. Improved telecommunication systems have increased its attractiveness.b. The limited availability of the Internet has reduced its effectiveness.c. Reduced bandwidth has increased its efficiency to perform with low latency.d. The increased cost of communication has reduced its popularity.

Answers

Jansjsfajhabsbsbsjs. Hbabajajajajanakslsk. Jshsbsjshsbshdjshjd ds

The correct answer is A. Improved telecommunication systems have increased its attractiveness.

Explanation:

Offshore outsourcing occurs in companies when these transfer or delegate certain roles or responsibilities to other companies abroad. This business strategy is closely related to the use of information and communication technologies or telecommunication systems as it is through these, the main company can conduct its operations in a different region or country.

Due to the development of telecommunications, during the last years outsourcing has become quite popular as nowadays the multiple technologies allow companies to communicate with people all around the world, send documents and papers, create meetings, and other functions that are necessary for companies. Therefore, the statement that is true about offshore outsourcing is "Improved telecommunication systems have increased its attractiveness".

Other Questions
what is the 17th term in the arithmetic sequence in which a6 is 101 and a9 is 83 Please help with Spanish.Fill in the blanks with any noun (for numbers 1 and 2) and verb (for numbers 3 and 4) that would agree with Me gusta (n). 1. Me gusta el __________________, pero no me gusta el _______________. 2.Me gustan los _________________, pero no me gustan los ________________. 3.Me gusta ____________________ en el comedor. 4.Me gusta ______________ y _____________ en el club. The density of a American white oak tree is 752 kilograms per cubic meter. If the trunk of an American white oak tree has a circumference of 4.5 meters and a height of 8 meters, what is the approximate number of kilograms of the trunk?1. 132. 96943. 13,5364. 30, 456 Which of the following events were part of the early evolution of the Church in Russia? Select all that apply. Define metabolism, catabolism, and anabolism. Social health is blank emotional healthA) Same asB) Difference to Why would an author use allusions What is 692,119 rounded to the nearest thousand Decide whether or not the bank should have been required to face these extra cost , & write an argument supporting your position Based on the expert what can the most logically be concluded about Emperor Qian Longs point of view -2,10,-50 next two numbers geometric sequence What state ratified the articles of confederation last The New Deal represented a large change away from the way the American economy andgovernment interacted compared to what had been considered normal for generations. Based onyour reading and personal experience, what are some of the effects of the New Deal that are stilseen and experienced in the United States today? The sum of two numbers is 28. The first number, x, is threetimes the second number, y. AB+C --> AC+B is the general equation for which one of the following types of chemical reactions?A.) CombinationB.) Single-displacementC.) Decomposition D.) Double-displacement If it takes 45 manage to go to pale city from Heflin then it takes another hour and nine minutes to drive back to Ranburne Alabama how long will it take Solve for x(x + 10)(x + 10) = 0 what did the mainland tepanex tribe control that the aztec very much needed and would start a war over? Can someone please help Efficient Homemakers Ltd. makes canvas wallets and leather wallets as part of a money-making project. For the canvas wallets, they need two yards of canvas and two yards of leather. For the leather wallets, they need four yards of leather and three yards of canvas. Their production unit has purchased 44 yards of leather and 40 yards of canvas. Let x be the number of leather wallets and y be the number of canvas wallets. If the profit on a canvas wallet is $25 and the profit on a leather wallet is $40, write a function for the total profit for both wallets.