UberJoker 0 Junior Poster in Training

Hi guys. Feels great to post back on DaniWeb. Hope everyone is doing great!

I am currently playing around with the google websearch api. They have a javascript example where they created a "hello world" page.

https://developers.google.com/web-search/docs/

This code only returns 8 pages of each type of search. I was wondering how can I get it to return more? Becasue for example, if i search directly on google for something, it returns millions of results. This only returns 8 pages. How can i get it to return more? also, how can I get the count of the number of pages that were returned?I was looking at some documentation and the functions but couldnt find anything useful for what im trying to do. What do you guys suggets?

Thanks in advance!

UberJoker 0 Junior Poster in Training

I see. I was looking into that a little but could not find anything in c# that i could just add to my existing c# server. Any links/tips on that of where I could start? Thanks for the reply :). Appreciate it.

UberJoker 0 Junior Poster in Training

Hey guys. hope everyone is doing well. I am trying to make a custom asp.net server just for the heck of it. turns out its quite a task!. I managed to get some code off the internet for a simple server, but it doesnt support asp.net pages. I looked into cassini, but then I might as well use IIS. My question is, is anybody aware of any server source code that I can get, modify it as I please and compile it and run my asp.net pages on it? Alternatively, is there a way that I can add asp.net support to my existing server(the server is in c#...). I have done a lot of research on the net, but coudnt find anything. any help would be greatly appreciated. Thanks!

UberJoker 0 Junior Poster in Training

umm...look into "big o" notations. i think that's what you are looking for. take a look at this.
http://www.cplusplus.com/forum/beginner/15528/
might help.

UberJoker 0 Junior Poster in Training

you mean you want to actually know whats going on during the sorting?...for that read the theory behind it. i am not sure sure how you can actually "experience" the complexity of a sorting function unless you do it in your head :)

UberJoker 0 Junior Poster in Training

you just want to know how many operations the sort function does?.

UberJoker 0 Junior Poster in Training

well actually im gonna say he has it defined...but its not doing anything. its a empty method. looks like you just got this code from somewhere. understand what you need to do first and then research about it. look at this site and see what getmem() does and see if you really need it or you can use something else

http://www.codeguru.com/cpp/tic/tic0202.shtml

UberJoker 0 Junior Poster in Training

because you have declared it as extern...and i dont see you including any external .cpp files here. remove the extern and test it.

UberJoker 0 Junior Poster in Training

why are you making it to be iostream.h?...just make it iostream. i believe the .h is not used anymore. but i might be a little off. in any case, just using the iostream should be good enough. also, include this. #include <cstdlib> and see how it works. out. i suggest you also find libraries that dont use the .h extension.

UberJoker 0 Junior Poster in Training

if you want to simply stop at 1 less than the char you input then simply stop the recursive call and make it like this.

void f(char ch)

    {

     if (('A' <= ch) && (ch <= 'H'))

        {

              ch = ch -1;   // <-- see this?

              cout << ch;

        }

     else

     cout << endl;

     }
UberJoker 0 Junior Poster in Training

#include <iostream> and try it. I hope you actually have a method called int fork();. good luck.

UberJoker 0 Junior Poster in Training

I am able to get the file names with current script.

$dir = "var/www";
$dh = opendir($dir);
while (($file = readdir($dh)) !== false) {
echo "<A HREF=\"$file\">$file</A><BR>\n";
}

but the www folder is local. i wanted to get the file names on my windows server which has the following address
10.25.56.113

so i tried putting in http://10.25.56.113/images/"
as i want the file names in the "images" folder on that server. but its not working.

its giving out the following errors


Warning: opendir(http://10.25.56.113/images) [function.opendir]: failed to open dir: not implemented in /var/www/UpdateImageNames.php on line 12

Warning: readdir(): supplied argument is not a valid Directory resource in /var/www/UpdateImageNames.php on line 16

Warning: closedir(): supplied argument is not a valid Directory resource in /var/www/UpdateImageNames.php on line 24
http://10.25.56.113/images/PlayerOnePictures/mario.gif

any tips?

UberJoker 0 Junior Poster in Training

the servers are on my HDD. they are local. and since i have bridged the adapters, they do acquire different IP's everytime. i need to have them bridged. any ideas?

UberJoker 0 Junior Poster in Training

So what im doing is actually in php, but just wanted to know whats the working logic of what im trying to do. I currently have 2 servers(virtual machines). i have a php file in ubuntu server that calls some other files on the windows server and vice versa. as of now, i am able to call the files just fine. the problem im having is the ip changes every time i reboot the machines(duh;). so i have to manually go change the ip address every time in my php files for them to find the other server. is there a way that each server gets the ip of the other automatically so i dont have to do it manually?. I hope my question was clear.any help is greatly appreciated. thanks.

UberJoker 0 Junior Poster in Training

Hey Guys. So something happened and everything just works now. I didnt touch it and it miraculously started working lol. Anyway thanks a lot for your help and support everyone. Im gonna post all the procedures i went through to make everything work(although im not sure which part actually made it work eventually) just in case anyone in the future looks at this post.

1) Install Apache2 - better from synaptic package manager because it auto configures a lot of things for you. alternatively you can run the following command - sudo apt-get install apache2

2)Install Perl - perl is actually installed on linux by default. to check version you can type perl -v. if nothing is returned then you might want to install perl from synaptic package manager as well. Even after you install it from there, run this command, just in case you forgot to install the mod.
apt-get install libapache2-mod-perl2

3)edit apache2.conf file by doing this - sudo gedit /etc/apache2/apache2.conf

put the following lines in the file

Alias /perl/ /var/www/
PerlModule ModPerl::Registry
<Location /perl/>
allow from all
SetHandler perl-script
AddHandler cgi-script .cgi .pl
PerlHandler ModPerl::Registry
#PerlHandler ModPerl::PerlRun
Options +ExecCGI
#PerlSendHeader On
</Location>

4) restart apache2 - sudo /etc/init.d/apache2 restart

5)I am assuming you have a perl script you want to run. So im not gonna go over that. once you have all this done, put your perl script in …

UberJoker 0 Junior Poster in Training

Thing is, everything is working through command line. I figured that the cgi-bin folder is actually in usr/lib and thats where the perl file needs to be(or atleast thats where people usually put it). so its in there, and i can pull it up directly using localhost/cgi-bin/firstscript.pl-->this runs the code. the ajax function runs the php code, but not the perl code(I am just restating my problem ;). All of my TA's are a**hole racist people(seems like they dont like Indians), and refuse to help me. You guys are all I have :). I have been at this for 2 days now and I still cant figure out why the ajax function wont run the script. Thanks for being patient guys. Really appreciate it.

UberJoker 0 Junior Poster in Training

Hey. The server is local. I am running everything on my machine. I tested the perl script and it runs on the browser. 2 things i must confirm about its installation. I think that could be the problem(because php runs just fine with that ajax function). First is, does the perl file it self need to be in a folder called cgi-bin inside of /var/www? . mine is in www folder where all the other files are. even if i make a cgi-bin folder inside of www and put the perl file in there, the perl script doesnt run even with the correct address. i put the following lines inside of my apache2.conf for perl.

Alias /perl/ /var/www/

PerlModule ModPerl::Registry

<Location /perl/>
allow from all
SetHandler perl-script
AddHandler cgi-script .cgi .pl
PerlHandler ModPerl::Registry
#PerlHandler ModPerl::PerlRun
Options +ExecCGI
#PerlSendHeader On
</Location>

currently, this is how i pull up my perl script on the browser. Another thing is, I need to use a ajax function to call the perl script.

localhost/firstscript.pl

if this reveals any problems, please let me know :P

UberJoker 0 Junior Poster in Training

Also, this exact script works with php. i create a test php file and replaced the firstscript.pl with test.php in the ajax code. i had a simple echo statement in the php file. and it executed it. but perl doesnt execute the code. the ajax function prints the contents of the perl file :(. i dont know what to do.

UberJoker 0 Junior Poster in Training

BTW just a heads up. that example was directly from w3schools.com. Here is a link to the example page.
http://www.w3schools.com/ajax/ajax_browsers.asp

so they use text files to show their example. I simply replaced that with my perl file and was checking if that works. but it ends up just printing the content of the perl file. i want it to execute :).

UberJoker 0 Junior Poster in Training

yep. I came to the exact same conclusion. take a look at this test file.

<html>
<head>
<script type="text/javascript">
function loadXMLDoc(url)
{
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open("GET",url,false);
xmlhttp.send(null);
document.getElementById('test').innerHTML=xmlhttp.responseText;
}
</script>
</head>

<body>

<div id="test">
<h2>Click to let AJAX change this text</h2>
</div>
<button type="button" onclick="loadXMLDoc('firstscript.pl')">Click Me for perl</button>

</body>
</html>


now when i push the button, the function simply returns the data of the perl file on the browser instead of actually executing it. i am not sure how to make it execute.

UberJoker 0 Junior Poster in Training

thats my question. I am so confused how to "send" a request to perl to run it self.

UberJoker 0 Junior Poster in Training

Hi,

a Perl script can be invoked using HTTP request. You need to know how to invoke it. Do you want to use a GET? a POST? are you sending more extra data?

You can use some libraries to ease your call (prototype, jquery, etc.)


i.e. Using jQuery:

<script>
$.get("yourperlscript.pl") // if it's a GET

//or

$.post("yourperlscript.pl") // if it's a post.

// if you want to send more data you can use a second parameter like this:

$.post("yourperlscript.pl", {"greet":"hello"})

</script>


HTH

.::AleX::.

Hey Alex. I prefer post method because then the data will be hidden from the user. But I dont understand what exactly you are trying to say. how exactly would get or post invoke the perl script?

UberJoker 0 Junior Poster in Training

Hey Guys. I cant actually think of a way to do this. Let me rephrase my question. I essentially want a perl script to run based on something that i am doing in javascript. for example:

<javascript>
if(x == 1)
{
then run the perl script.
}
</javascript>
i dont even want perl to return anything back to the JS or anything of that nature. I just want it to simply run because im making it do a bunch of other things. I hope my question is clear. Any help would be greatly appreciated. Thanks.

UberJoker 0 Junior Poster in Training

So I am very confused about XML in general. according to the things i read about it, its not a programming language. its not used to display anything. basically they even say it does nothing. then the question arises....WHY is it used?WHERE is it used?and HOW is it used?....i tried reading documents online(i read all the pages on xml in w3schools.com) but none of them made it clear to me as exactly why xml is useful in anyway. And if it is, then how exactly can i use it? I am not able to understand the concept of XML. Any inputs are greatly appreciated :).

UberJoker 0 Junior Poster in Training

Hey pretty good. Like I said before, I left you the part to figure out how to count the string length. setting the loop too high would output rubbish and too low would miss chars. But if it works...it works :). So why were you using pointers in the first place?. I avoid using pointers at all costs, unless I absolutely have to. But anyway. Good luck modifying it.

UberJoker 0 Junior Poster in Training

Well I did understand your question. But its just that I dont like working with pointers when there are other ways around. What I am doing is i am inserting a newline in the white space as you said, just for being able to print words on separate lines. if you don't want that,it can be avoided as well. But its not any different than you inserting the "<---" symbol when you print out your code. The original string is still intact. I tried to understand your code but wasn't able to. seems like you want to do this with pointers. I can tell you a few things. Your getlastword() method is not doing anything. it just returns all the words. seems like you are aware that if you run the loop more than the strings length, its gonna output malicious data. it is always helpful to give variables meaningful names :). Ok. I understand this is not the way you want the program to be, but if its worth anything, I think this does what you want.

