Welcome to the Java Programming Forums

The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.

>> REGISTER NOW TO START POSTING

1. ## i need help

1.Write a program that asks the user to enter a favorite color, a favorite food, a favorite animal, and the first name of a friend or relative. The program should then print the following two lines, with the user’s input replacing the items in italics.
I had a dream that Name ate a Color Animal and said it tasted like Food.
For example, if the user entered blue for color, hamburger for food, frog for the animal, and Jake for the person’s name, the output would be
I had a dream that Jake ate a blue frog and said it tasted like hamburger.

2. Write a program that computes the tax and tip on a restaurant bill. Ask the user to input the following information:
• Price of the appetizer
• Price of the entree
• Price of the dessert
• Price of the drink
• Number of people in the party
Now, display the following:
• Cost of the meal for one person without including tax or tip.
• Total cost of the meal for the entire party without tax and tip. Assume that the cost per meal is the same for all persons in the party
• The tax amount. The tax rate is 8.25 percent. Use a named constant for the tax rate.
• The tip amount. The tip is 15% of the total bill after adding the tax. Use a named constant for the tip.
• Total cost of the meal for the entire party with tax and tip.

3.Write a program that reads a 4 digit integer and adds all the digits in the integer. For example, if an integer is 9324, the sum of all its digits is 18.
Hint: Use the % operator to extract the digits, and use the / operator to remove the extracted digit.

2. ## Re: i need help

What have you tried?

3. ## Re: i need help

1.Write a program that asks the user to enter a favorite color, a favorite food, a favorite animal, and the first name of a friend or relative. The program should then print the following two lines, with the user’s input replacing the items in italics.
I had a dream that Name ate a Color Animal and said it tasted like Food.
For example, if the user entered blue for color, hamburger for food, frog for the animal, and Jake for the person’s name, the output would be
I had a dream that Jake ate a blue frog and said it tasted like hamburger.

2. Write a program that computes the tax and tip on a restaurant bill. Ask the user to input the following information:
• Price of the appetizer
• Price of the entree
• Price of the dessert
• Price of the drink
• Number of people in the party
Now, display the following:
• Cost of the meal for one person without including tax or tip.
• Total cost of the meal for the entire party without tax and tip. Assume that the cost per meal is the same for all persons in the party
• The tax amount. The tax rate is 8.25 percent. Use a named constant for the tax rate.
• The tip amount. The tip is 15% of the total bill after adding the tax. Use a named constant for the tip.
• Total cost of the meal for the entire party with tax and tip.

3.Write a program that reads a 4 digit integer and adds all the digits in the integer. For example, if an integer is 9324, the sum of all its digits is 18.
Hint: Use the % operator to extract the digits, and use the / operator to remove the extracted digit.

4. ## Re: i need help

Why repeat post #1? See my post#2

5. ## Re: i need help

What you've done is to post your entire assignment without showing what work you've done, and that is not how to get help here (or at any forum). For one, we have no idea what you're having trouble with, so we won't know how to advise you. For another, it suggests that you want someone to post a complete solution, thereby doing your homework for you, and I know that this was not your intent.

So please try to solve the problem first, and then post what you've done using code tags (see the FAQ), and then ask a specific question. Do this and you'll have many folks willing to help you.

If you have absolutely no idea where to start, please have a look at this site here as it will give you some ideas: Starting Writing a Program