473,785 Members | 2,349 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Maths assignment in c++

3 New Member
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 2979
Banfa
9,065 Recognized Expert Moderator Expert
OK you need to either produce some code or give an indication of what is stopping you producing some code.
Nov 1 '06 #2
hars2010
3 New Member
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 Recognized Expert Moderator Expert
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
3235
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 there are no assignment expressions in Python, I have to use a temp var. That's a little more messy, but bearable:
10
3324
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 looked at the grammar in the C++ standard. The relative fragments are as follows: conditional-expression: logical-or-expression logical-or-expression ? expression : assignment-expression
5
4834
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 to be? Am I not suppose not to have any constant data member if I am going to have the assignment operator working for the class? Or am I missing something here and there is something I need to learn about? Clear, easy to understand...
5
419
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
2456
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 x=x+ instead of using the augumented assignment, the y and z lists do not change. Why is that? This does not happen when I work with integer data type for example, as shown below. Thanks for your help
9
2113
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. (unfortunatley i tried but Accelerated C++ is not available in India, not even "C++ Primer 4/e). anyway, my question: I want to start doing math only for learning the following skills:
20
2141
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 processing can cause excessive tabification. For example, consider the following python snipet...
5
1760
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 am looking for how to get an IF statement to give me the correct output. I am trying to get it to give me a result for a weeks pay, taking that the code worked before i tried to add the IF statement, to make it that if HoursWorked >= 20, the rate of...
0
9646
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10346
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10157
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10096
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8982
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7504
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6742
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5514
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3658
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.