Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- int main()
- {
- //define variables
- float item_price;
- float item_price2;
- float sales_tax_rate = 0.6;
- float sales_tax, total;
- float total_price;
- cout<<"Enter the price item : " <<endl;
- cin>> item_price;
- cout<< "Enter the price item 2: "<<end1;
- cin>> item_price2;
- //calculations
- total_price = ( item_price + item_price2);
- sales_tax = item_price * sales_tax_rate;
- total = total_price + sales_tax;
- //display the result;
- cout<< "The item Price is: " <<total_price<<endl;
- cout<< "The sales tax is: "<< sales_tax<<endl;
- cout<<" The total cost is "<<total<<endl;
- system("pause");
- }
- #include < iostream >
- using namespace std;
- int main()
- {
- double length;
- double width;
- double area;
- // inform user to enter data
- cout<< "Enter a value for length: " << endl;
- cin>>length;
- cout<<"Enter a value for width:" << endl;
- cin>>width;
- //calculations
- area= length * width;
- //display the results
- cout<<"The value of length is:" << length<<endl;
- cout<<"The value of width is:" << width<<endl;
- cout<<"The value of area is:" <<area<<endl;
- system("pause");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement