Solved

Program to solve Simultaneous Equations invovling 2 unknowns

Posted on 2006-10-19
6
1,869 Views
Last Modified: 2008-02-01
Hi,

I just started Pascal and have an assignement I would really like help with.

Hereis my program, please have a look and update me where I have gone wrong.



/*   Program to Solve 2 Unknown s   */


Program multiplication;subtraction,division;

var
    a,b,c,d,e,f,x,y: integer;

begin
    read(a);
    read(b);
    read(c);
    read(d);
    read(e);
    read(f);
    y:=(c*d-a*f)/(b*d-a*e);
    x:=(c*e-b*f)/-(b*d-a*e);
    write (y);
    write (x);
end.






0
Comment
Question by:souldj
  • 5
6 Comments
 
LVL 6

Accepted Solution

by:
My name is Mud earned 500 total points
ID: 17767977
Program multiplicationsubtractiondivision;  (* Name of Program no punctuation allow *)

var
    a,b,c,d,e,f: integer;                            (* this variables to input values of integer type *)
    x,y: real;                                           (* You can perform divisions on integer variables *)

begin
  read(a);
  read(b);
  read(c);
  read(d);
  read(e);
  read(f);
  y:=(c*d-a*f)/(b*d-a*e);
  x:=(c*e-b*f)/-(b*d-a*e);
  write (y);
  write (x);
End.
0
 
LVL 6

Expert Comment

by:My name is Mud
ID: 17768020
It is always a good thing to output to screen what the program will do and what the user have to do... like...

WriteLn('This program will perform the following formulas:');
WriteLn('y:=(c*d-a*f)/(b*d-a*e)');
WriteLn('x:=(c*e-b*f)/-(b*d-a*e)');

Write('Please enter the value for ''A''');
ReadLn(A);
0
 
LVL 6

Expert Comment

by:My name is Mud
ID: 17768027
x,y: real;                                           (* You can perform divisions on integer variables *)

sorry that should be "You CAN'T"...
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 6

Expert Comment

by:My name is Mud
ID: 17768056
Any question you might have, don't hesitage to post it... TY...
0
 
LVL 1

Author Comment

by:souldj
ID: 17768064
Thanks a lot whatboy!

0
 
LVL 6

Expert Comment

by:My name is Mud
ID: 17768081
Glad I can help...
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Tstream to hex 1 1,644
Setting up Idhttp indy component to use a proxy server 2 1,572
Convert date 6 396
code issue 8 84
A Short Story about the Best File Recovery Software – Acronis True Image 2017
What is Backup? Backup software creates one or more copies of the data on your digital devices in case your original data is lost or damaged. Different backup solutions protect different kinds of data and different combinations of devices. For e…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now