#include <iostream>


using namespace std;

class WordExtractor 
		  {
			public:
			WordExtractor(){}
			void StringWordExtractor(char[]);
		  };

void WordExtractor::StringWordExtractor(char MyString[])
		  {
			
			int counter=0;
			
			for(int x=0;x<30;x++)
			   {
				if(MyString[x] != 0)
				  {
					counter++;	     
				  }
			   }
			
			
			int SecondCounter=0;
			int ThirdCounter=0;
			int CountingSpacesArray[200]={0};
			 
			for(int j=0;j<counter;j++)
			   {
				if(MyString[j] != ' ')
				  {
					
					SecondCounter++;
				  }
	
				if(MyString[j] == ' ')
				  {
					
					CountingSpacesArray[ThirdCounter] = j;
					ThirdCounter++;

				  }
	
			
				  
				
			   }
			
			cout<<"You Entered A Total of "<<ThirdCounter+1<<" Words"<<endl;
			int constCounter=0;
			int space[10]={0};
			for(int h=0;h<counter;h++)
			   {
				if(h …
UberJoker 0 Junior Poster in Training

okk...I didn't feel like reading your code. here is a little program that will give you the number of words you entered(i hope it gives you a rough idea about how to do this program). it gets the user input and puts it in an array. there are still a couple of things you will need to figure out. one is how many letters have been input. because you will have to set the for loops counters accordingly. otherwise its going to output rubbish data if you set it too high and will miss some characters from the string if you set it too low. second, how do you want to get that last characters of word. that also should be quite east. The last word comes after the second last space character which has been calculated in this program already. I am sure people can come up with better methods to do this. But this is what i thought of :).good luck. hope this helps.

#include <iostream>


using namespace std;

class WordExtractor 
		  {
			public:
			WordExtractor(){}
			void StringWordExtractor(char[]);
		  };

void WordExtractor::StringWordExtractor(char MyString[])
		  {
			
			int counter=0;
			
			for(int x=0;x<30;x++)
			   {
				if(MyString[x] != 0)
				  {
					counter++;	     
				  }
			   }
			
			
			int SecondCounter=0;
			int ThirdCounter=0;
			int CountingSpacesArray[200]={0};
			 
			for(int j=0;j<counter;j++)
			   {
				if(MyString[j] != ' ')
				  {
					
					SecondCounter++;
				  }
	
				if(MyString[j] == ' ')
				  {
					
					CountingSpacesArray[ThirdCounter] = j;
					ThirdCounter++;

				  }
	
			
				  
				
			   }
			
			cout<<"You Entered A Total of "<<ThirdCounter+1<<" Words"<<endl;
			int constCounter=0;
			for(int h=0;h<counter;h++)
			   {
				if(h == CountingSpacesArray[constCounter])
				  {
					MyString[h] = '\n';
					constCounter++;
				  }

			   }
			for(int a=0;a<counter+counter;a++)
			   {
				  
					cout<<MyString[a]; 				  

			   } …
UberJoker 0 Junior Poster in Training

humm...couple of thing might help you.
1)you never prompt the user to enter a BMI
2)you never asked for height or weight before asking for new ones.
3)you need to set DoItAgain to false inside the loop to end the loop. your little if statement needs to be inside the loop.

hope that helps

UberJoker 0 Junior Poster in Training

couldn't you just use the standard substr() method to get that last word?...or do you have to have that method set up to return a pointer?...

UberJoker 0 Junior Poster in Training

milliseconds

UberJoker 0 Junior Poster in Training

clock_t startClock,finishClock;
double timeCount;
startClock = clock();
//-----your sort function goes here here--------
finishClock = clock();
timeCount = finishClock - startClock ;

timeCount will give you ELAPSED CLOCK. If you divide that by 100 ie: timeCount/100...you will get ELAPSED TIME.

Also, dont forget to import the following.
#include <time.h>
#include <ctime>

hope that helps. Good luck.

UberJoker 0 Junior Poster in Training

"The sort characterized by first locating the smallest item in a list " ...yes you are absolutely correct. Sorry I didn't pay attention :).

UberJoker 0 Junior Poster in Training

I am actually pretty sure no.2 is a insertion sort...you might differ... :O

UberJoker 0 Junior Poster in Training

wow man...good for you...you got a genius like Narue to answer your questions :)....although I think question no 2 is a little ambiguous...selection sort finds the entries with the largest unsorted keys and puts it at the bottom of the list. then it finds the smallest unsorted key and puts it in the first place and repeats the process till everything is sorted. No 9 and 10 are definitely false. I remember having those questions in one of my classes.

UberJoker 0 Junior Poster in Training

yezz yezz...this would work too

#include <iostream>
#include <fstream>

using namespace std;
class MyMethods
		{
			public:
			void ReadingFileMethod(int,int);

		};

void MyMethods::ReadingFileMethod(int i,int k)
		{
		ifstream MyData("somefile.txt");
		string data;
		string myDataArray[k];
		string tempArray[k];
		int counter = 0;
		for(int x=0;x<k;x++)
		     { 
			 			
			  getline(MyData,data);
  			  myDataArray[counter] = data;
			  counter++;
			
		     }
		MyData.close();
		for(int j=i;j<k;j++)
		     {
			cout<<j<<" "<<myDataArray[j]<<endl;
		     }
			

		}

int main()
	 {
		
		MyMethods MyMethodCallingVariable;
		int startAt=0;
		int endAt=24;
		begin:
		MyMethodCallingVariable.ReadingFileMethod(startAt,endAt);
		char answer;
		
		cout<<"wanna get the next 24 lines? press y for yes and n for no: ";
		cin>>answer;
		if(answer == 'y' || answer == 'Y')
		  {
			startAt = endAt;
			endAt = endAt*2;
			goto begin;
		  }

		return 0;

	 }
UberJoker 0 Junior Poster in Training

haha..kk..I knew i got it wrong :p...but still gave it a try...

UberJoker 0 Junior Poster in Training

I didnt read your code....I just read the question. From the question, It seems like the program is quite easy. I am not sure why you have so much code . If I am not Completely wrong, is this what you are trying to do?

#include <iostream>


using namespace std;

int main()
	  {
		string MyString;
		char SearchChar;
		char SearchType;
		string MyStringArray[20];
		int StringLength=0;
		veryBeginning:
		cout<<"input a string: ";
		cin>>MyString;
		StringLength = MyString.length();

		
		MyStringArray[StringLength];
		for(int i=0;i<StringLength;i++)
		   {
			cout<<MyString[i]<<" is at position "<<i<<endl;
		   }
		JustArraySearch:
		cout<<"Enter a search query: ";
		cin>>SearchChar;

		for(int j=0;j<StringLength;j++)
		  {
			if(MyString[j] == SearchChar)
			  {
				cout<<MyString[j]<<" is at position "<<j<<" and there are "<< j<<" items before it and "<<(StringLength-j)-1<<" items after it"<<endl;
			  }

		  }
		cout<<"Do you want to Search again Or Input a different string? Press 'y' for yes and 'n' for new string: ";
		cin>>SearchType;
		if(SearchType == 'y' || SearchType == 'Y')
		  {
			goto JustArraySearch;
		  }
		else	
		  {
			goto veryBeginning;		
		  }
		


		return 0;
		
	  }

output:
input a string: TESTING
T is at position 0
E is at position 1
S is at position 2
T is at position 3
I is at position 4
N is at position 5
G is at position 6
Enter a search query: I
I is at position 4 and there are 4 items before it and 2 items after it
Do you want to Search again Or Input a different string? Press 'y' for yes and 'n' for new …

UberJoker 0 Junior Poster in Training

yea...thanks

UberJoker 0 Junior Poster in Training

hey thanks. Substring worked quite well. I have another question. rather silly to ask but is it possible to print a integer as a string?
like int val = 1;
if we cout<<val its gonna put out 1...but is there a way that it represents 1 yet prints out it self? so cout<<val should print val insted of 1 lol..

UberJoker 0 Junior Poster in Training

well thats the entire thing....I cant seem to figure that out....is there a STL method to do that?

UberJoker 0 Junior Poster in Training

Hey guys. I have the following string array, say,

string array[2];
array[0] = "hello7925";
array[1] = "bye344539";

I want to read the last two characters from each string in the array, which in this case are 25 and 39 and then put them in a separate array like this..

int array_integers[2];
array_integers[0] = 25;
array_integers[1] = 39;
the end of every string will have a integer thats why the second array is of type int.
I am kind of stuck on this part. Any suggestions would be greatly appreciated. Thanks in advance.

UberJoker 0 Junior Poster in Training

umm....i didnt quite understand that...what i am saying is how to read them individually at all in the first place

UberJoker 0 Junior Poster in Training

Hello everyone. Got a bit of a weird problem here. I cant seem to figure out a way to read a file with a format like this...

hello what 100 200

its a string string integer integer

i need to put each of those values in separate arrays.
eg:
array1[0] = hello;
array2[0] = what;
array3[0] = 100;
array4[0] = 200;

I tried this just as a test to what it will print out but as expected its just flat out reading the file. I am not getting any ideas to differentiate between variables and put them in separate arrays.

ifstream MyData("somefile.txt");
		string data;
		string DataArray[500];
		int i=0;
			while(MyData>>data)
			     {
				cout<<data;
				 DataArray[i] = data;
				 i++;					
			     }
			for(int j=0;j<i;j++)
			     {
				cout<<DataArray[j]<<endl;
			     }

Any suggestions would be very much appreciated. Thanks .

UberJoker 0 Junior Poster in Training

I am not sure what you mean by its not being read. I think it is being read thats why its printing it out. Just for making sure it is infact reading it, Here is a little name function I added. The name function would never output the names if they weren't being read.

#include<iostream>

using namespace std;

class EmployeeList
		 {
			public:
			EmployeeList(){}
			void BuildEmployee(void);
			string setFirstName(string);
			string setLastName(string);
			void setName(string,string);
		 };

string EmployeeList::setFirstName(string FName)
		{
			return FName;
		}


string EmployeeList::setLastName(string LName)
		{
			
			return LName;
		}



void EmployeeList::setName(string FName,string LName)
		{
			
			cout<< setFirstName(FName)<<" "<<setLastName(LName)<<endl;
		}


void EmployeeList::BuildEmployee (void)
		{

			int skill, benefit;
			string fstname, lstname;
			long SSN;
			float hours, perCont;
 

			cout << "Enter employee first name" << endl;
			getline (cin, fstname);
			setFirstName(fstname); 

				

			cout << "Enter employee last name" << endl;
			getline (cin, lstname);
			setLastName(lstname);

	
			setName(fstname,lstname);
			//cout << endl << fstname << " " << lstname << endl; 
			
 

		}

int main()
	 {
		EmployeeList var;
		var.BuildEmployee();
		return 0;
	 }

Sorry actually I didnt quite understand your question. But hope this helps.

Output:
[swj@localhost Problems]$ g++ test3.cpp
[swj@localhost Problems]$ ./a.out
Enter employee first name
Swaraj
Enter employee last name
Patil
Swaraj Patil

UberJoker 0 Junior Poster in Training

i know i know :). No hard feelings brother.

UberJoker 0 Junior Poster in Training

I cant tell you how extremely stupid you sound. I don't even want to bother explaining anything to you any more. First you assume, then you build upon it(assumptions make a ass out of u and me ;).its cool though. No hard feelings. I will say no more. good luck with everything.

UberJoker 0 Junior Poster in Training

Humm...I coudnt compile gastoncis code. But try this T-Doog.

#include <iostream>

#include <fstream>

 

using namespace std;

 

int main()

	 {//start main 1s

		char c;

		int i;

		int newstar[26]={0};

		int sum[26]={0};

 

			

				do{//start do 2s
					start:
	
					c=cin.get();
					if(c == ' ')
					  {
						continue;
					  }
					 if(isalpha(c))

							c=tolower(c);

							 

								for (i=97;i<123;i++)

									{//5s

										if (c==(char)i)

										  {//6s

										    sum[c-97]++;

										    goto start;

										  }//6e

								        }//5e

					   		

						 for(int x=97;x<123;x++)
      				     		           {//7s

								newstar[x-97]=sum[x-97]*80/389;

							        cout<<(char)x<<" "<<sum[x-97];

								  for (int star=0; star<newstar[x-97]; star++)

								       {//8s

										cout<<"*";

								       }//8e

										cout<<endl;

							    }//7e
						}while(c != EOF);

					
				return 0;

	   }
UberJoker 0 Junior Poster in Training

Dude sorry to break your feelings...but i you don't seem to understand what's going on here. First of all I was getting the point across that his code actually is extremely crappy and in fact if you go to solve it you will realize that it is most likely a debugging activity given to him. second thing is that he did not mention anything about what he wants out of it. Hence you only assumed what he wants and are telling me crap about it. He only said "Error: expected unqualified-id token before " which, to a normal person would mean nothing more than fixing syntactical errors in the code and make it so that it would compile and run. First go look at his functions. the withdraw function he had didn't make any sense. at least i made it so that it makes sense and actually withdraws. I don't care what he wants to do with it afterwards and neither did he explain it so why are you assuming stuff?
I think he gets the point that he needs to put code tags in. It happened to me too when I first posted. I dont think he has a problem with it. I dont know why you do.

UberJoker 0 Junior Poster in Training

she probably only slept with customers who seemed clean and who she was attracted to...that would make it quite enjoyable...and since she was a high class escort, she was probably able to find some good looking men(i think :D). even 1 a day would get he quite a bit of money per week.

UberJoker 0 Junior Poster in Training

point 1)next time before posting please preview your post to check whether you have code tags.
point 2)what the heck ?....this is probably the worst piece of code iv come across in years. I am thinking this is an assignment your teacher gave you to debug or something. But I will give you the benefit of doubt since you have at least some code. Your code had 1 too many syntactical mistakes. some of the things made no sense at all. If you are not the writer of the code I would advise you to go through the changes iv made. But anyway. I fixed it. Hope it helps.

#include <iostream>

using namespace std;

int main()

	{

		int pin, option, i;
		double balance = 1230.00;
		double withdraw, deposit;
		bool quit = false;




			cout << "Please enter pin number: \n";
			cin >> pin;

				if (pin == 7230)
				    {
					
				    	cout << "Pin Accepted \n";
				    }
				else
				    {
				    	cout << "Please try again. \n"; 
				        quit = true;
				    }


				

			
		      cout <<"**ATM**"<<endl;
		      while(quit != true)
			{
  			 cout << "Choose a transaction: \n";
			 cout << "1. Withdraw Funds \n";
			 cout << "2. Deposit Funds \n";
			 cout << "3. Quit \n;" << "\n";
			 cout << "Enter option: ";
			 cin >> option;

			 switch (option)
			   {
			     case 1:
			     cout << "Enter the amount you would like to withdraw: "<<endl;
			     cin >> withdraw;
			     balance = balance - withdraw;

			     cout << "You withdrew $ " << withdraw<< endl;
			     cout << "Your remaining balance is $ " << balance <<endl; …