Some C++ programs

Posted on 51 Comments

Update:
As requested by Sajith Karingat (comment #29), I worked on a Phone Billing System in C++, as per his requirements. You can download it here.

I have entered my final year in my B.Tech course, and with it, it’s placement time. Companies for the computer science stream (my stream) will start visiting my college beginning from 11th August. The first to come will be TCS (Tata Consultancy Services) which is considered as a good IT firm in India with global fame.

As part of my prep for the placements, obviously, I am revising my concepts (technical ones). Today, as it was raining heavily in the college, we sat in our central canteen, waiting for the rain to stop. During that time, we held a heated discussion on C++ programs that were most likely to be asked in interviews for placements.

Amongst those programs, one was to swap the values of two variables “a” and “b” without using the “temp” variable. Another interested one we discussed was that would generate a pattern like:

1
2 3
4 5 6
7 8 9 10
11 12 13 14
…… and so on.

When I got back home, I decided to have a go on these programs. And so, here are my answers to above problems.

Continue reading Some C++ programs

Hancock

Posted on Leave a comment

Yesterday, I went to see Hancock in a theatre nearby. And that was the second day of film release in India. Although the original release date was on 4th of July, the release was delayed by one whole week due to reasons unknown to me.

The way Sony had been advertising Hancock on the television and on the Internet, I was pretty sure it would be a nice watch, and that is what it turned out to be in the end. The poor rating of the movie on IMDb (6.9) and Rotten Tomatoes (37%) didn’t deter my plan to watch the movie.

Yesterday was raining and raining wildly here in Jalandhar. But the rain had stopped till the evening, and my friend and I were able to reach the theatre in time. Despite the rain, the theatre witnessed a packed crowd, eager to see the movie, just like me, maybe drawn to the movie due to the wide-scale ads on TV.

The film began and the fun started. Will Smith in his best of form, and that too a comic form, just imagine. This was till the first half, which constituted a well-written script, good acting performances, and a nice story.

The second half began and the story got intense; intense to a point I didn’t expect it to go. The second half was devoid of humor, err… wild and funny humor. Ok, nothing wrong if we take the story aspect here and that was understandable. The story went on and the second half finished as it shouldn’t have, leaving me wanting some more out of it. The ending part could have been a lot better, but it wasn’t.

Anyway, the movie ended with closing credits and I got off with my friend towards the exit point. But before we could get out, we saw a short clip between the credits. It was a nice shot, Hancock saving yet another life.

All in all, it wasn’t a bad watch, it was rather nice watching it. But because of the second half, I am giving it a rating of 7, though I usually do not do this much harm to Will Smith starers.

Who knows Hancock could spark a new generation of superhero, a frustrated superhero (as they used to call him in the trailers)? Maybe, this was the first of the Hancock series to come ahead…

Batman Begins

Posted on 4 Comments

Oh boy,what a movie it was. I have from my childhood been a big fan of Batman. What ever type of a Batman fan I was, I was no big a fan than my best friend. He was kind of a “super” fan for Batman.

Anyway, as I was talking about this movie, I had a damn good time watching it. The first half was just incredible; nice story, nice acting, and nice direction. The second half was almost all action, but then, good quality action.

It is no wonder that this movie gets a 10/10 rating from me, and let me tell you that it is one of the rarest movies to get a 10 out of 10 from me.

I am eagerly awaiting the sequel to this movie – The Dark Knight.

The Forbidden Kingdom Movie

Posted on 4 Comments

I have since long been a fan of martial arts and kung-fu movies. Before watching this one, I had heard a lot of good things, particularly about its comedy. I got to see this movie today, and I must say what a watch it was.

Right from the beginning till the end, the movie was entertaining. This has to be one of the best Jackie Chan movies I’ve ever seen. Plotted in an ancient, mystical world, it had everything to be remembered for a long time. Although a bit predictive at times, the story was overall good. But I guess the “predictive” nature of the movie in my mind could just be because I’ve seen these type of movies in the past, like Lord of the Rings and alike (in terms of story).

And yes, the comedy was indeed good, if not the best, especially Jackie Chan scenes. And those of Jet Li too. Did I say Jet Li (that serious looking guy)? Yup, Jet Li was all impressive with his martial arts and a little bit of humor.

I would conclude my sayings on this movie by the very much cliched statement “It is a must watch!”, especially if you are an adventure & comedy lover, though I wish the martial art scenes were a little better and more realistic, especially the “kick-in-the-air” ones. But you don’t have to conclude anything with this point of mine; the martial arts fight scenes were incredible. 🙂

The Forbidden Kingdom will certainly go down in history as a very good Chinese fantastical story based movie.

IMDB Profile

Wikipedia Entry