A very simple program that I wrote using C++ to solve the product cost this program is very useful in business day to day operations. I am using CodeBlocks as my text editor and Dev C++ as my C++ compiler in this sample program. Thank you.
My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.
My mobile number here in the Philippines is 09173084360.
Program Listing
#include <iostream>
#include <iomanip>
using namespace std;
struct item {
string name,type;
int quantity;
float price;
};
main() {
item product;
float solve=0.00;
cout << "\n\tProduct Description 1.0";
cout << "\n\n";
cout << "Enter Product Name : ";
getline(cin,product.name);
cout << "Enter Product Description : ";
getline(cin,product.type);
cout << "Enter Product Quantity : ";
cin >> product.quantity;
cout << "Enter Product Price/Pcs : ";
cin >> product.price;
solve = (product.quantity * product.price);
cout << fixed << setprecision(2);
cout << "\n === Report ===";
cout << "\n\n";
cout << "\nProduct Name : " << product.name;
cout << "\nProduct Type : " << product.type;
cout << "\nQuantity : " << product.quantity;
cout << "\nPrice : " << product.price;
cout << "\n\n Total Cost : $ " << solve;
cout << "\n\n";
system("pause");
}
No comments:
Post a Comment