Showing results 1 to 40 of 53
Search took 0.01 seconds; generated 1 minute(s) ago.
Posts Made By: tformed
Forum: C++ Apr 11th, 2008
Replies: 1
Views: 179
Posted By tformed
Question about for loops

Can all for statements be written as while statement. Vice Versa?
Forum: C++ Jul 27th, 2007
Replies: 12
Views: 1,956
Posted By tformed
Re: Problem with Gauss Matrix Code

actually that is the actual code, it came with cd in which i opened and copied pasted. :) thanks for editing my post.
Forum: C++ Jul 27th, 2007
Replies: 29
Views: 6,779
Posted By tformed
Re: Help with Gaussian Elimination

you are right, I have bugged you too much. It's that the professor does not teach but expects great things out of us. This is our final project, yet we only made it as far as using switch statements....
Forum: C++ Jul 27th, 2007
Replies: 29
Views: 6,779
Posted By tformed
Re: Help with Gaussian Elimination

of I understand how this is working little by little, n is the number of variables within the equation including XYZB

but when the number is greater as in lets say 6, it crashes.
Forum: C++ Jul 27th, 2007
Replies: 29
Views: 6,779
Posted By tformed
Re: Help with Gaussian Elimination

explaining would be great mr.iamthwee :)

I placed n in the code below, still shows same.
don't get frustrated with me please. :'(

Like this:


gauss ( 3, A, X, err );
for ( int i = 0; i < n;...
Forum: C++ Jul 27th, 2007
Replies: 29
Views: 6,779
Posted By tformed
Re: Help with Gaussian Elimination

Ok this is what I get now:

int main()
{
float A[20][21];
float X[20];
bool err;
int i,j;
int x,y,z,b;
int n;
Forum: C++ Jul 27th, 2007
Replies: 29
Views: 6,779
Posted By tformed
Re: Help with Gaussian Elimination

but all it does it state the x1 and increments it.

so it give me this

x1:
y2:
z3:

x1:
y2:
Forum: C++ Jul 27th, 2007
Replies: 29
Views: 6,779
Posted By tformed
Re: Help with Gaussian Elimination

Something like this:


int main()
{
float A[20][21];
float X[20];
bool err;
int i,j;
float x,y,z,b;
Forum: C++ Jul 27th, 2007
Replies: 29
Views: 6,779
Posted By tformed
Re: Help with Gaussian Elimination

Don't laugh, as I am a newb to this and trying to learn. And the help from the professor does not help much since English is not his primary language.


int main()
{
float A[20][21];
float...
Forum: C++ Jul 27th, 2007
Replies: 29
Views: 6,779
Posted By tformed
Re: Help with Gaussian Elimination

rofl, now it is asking me for the variables an infinite amount of time.

it just repeats the same statement :(
Forum: C++ Jul 27th, 2007
Replies: 29
Views: 6,779
Posted By tformed
Re: Help with Gaussian Elimination

I have heard of the nested for loop.

Unfortunately I do no know how to apply it with it showing the output of X1, X2, X3 etc.

I might understand the concept of it providing the amount of A[#][#]...
Forum: C++ Jul 27th, 2007
Replies: 29
Views: 6,779
Posted By tformed
Re: Help with Gaussian Elimination

Yes I have heard of that lol, and plus i appreciate your help greatly.
What I have so far:


#include <iostream>
#include <cmath>
using namespace std;
void gauss(int N, // number of unknowns
float...
Forum: C++ Jul 27th, 2007
Replies: 29
Views: 6,779
Posted By tformed
Re: Help with Gaussian Elimination

I am sure I can do it within the code, but during runtime I am not sure how.

This is what professor asks us to do,

Program to solve linear equation with n as demission.
AX=B

a11X1 + a12X2 +...
Forum: C++ Jul 27th, 2007
Replies: 29
Views: 6,779
Posted By tformed
Re: Help with Gaussian Elimination

I modified the program so i can accept user input for the x y z and b values, but how do modify it to accept the number of unknowns?
Forum: C++ Jul 27th, 2007
Replies: 12
Views: 1,956
Posted By tformed
Question Problem with Gauss Matrix Code

I got this code from a book I bought. I wanted to see if it words but it gives me errors.

Here is the source code.


#include&lt;math.h&gt;
#define NRANSI
#include"nrutil.h"
#define SWAP(a,b)
{
Forum: C++ Jul 25th, 2007
Replies: 15
Views: 2,410
Posted By tformed
Help Re: XY Coordinate

The changes made thus far and errors:

Source.cpp :

#include <iostream>
#include <math.h>
#include "xy_coordinate.h"
using namespace std;

void xy_coordinate::input()
Forum: C++ Jul 24th, 2007
Replies: 15
Views: 2,410
Posted By tformed
Re: XY Coordinate

yes?

since it is all in a folder created automatically by visual studio.

The header file is under the header subsection of the project.

If i am incorrect, can you show me how to link the files...
Forum: C++ Jul 24th, 2007
Replies: 15
Views: 2,410
Posted By tformed
Re: XY Coordinate

doesn't the #include "xy_coordinate" link the file? and I am compiling the whole project together...
Forum: C++ Jul 24th, 2007
Replies: 15
Views: 2,410
Posted By tformed
Re: XY Coordinate

I just placed it, but it showed me more errors.

int main (void){
...
}
Forum: C++ Jul 24th, 2007
Replies: 15
Views: 2,410
Posted By tformed
Re: XY Coordinate

ok, I placed this in the source file:

#include "xy_coordinate.h"

now i get 6 errors:

1>source.cpp(8) : error C2084: function 'void xy_coordinate::input(void)' already has a...
Forum: C++ Jul 24th, 2007
Replies: 15
Views: 2,410
Posted By tformed
Re: XY Coordinate

Yes, I have debugged.

Makes me think that a part of the code is missing and that the source code actually goes inside the header.

But then where is the source. O_O

Hopefully I am wrong in this and...
Forum: C++ Jul 24th, 2007
Replies: 15
Views: 2,410
Posted By tformed
Help XY Coordinate

I am working off the code that the professor provided, but for some reason I cannot get it to work. It is giving me errors.

I created a project in Visual Studio.

The header file:

#include...
Forum: C++ Jul 23rd, 2007
Replies: 5
Views: 1,834
Posted By tformed
Is it possible to create a square root program without math.h

I have created a program without using sqrt and the pwr function but instead have used logs and exponent.

The professor said that math.h is not allowed. I am aware that this library is important...
Forum: C++ Jul 19th, 2007
Replies: 6
Views: 7,228
Posted By tformed
Re: Switch Statement with String

Thank you all for your help, I have decided to use maps, I got some help from the text book and managed to get it working, if the professor does not accept the map method then I will do the way that...
Forum: C++ Jul 18th, 2007
Replies: 6
Views: 7,228
Posted By tformed
Switch Statement with String

I am making a program where the user has to input text, and the program outputs the appropriate string.

I made this program using if else statement, but professor said not to use if and else.

So I...
Forum: C++ Jun 15th, 2007
Replies: 24
Views: 1,941
Posted By tformed
Re: Dictionary Proram

nope i don't know why it appeared like that there, but i think i fixed it...i accidentally typed in the cout as cout<<word=="you got google"

i will get back to you if it works, but so far i think i...
Forum: C++ Jun 15th, 2007
Replies: 24
Views: 1,941
Posted By tformed
Re: Dictionary Proram

ok i deleted one of my if statements and it works, but that is one word...what i was doing before is that i had one word with the statement you provided and repeated the statement with another word...
Forum: C++ Jun 15th, 2007
Replies: 24
Views: 1,941
Posted By tformed
Re: Dictionary Proram

I run Visual Studio 2005, write my code in C++, and press ctrl+f5.
the way the professor taught us.
Forum: C++ Jun 15th, 2007
Replies: 24
Views: 1,941
Posted By tformed
Re: Dictionary Proram

I get the following:

conditional expression of type 'std::basic_string<_Elem,_Traits,_Ax>' is illegal
1> with
1> [
1> _Elem=char,
1> _Traits=std::char_traits<char>,
1> _Ax=std::allocator<char>
1>...
Forum: C++ Jun 15th, 2007
Replies: 24
Views: 1,941
Posted By tformed
Re: Dictionary Proram

but how do i apply it? lol
Forum: C++ Jun 15th, 2007
Replies: 24
Views: 1,941
Posted By tformed
Re: Dictionary Proram

if you recommend std::strings then i will go for it...but may I ask what are the differences or the pros and cons of each
Forum: C++ Jun 15th, 2007
Replies: 24
Views: 1,941
Posted By tformed
Re: Dictionary Proram

#include<iostream>
#include<string>
usingnamespace std;
int main ()
{
char apple[100];
char google [80];
cout<< "word to define: \n";
if ( scanf_s ( "%s", apple, 100 ) == 1 )
{
Forum: C++ Jun 15th, 2007
Replies: 24
Views: 1,941
Posted By tformed
Re: Dictionary Proram

c++....and also i am using now cout and cin
Forum: C++ Jun 15th, 2007
Replies: 24
Views: 1,941
Posted By tformed
Re: Dictionary Proram

I am still trying...i got it to accept words/string and displays the result, but shows the same result for any word....i am still working...i am modyfing the code some more... will post back

i get...
Forum: C++ Jun 8th, 2007
Replies: 30
Views: 7,332
Posted By tformed
Re: Square root program without sqrt or pwr

lol, will check out my local bookstore and amazon. the book i use was required by the professor.

also, i did use "" but it still appeared with normal text.
Forum: C++ Jun 8th, 2007
Replies: 30
Views: 7,332
Posted By tformed
Re: Square root program without sqrt or pwr

ok i will replace then, but then why is the cpp book explaining that one must use stdio.h and math.h if it is wrong.

just to let you know that i am still in chapter three :(
Forum: C++ Jun 8th, 2007
Replies: 30
Views: 7,332
Posted By tformed
Re: Square root program without sqrt or pwr

nope, i am using c++...as it has the extension of .cpp

I edited by warning so it would be shorter, must have taken out the pp at the end. :D

I am working from a book also, reading and trying.
Forum: C++ Jun 7th, 2007
Replies: 24
Views: 1,941
Posted By tformed
Dictionary Proram

I am to create a program in which the user puts in a word and the program displays the definition. The words are 20 words I select.

I have a comon idea on how to achieve this, but I never scaned...
Forum: C++ Jun 7th, 2007
Replies: 30
Views: 7,332
Posted By tformed
Re: Square root program without sqrt or pwr

Ok, I got it working by replacing the ln with log. :P

i get some warnings, which I will ignore for the time being. (I have everything defined as float, it tells me that conversion from double to...
Forum: C++ Jun 7th, 2007
Replies: 30
Views: 7,332
Posted By tformed
Re: Square root program without sqrt or pwr

I keep on getting the following as an error:

'ln' undefined; assuming extern returning int

do i need to define ln? If so, what value?
Showing results 1 to 40 of 53

 
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 7:24 am.
Newsletter Archive - Sitemap - Privacy Statement - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC