473,385 Members | 1,730 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Maths assignment in c++

hey i got this assignment in maths.i really need help guys.the question is below.The program should:

It first clears the screen and then displays the next 3 lines.

a1x + b1y + c1y =d1
a2x + b2y + c2y =d2
a3x + b3y + c3y =d3

The user is then required to input the integer values for a, b, c, d and the required accuracy for which he wants the calculation. ( e.g. 3 decimal places etc.)

The user is then required to select either (1) Gauss Jacobi.
(2) Gauss Seidel.

As final output the number of iterations performed and the correct value for x, y and z should be displayed.
Oct 29 '06 #1
3 2945
Banfa
9,065 Expert Mod 8TB
OK you need to either produce some code or give an indication of what is stopping you producing some code.
Nov 1 '06 #2
OK you need to either produce some code or give an indication of what is stopping you producing some code.
yeah i need to produce some code,actually i need the program code so if uve got some clue plz help.i know that ive got to use for loops but dunno where.have u got any idea?
Nov 4 '06 #3
Banfa
9,065 Expert Mod 8TB
I know that ive got to use for loops but dunno where.have u got any idea?
I see no reason why you'd need loops, you have 3 variable to find (x, y and z) and 3 equations.

That makes it a simultaneous equation which does not require loops, you just need to slog you way through the algebra.

So do you know how to solve simultaneous equations? If you can solve a simple version of your problem on paper you will find it hard to make the computer do it for you so if not read these.

http://www.gcseguide.co.uk/simultaneous_equations.htm
http://www.allaboutcircuits.com/vol_5/chpt_4/14.html


Once you know how to solve a simultaneous equation on paper then you can think about writing a generaic solution that you computer will be able to use to solve any set of 3 equations (assuming that there is a solution).
Nov 6 '06 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

23
by: Paul Rubin | last post by:
OK, I want to scan a file for lines matching a certain regexp. I'd like to use an assignment expression, like for line in file: if (g := re.match(pat, line)): croggle(g.group(1)) Since...
10
by: Andrew Koenig | last post by:
It has been pointed out to me that various C++ books disagree about the relative precedence of ?: and the assignment operators. In order to satisfy myself about the matter once and for all, I...
5
by: CoolPint | last post by:
It seems to me that I cannot assign objects of a class which has a constant data member since the data member cannot be changed once the constructor calls are completed. Is this the way it is meant...
5
by: Scott Gunn | last post by:
Hello All, In VB.Net 2003 why is this the result to a simple maths calculation? 3.53 - 3.52 = 0.00999999046325684 Its not just this one either try this: 1.001 - 0.001 = 0.999999999999989
35
by: nagy | last post by:
I do the following. First create lists x,y,z. Then add an element to x using the augumented assignment operator. This causes all the other lists to be changed also. But if I use the assignment...
9
by: uttre | last post by:
hai to all, i did some programming in Lisp (6 months) & next i want to learn C++. i searched all the archives of "comp.lang.c++" & ACCU too & decided "C++ Primer" 3/e as my text book....
20
by: TimeHorse | last post by:
I would like to gauge interest in the following proposal: Problem: Assignment statements cannot be used as expressions. Performing a list of mutually exclusive checks that require data...
5
by: Ibys | last post by:
Hi, i am just starting to learn javascript, so i am probably doing something very simple wrong. i have read a lot of articles on maths in java, but cant find anything simple enough for my problem. I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.