Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle 12c SQL

Authors: Joan Casteel

3rd edition

1305251032, 978-1305251038

More Books

Students also viewed these Databases questions