Electrical and Computer Engineering
36 of 37
UAH
CPE 112
Interactive Input/Output
•    cout << "Enter the part number:" << endl;          // Prompt
•    cin >> partNumber;
• 
•    cout << "Enter the quantity of this part ordered:" // Prompt
•         << endl;
•    cin >> quantity;
• 
•    cout << "Enter the unit price for this part:"      // Prompt
•         << endl;
•    cin >> unitPrice;
• 
•    totalPrice = quantity * unitPrice;
•    cout << "Part " << partNumber                      // Echo print
•         << ", quantity " << quantity
•         << ", at $ " << unitPrice << " each" << endl;
•    cout << "totals $ " << totalPrice << endl;
•    return 0;
•}
•