Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Apr 2013
    Posts
    3
    Thanks
    0
    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!!

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,159
    Thanks
    203
    Thanked 2,549 Times in 2,527 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.
    Contestant: Yorick.

    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.


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •