Originally posted by SAYED RAFI:
Hi
Thanks to Victor & Smitha : Information sent by you is very usefull to me :
As iam joining Accenture on 8th Aug.2005.
Cheers : Sayed
Originally posted by Thomas Whalen:
If personA asks for tickets, then
...Ask personA for number of tickets being requested
...Get number of tickets
...If number of tickets is greater than five then
......Reject ticket request
...Else
......Loop through each row
.........If number of available seats is >= than request then
............Fill seats in that row equal to request
...............Set number of seats available minus request
.........End If
......End Loop
...End If
End If
Am I understanding the problem correctly?
Originally posted by Thomas Whalen:
I'm only a mere beginner, but...why are you getting questions in a job interview (I thought only highly qualified Java programmers got interviews anymore) and asking them in a beginner forum? :-)
In a train compartment there are 67 seats...13 rows of 5 (3 by2) seats
and the last row has 2 sets. A person cannot book more than 5 seats. If a
person is booking then it should be such that maximum people of the group get
consecutive seats.
Originally posted by Steve Morrow:
First link from Google:
http://www.rgagnon.com/javadetails/java-0426.html
Originally posted by Joel McNary:
Perhaps the String.replaceAll() method is what you want. It takes a regular expression and replaces all occurrances of the regular expression with the substitute value.
This replaces all occuranecs of @, %, ., and * with the empty string, thereby eliminating them from your string.
Your way could work, albeit much less efficiently, with simply elimating the characters instead of replacing them with a dollar sign, akin to: