Question

Write a method that calculates a 15% discount on the price of an item. Have the...

Write a method that calculates a 15% discount on the price of an item. Have the method return the discounted price. For example if the price is $100.00 the method should return $85.00. Write the method using either returning void and using a referene parameter or write it returning the value as a double or decimal and taking a value parameter. Call the function passing it an appropriate variable. Display the result.

0 0
Add a comment Improve this question Transcribed image text
Request Professional Answer

Request Answer!

We need at least 10 more requests to produce the answer.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the answer will be notified once they are available.
Know the answer?
Add Answer to:
Write a method that calculates a 15% discount on the price of an item. Have the...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Similar Homework Help Questions
  • Write a C++ program that calculates the discount of the original price of an item and...

    Write a C++ program that calculates the discount of the original price of an item and displays the new price, and the total amount of savings. This program should have a separate header (discount.h), implementation (discount.cpp) and application files (main.cpp). The program must also have user input: the user must be prompted to enter data (the original price, and the percent off as a percentage). There must also be a validation, for example: Output: “Enter the original price of the...

  • 1. Write a statement that calls a function named showSquare, passing the value 10 as an...

    1. Write a statement that calls a function named showSquare, passing the value 10 as an argument. 2. Write the function prototype for a function called showSquare. The function should have a single parameter variable of the int data type and areturn type of void. 3. Write the function prototype for a function called showScoreswith a parameter list containing four integer variables and a return type of void. 4. Look at the following function definition: double getGrossPay(int hoursWorked, double payRate)...

  • Java generics Write a program that calls a method to multiply two integers and return the...

    Java generics Write a program that calls a method to multiply two integers and return the integer result. Modify the program to make the method generic, calling it with two generic data types and then returning the result in the same type which also has to be generic. Call the method two times, once with an integer and once with a double in your main program and display the results

  • Write a program that consists of a main method and a isInOrder method. main should read...

    Write a program that consists of a main method and a isInOrder method. main should read in two integers from the keyboard and then call isInOrder, passing it the two integers. isInOrder should return true if the first parameter is less than or equal to the second paramenter. Otherwise, it should return false. On return to main, main should test the value returned. If it is true, it should display "in order". Othewise, it should display "not in order".

  • Update your Assignment 4 as follows (Assignment 4 codes will be on the bottom) Create a...

    Update your Assignment 4 as follows (Assignment 4 codes will be on the bottom) Create a new method called displayAll, that takes an ArrayList (of your base class) as a parameter, and doesn't return anything [25 pts] The displayAll method will loop through the ArrayList, and call the display (or toString) method on each object   [25 pts] In the main method, create an ArrayList containing objects of both your base class and subclass. (You should have at least 4 objects)  [25...

  • Update your Assignment 4 as follows (Assignment 4 codes will be on the bottom) Create a...

    Update your Assignment 4 as follows (Assignment 4 codes will be on the bottom) Create a new method called displayAll, that takes an ArrayList (of your base class) as a parameter, and doesn't return anything [25 pts] The displayAll method will loop through the ArrayList, and call the display (or toString) method on each object   [25 pts] In the main method, create an ArrayList containing objects of both your base class and subclass. (You should have at least 4 objects)  [25...

  • Consider the method: private void ShowName(string firstName, string lastName) {           MessageBox.Show(firstName + “ ” + lastName);...

    Consider the method: private void ShowName(string firstName, string lastName) {           MessageBox.Show(firstName + “ ” + lastName); } Which of the following could be used to call the method? ShowName(lastName : “Smith”, firstName : “Suzanne”); ShowName(“Suzanne”, “Smith”); Write a method named showTax which has 2 parameters of type decimal. The first parameter is the price of the items sold. The second parameter is the tax rate which has a default value of 0.07. The method does not return a value. It...

  • You are to write a program IN C++ that asks the user to enter an item's...

    You are to write a program IN C++ that asks the user to enter an item's wholesale cost and its markup percentage. It should then display the item's retail price. For example: if the an item's wholesale cost is 5.00 and its markup percentage is 100%, then the item's retail price is 10.00 If an item's wholesale cost is 5.00 and its markup percentage is 50%, then the item's retail price is 7.50 Program design specs. You should have 5...

  • 3. (a) write a value-returning function with appropriate parameter(s) to do the following: the function recieves...

    3. (a) write a value-returning function with appropriate parameter(s) to do the following: the function recieves a number and determines whether the number is over 2.5. it return the number if the the number is over 2.5, otherwise return false. (b) consider following : double gpq; cin >> gpa; write the code to call the function in (a) above to determine whether the number is over 2.5. if it is display a message indicating so, otherwise display a message "the...

  • Problem Description to implement a Java application, called ShoppingApplication, that can be used in a retail...

    Problem Description to implement a Java application, called ShoppingApplication, that can be used in a retail store. You are asked to implement three classes: Item, Invoice, and InvoiceDriver. Each of these classes is described below. Item class The Item class represents of an item that is being sold in the retail store (e.g., book or pencil) where an item is identified by three instance variables: name (of type Sring), weight (of type double), price (of type double), and currentDiscount (of...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT