Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

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

You run a small pizza shop named pizza hat initially you

You run a small pizza shop named Pizza Hat. Initially you sold pizzas for $8 and every week you sold around 3000 pizzas. Each pizza costs you $3 to make. One day you decided to o¤er discounts to customers to see if you c ...

Question a small computer on a smart card has four page

Question : A small computer on a smart card has four page frames. At the first clock tick, the R bits are 0111 (page 0 is 0, the rest 1). At subsequent clock ticks, the values are 1011, 1010, 0101, 1010, 0010, 1100, and ...

The toronto blue jays raises ticket prices from 100 to 120

The Toronto Blue Jays raises ticket prices from $100 to $120 per seat and experience a decline in ticket sales from 12000 to 10000 per game. i) What is the elasticity of demand for tickets? ii) Assuming the marginal cost ...

Salariestask compute the weekly pay for each employee at

Salaries Task: Compute the weekly pay for each employee at the Wahoo Widget Company. For each employee, you will calculate the base pay according to the appropriate salary category, and then subtract taxes and deductions ...

Not all context free grammars define regular languages

Not all context free grammars define regular languages. However, the following two DO define regular languages. For each grammar below, (a) describe the corresponding language and (b) draw the corresponding finite state ...

Enter probability as a fraction or as a decimal rounded to

Enter probability as a fraction or as a decimal rounded to nearest thousandth (three A basket contains six red and four blue marbles. Three marbles are drawn at random without replacement. (WITHOUT using combinations) de ...

Suppose that you sample 59 high school baseball pitchers in

Suppose that you sample 59 high school baseball pitchers in one county and find that they have a mean fastball pitching speed of 80.00 miles per hour (mph) with a standard deviation of 4.98 mph. Find a 95% confidence int ...

String problemfor each numerical value 0 1 2 9 0 lt number

String Problem For each numerical value 0, 1, 2, ...9 (0 Print the converted sentence both to the screen and to an output file. Your input file consists of a variable number of records. Each record is a sentence of lengt ...

You are requested to design an information technology

You are requested to design an Information Technology Infrastructure for an international nonprofit organization. The organization has six offices, one each in Ohio, Kentucky, Toronto, Michigan, Chicago, and Indiana. Col ...

Stereotypes are useful toolsthey provide a shorthand way of

Stereotypes are useful tools. They provide a shorthand way of dealing with differences and allowing us to categorize how people think about things and interact with our world. Explain the positive effects of stereotypes ...

  • 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