Ask Computer Engineering Expert

OneLiner Problem

Create a "one-liner" program. Every time someone hits your web site, they see a new one-liner (i.e. a one line phrase, sentence, etc.). You can make up your own one-liners or use the list at the bottom of this assignment.

Here are several sample outputs: "You are strong in body and spirit.", "You are strong in perspiration and odor.", "Good fortune smiles upon the distributed.", "VB Programmer for Hire -- Cheap!!", "I never met an object I didn't like.", "Edit, Compile, Link, Crash, Sigh.", "Never judge a stack dump by its arguments.", "Card carrying member of the Bug Police.", "You make Dilbert look charming and sophisticated.", "BMW, The Ultimate Driving Machine."

For this assignment, I would like you to read in your one-liners from a file that is in your "WEB-INF" directory.

Create a configurable for the file name so that you don't have to hard-code the name of your file.

Override the Servlet init() routine and provide code to read in your one-liner Strings.

I would recommend that you have the following instance variables to keep track of the one liners:

ArrayList oneLiners = new ArrayList(); int nextOneLiner = 0; Each time a user hits your page, your Servlet returns the one liner in oneLiners[nextOneLiner ++]; By incrementing nextOneLiner, the next access will get a different one liner. When you have exhausted all one-liners in your ArrayList, you should go back to the beginning ... i.e. nextOneLiner = 0; Each time a one-liner is displayed, a "Next" button will be displayed that the user can click to get the next one-liner string from the list.

Life is wonderful. Without it we'd all be dead. Daddy, why doesn't this magnet pick up this floppy disk? Give me ambiguity or give me something else. I.R.S.: We've got what it takes to take what you've got! We are born naked, wet and hungry. Then things get worse. Make it idiot proof and someone will make a better idiot.

He who laughs last thinks slowest! Always remember you're unique, just like everyone else. "More hay, Trigger?" "No thanks, Roy, I'm stuffed!" A flashlight is a case for holding dead batteries. Lottery: A tax on people who are bad at math. Error, no keyboard - press F1 to continue. There's too much blood in my caffeine system. Artificial Intelligence usually beats real stupidity. Hard work has a future payoff.

Laziness pays off now. "Very funny, Scotty. Now beam down my clothes." Puritanism: The haunting fear that someone, somewhere may be happy. Consciousness: that annoying time between naps. Don't take life too seriously, you won't get out alive. I don't suffer from insanity.

I enjoy every minute of it. Better to understand a little than to misunderstand a lot. The gene pool could use a little chlorine. When there's a will, I want to be in it. Okay, who put a "stop payment" on my reality check? We have enough youth, how about a fountain of SMART? Programming is an art form that fights back. "Daddy, what does FORMATTING DRIVE C mean?" All wiyht. Rho sritched mg kegtops awound? My mail reader can beat up your mail reader. Never forget: 2 + 2 = 5 for extremely large values of 2. Nobody has ever, ever, EVER learned all of WordPerfect. To define recursion, we must first define recursion. Good programming is 99% sweat and 1% coffee.

Home is where you hang your @ The E-mail of the species is more deadly than the mail. A journey of a thousand sites begins with a single click.

You can't teach a new mouse old clicks. Great groups from little icons grow. Speak softly and carry a cellular phone. C:\ is the root of all directories. Don't put all your hypes in one home page. Pentium wise; pen and paper foolish. The modem is the message. Too many clicks spoil the browse. The geek shall inherit the earth.

A chat has nine lives. Don't byte off more than you can view. Fax is stranger than fiction. What boots up must come down. Windows will never cease. (ed. oh sure...) In Gates we trust. (ed. yeah right....) Virtual reality is its own reward. Modulation in all things. A user and his leisure time are soon parted.

There's no place like Know what to expect before you connect. Oh, what a tangled website we weave when first we practice. Speed thrills. Give a man a fish and you feed him for a day; teach him to use the Net and he won't bother you for weeks.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M93073105

Have any Question?


Related Questions in Computer Engineering

Does bmw have a guided missile corporate culture and

Does BMW have a guided missile corporate culture, and incubator corporate culture, a family corporate culture, or an Eiffel tower corporate culture?

Rebecca borrows 10000 at 18 compounded annually she pays

Rebecca borrows $10,000 at 18% compounded annually. She pays off the loan over a 5-year period with annual payments, starting at year 1. Each successive payment is $700 greater than the previous payment. (a) How much was ...

Jeff decides to start saving some money from this upcoming

Jeff decides to start saving some money from this upcoming month onwards. He decides to save only $500 at first, but each month he will increase the amount invested by $100. He will do it for 60 months (including the fir ...

Suppose you make 30 annual investments in a fund that pays

Suppose you make 30 annual investments in a fund that pays 6% compounded annually. If your first deposit is $7,500 and each successive deposit is 6% greater than the preceding deposit, how much will be in the fund immedi ...

Question -under what circumstances is it ethical if ever to

Question :- Under what circumstances is it ethical, if ever, to use consumer information in marketing research? Explain why you consider it ethical or unethical.

What are the differences between four types of economics

What are the differences between four types of economics evaluations and their differences with other two (budget impact analysis (BIA) and cost of illness (COI) studies)?

What type of economic system does norway have explain some

What type of economic system does Norway have? Explain some of the benefits of this system to the country and some of the drawbacks,

Among the who imf and wto which of these governmental

Among the WHO, IMF, and WTO, which of these governmental institutions do you feel has most profoundly shaped healthcare outcomes in low-income countries and why? Please support your reasons with examples and research/doc ...

A real estate developer will build two different types of

A real estate developer will build two different types of apartments in a residential area: one- bedroom apartments and two-bedroom apartments. In addition, the developer will build either a swimming pool or a tennis cou ...

Question what some of the reasons that evolutionary models

Question : What some of the reasons that evolutionary models are considered by many to be the best approach to software development. The response must be typed, single spaced, must be in times new roman font (size 12) an ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As