Question: Include a string variable, name. Modify this C++ program to ask the user for the name of the item. Display the name of the item

Include a string variable, name. Modify this C++ program to ask the user for the name of the item. Display the name of the item along with the total price. Set the precision for the price back to two decimal places.

#include #include

using namespace std; int main() { //declare variables int quantity; // contains the amount of items purchased double itemPrice; // contains the price of each item double totalBill; // contains the total bill //prompt for number of items // formatted output cout<>quantity; cout<<"Enter price: "; cin>>itemPrice; totalBill=itemPrice*quantity; cout<< setprecision(4) <

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!