Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: Homework help please!
04-15-2013, 03:00 AM #1
- Join Date
- Apr 2013
- Thanked 0 Times in 0 Posts
Homework help please!
Hello there! I need some quick help please. I need to write two different java programs and I'm having a difficult time figuring them out. I tried referring to my school textbook but I still don't quite understand. Help is greatly appreciated!
Java Program 1:
Write an application that prompts the user to make a choice for a pizza size -S, M, L, or X -and then displays the price as $6.99, $8.99, $12.50, or $15.00, accordingly. Display an error message if the user enters an invalid pizza size. Save the file as PizzaChoice.java.
Java Program 2:
Create an application containing an array that stores 20 prices, such as $2.34, $7.89, $1.34, and so on. The application should (1) display the sum of all prices, (2) display all values less than $5.00, (3) calculate the average of the prices, and (4) display all values that are higher than the calculated average value. Save the file as Prices.java.
If anyone can help, I will greatly appreciate it!!
04-15-2013, 07:15 AM #2
- Join Date
- Jun 2002
- London, England
- Thanked 2,531 Times in 2,509 Posts
Please have a look at forum rule #1.5.
This forum is not a free coding service. As a general rule, the people helping out in this forum don't write code for others (especially code that appears to be for homework), but try to help with fixing code that doesn't work. You may perhaps get someone to write this script for you, but you'll be far more likely to get help if you have made a substantial effort and written some code yourself. Then someone here will almost certainly help you correct/improve your work.
Quizmaster: Name a character from any one of these four plays - Othello, Macbeth, Coriolanus and Hamlet, who has a speaking part.
All the code given in this post has been tested and is intended to address the question asked.
Unless stated otherwise it is not just a demonstration.