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.


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: homework help

  1. #1
    Junior Member
    Join Date
    Oct 2013
    Thanked 0 Times in 0 Posts

    Default homework help

    Not sure how to go about this one:

    Fill in the blanks below to create a method that takes as parameters an original price (a real number that can include a decimal) and a percent discount (an integer) and computes and returns the discounted price as a real number. For example, if the original price is 50.0 and the percent discount is 10, your method should return a discounted price of 50.0 - 0.10(50.0) = 45.0. (You will need to divide the percentage by 100 as part of the computation.) Use the names originalPrice and percentDiscount for the parameters.
    public static ______ discountPrice(______________________) {
    double newPrice = ___________________;

  2. #2
    Join Date
    Sep 2013
    Thanked 13 Times in 13 Posts

    Default Re: homework help

    The problem tells you all the information you need.

    What parameters to put, what return type if any is required, what type of data type you will be working with and even the formula you need.

    What have you tried to do? Post your attempts and what issues you are getting and we will gladly help.

Similar Threads

  1. Help with my homework?
    By mshem in forum Java Theory & Questions
    Replies: 2
    Last Post: November 16th, 2012, 03:15 AM
  2. Homework help?
    By regi.dg in forum Object Oriented Programming
    Replies: 0
    Last Post: October 16th, 2012, 08:17 PM
    By jmillernc01 in forum What's Wrong With My Code?
    Replies: 3
    Last Post: October 10th, 2012, 11:13 AM
  4. I am doing my homework =D
    By valenciajv in forum Java Theory & Questions
    Replies: 9
    Last Post: October 7th, 2011, 04:39 PM
  5. Homework
    By jdonaldson in forum What's Wrong With My Code?
    Replies: 1
    Last Post: March 9th, 2011, 11:09 AM