Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

PLEASE HELP!!!! Assume a developer writes the following class that calculates an

ID: 3851691 • Letter: P

Question

PLEASE HELP!!!!

Assume a developer writes the following class that calculates an item's retail price based on the wholesale cost and markup percentage. Create a unit test to test this class. You may use source code in any language, pseudo code, or natural language (statements).   

public class RetailPriceCalculator

{

                                …   

                public static double calculateRetail(double wholesale, double markUp)

                {

                                double retail = wholesale (1+ markup/100);

                                return retail;

                }

}

Explanation / Answer

Hi i write your program as your requirement

i compile and run the program please find the input and output of the program at below

program:

import java.util.Scanner;


class RetailPriceCalculator
{
    public static void main(String[] args)
    {
        Scanner input = new Scanner(System.in);
        double wholeSaleCost;
        double markUpPercentage;
        double retailPrice;
       
        System.out.println("Enter the wholesale cost");
        wholeSaleCost = input.nextDouble();
       
        System.out.println("Enter the markup percentage");
        markUpPercentage = input.nextDouble();
       
        retailPrice = calculateRetail(wholeSaleCost, markUpPercentage);
        System.out.println("The retail price is: " + retailPrice);
       
       
    }
   
    public static double calculateRetail(double wholesale, double markUp)
    {
   
        double retail = wholesale * (1+markUp/100);
   
        return retail;
    }

}

input:

5

4

output:

Success time: 0.08 memory: 4386816 signal:0

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote