Answer to Question #297109 in C++ for junior

Question #297109

Given the slope-intercept form equation, y = mx+b. Write a program that asks the user to enter values for the respective variables (m, x, and b). Use those variables to calculate the results of the equation. Then print out the values for m, x, b, and y.


1
Expert's answer
2022-02-12T14:38:57-0500
#include <iostream>
using namespace std;




int main(){
	float m, x,b,y;
	cout<<"Ente m: ";
	cin>>m;
	cout<<"Ente x: ";
	cin>>x;
	cout<<"Ente b: ";
	cin>>b;
	y=  m*x+b;
	cout<<"m = "<<m<<"\n";
	cout<<"x = "<<x<<"\n";
	cout<<"b = "<<b<<"\n";
	cout<<"y = "<<y<<"\n";






	system("pause");
	return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog