Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Program outputs th cost cost of a quantity of an item
- #include <iostream.h>
- #include <iomanip.h>
- #include <fstream.h>
- int main ()
- {
- int partNumber; // Integer for the part number of the item
- int quantity; // Integer for the quantiy of the item
- double PPU; // Double for the price per unit
- double total; // Double for the total price off all the items
- ifstream inData;
- inData.open ("Data.In");
- inData >> partNumber >> quantity >> PPU;
- // Calculates the total of the items
- total = PPU * quantity;
- // Outputs the cost of the items
- cout << "The total cost of " << quantity << " " << partNumber << " " << "is "
- << total << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement