Function Definition ex.

PHOTO EMBED

Fri Sep 23 2022 02:55:07 GMT+0000 (UTC)

Saved by @Kyle #c++

#include <iostream>
using namespace std;

double total_cost(int number_par, double price_par) {
}

int main()
{
    double price, bill;
    int number;
    
    cout << "Enter the number of items purchased: ";
    cin >> number;
    cout << "Enter the price per item $";
    cin >> price;
    
    bill = total_cost(number, price);
    
    cout.setf(ios::fixed);
    cout.setf(ios::showpoint);
    cout.precision(2);
    cout << number << " items at "
    << "$" << price << " each.\n"
    << "Final bill, including tax, is $" << bill
    << endl;
    
    return 0;
}
content_copyCOPY