subject

LANGUAGE IS PYTHON 9.14 LAB: Brute force equation solver

Numerous engineering and scientific applications require finding solutions to a set of equations. Ex: 8x + 7y = 38 and 3x - 5y = -1 have a solution x = 3, y = 2. Given integer coefficients of two linear equations with variables x and y, use brute force to find an integer solution for x and y in the range -10 to 10.

Ex: If the input is:

8

7

38

3

-5

-1

Then the output is:

x = 3 , y = 2

Use this brute force approach:

For every value of x from -10 to 10

For every value of y from -10 to 10

Check if the current x and y satisfy both equations. If so, output the solution, and finish.

Ex: If no solution is found, output:

There is no solution

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 19:20
Write a program that reads a file consisting of students’ test scores in the range 0–200. it should then determine the number of students having scores in each of the following ranges: 0–24, 25–49, 50–74, 75–99, 100–124, 125–149, 150–174, and 175–200. output the score ranges and the number of students. (run your program with the following input data: 76, 89, 150, 135, 200, 76, 12, 100, 150, 28, 178, 189, 167, 200, 175, 150, 87, 99, 129, 149, 176, 200, 87, 35, 157, 189.)
Answers: 3
question
Computers and Technology, 24.06.2019 18:50
Which style did jack use on the vocabulary words in reports?
Answers: 2
question
Computers and Technology, 25.06.2019 08:40
Which of the following statements is incorrect in relation to processes: while, strictly speaking, at any instant of time, the cpu is running only one process, in the course of 1 second, it may work on several of them, giving the illusion of parallelism a process is just an instance of an executing program, including the current values of the program counter, registers, and variables processes can be created when an operating system is booted, created by the user, or a running process can create children processes there is a master process, which when started can last forever, and is not killable
Answers: 3
question
Computers and Technology, 25.06.2019 12:30
What is the purpose of lookup tables in spreadsheet software
Answers: 1
You know the right answer?
LANGUAGE IS PYTHON 9.14 LAB: Brute force equation solver

Numerous engineering and scie...
Questions
question
Mathematics, 28.09.2019 07:10
Questions on the website: 13722361