Computer Science, asked by np936449, 7 months ago

write a program to accept printed price and tax percentage from user and find the net selling price after adding tax.​

Answers

Answered by srramdeep
0

Explanation:

Given the Cost price

C and Profit Percentage

P of an item, the task is to calculate the Selling Price.

Examples:

Input: CP = 500, Profit% = 20

Output: SP = 600

Input: CP = 720, Profit% = 13

Output: SP = 813.6

Approach:

Find the Decimal Equivalent of the profit Percentage, for this divide the percentage by 100.

Add 1 to get the decimal Equivalent of unit price increase.

Take product of Cost price with the above result to get the selling price.

Below is the implementation of the above approach:

Program:

// C++ implementation of above approach

#include <iostream>

using namespace std;

// Function to calculate the Selling Price

float SellingPrice(float CP, float PP)

{

// Decimal Equivalent of Profit Percentage

float P_decimal = 1 + (PP / 100);

// Find the Selling Price

float res = P_decimal * CP;

// return the calculated Selling Price

return res;

}

// Driver code

int main()

{

// Get the CP and Profit%

float C = 720, P = 13;

// Printing the returned value

cout << SellingPrice(C, P);

return 0;

hope its helpful ... please followme

Answered by mohitkur2036
0

Import. java. util*;

{

public static void main( string arg[ ]);

{

scanner dis= new scanner( system.in)';

int pp, tp, ns;

system. out. print (enter the printed price:");

Similar questions