Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Program to solve Simultaneous Equations invovling 2 unknowns

Posted on 2006-10-19
6
Medium Priority
?
2,039 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 2000 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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

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

Take a look at these 6 Outlook Email management tools which can augment the working and performance of Microsoft Outlook to give you a more rewarding emailing experience.
Aerodynamic noise is the cause of the majority of the noise produced by helicopters. The inordinate amount of noise helicopters produce is a major problem in the both a military and civilian setting. To remedy this problem the use of an aerogel coat…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Screencast - Getting to Know the Pipeline
Suggested Courses

926 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