answersLogoWhite

0


Best Answer

#include<conio.h>

#include<stdio.h>

void main(void)

{

int sell_pr, profit, cost_pr, cost_pr_one_item ;

clrscr();

printf("Please enter the selling price of 15 items:");

scanf("%d", &sell_pr);

printf("Please enter the profit earned on 15 items:");

scanf("%d", &profit);

cost_pr = sell_pr - profit;

cost_pr_one_item = cost_pr/15;

printf("Cost price of one item is %d", cost_pr_one_item);

getch();

}

User Avatar

Wiki User

12y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

10y ago

#include<iostream>

#include <string>

#include <sstream>

using namespace std;

double enter_double( string prompt, unsigned int multiple = 15, double min = 0.0 )

{

string input;

double result;

while( 1 )

{

printf( "Enter the %s of %u items: ", prompt.c_str(), multiple );

getline( cin, input );

stringstream( input ) >> result;

if( result < min )

{

printf( "\nERROR: The %s cannot be less than %0.2f\n", prompt.c_str(), min );

continue;

}

result *= 100;

int i = (int) result;

if( i/multiple != result/multiple )

{

printf( "\nERROR: The %s must be an exact multiple of %u\n", prompt.c_str(), multiple );

continue;

}

result = (double)i / 100;

break;

}

printf( "You entered %.2f\n", result );

return( result );

}

int main()

{

double total_selling_price;

double total_profit;

double total_cost;

double item_cost;

total_selling_price = enter_double( "total selling price", 15, 0.15 );

total_profit = enter_double( "total profit", 15, total_selling_price * (-1) );

total_cost = total_selling_price - total_profit;

printf( "Total cost: %0.2f\n", total_cost );

item_cost = total_cost / 15;

printf( "Cost per item: %0.2f\n", item_cost );

return(0);

}

Output:

Enter the total selling price of 15 items: 150.15

You entered 150.15

Enter the total profit of 15 items: 30.45

You entered 30.45

Total cost: 119.70

Cost per item: 7.98

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

if the total selling price of 15 items and the total profit earned on them is input through keyboard write the program to find the cost price of one item

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: If the total selling price of 15 items and the total profit earned on them is inputed through the keyboard write a program on C plus plus to find the cost price of one item help would be great?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

The distance between two cities in km is input through the keyboard write a program to convert and print this distance in meters feet inches and centimeters?

mesh's basic salary is input through the keyboard. his dearness allowance is 40% of basic salarying , and house rent allowance is 20% of basic salaried. write a program to calculate his gross salary


Writa a program to print a number in word eg if 972 is entered through the keyboard that should print nine seven two?

nine seven two


What is the function of a keyboard to the computer-and-part-of-keyboard?

the keyboard enable the user to communicate with the computer through typying of(input of data).


How are things sold through Personal selling?

Selling can take place through a retail transaction, a business-to-business transaction, or through telemarketing


How are things sold through professional selling?

Selling can take place through a retail transaction, a business-to-business transaction, or through telemarketing


How do you fill snap form for MBA?

through keyboard


How are things sold through professional personal selling?

Selling can take place through a retail transaction, a business-to-business transaction, or through telemarketing


What mechanism do Pianists and harpsichordists manipulate sound through?

Keyboard


How can you replace your droids keyboard?

Yes, you can replace the keyboard. 1. Go to market place on your phone. 2. Type in keyboard in the search bar and browse through which keyboard you would like to try. ( a very popular, well developed keyboard is smartkeyboard) 3. install the application and follow the instructions as to how to set it is as your default keyboard.


What is the keyboard command for a subscript in a mac?

Hold the apple/command key and the (=/+) key and then type what you want...This works in Microsoft word... not such about anything else.


When was Careers Through Culinary Arts Program created?

Careers Through Culinary Arts Program was created in 1990.


How can you run through slides in a slide show?

you press on the arrow keys on the keyboard.