Solved

Program to solve Simultaneous Equations invovling 2 unknowns

Posted on 2006-10-19
6
1,900 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
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
USB Flash Drive Serial Numbers 9 4,023
JSon parser in Delphi 1 6,965
In Delphi VCL, TDatePicker, how do you force the combobox to open? 2 352
proper way to parse text with delphi 7 138
Some of the SEO trends we might expect in 2017.
The business world is becoming increasingly integrated with tech. It’s not just for a select few anymore — but what about if you have a small business? It may be easier than you think to integrate technology into your small business, and it’s likely…

839 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