CS 171 Chapter Notes - Chapter 5: Include Directive, Ampersand, Operator Overloading

45 views6 pages

Document Summary

Having two sets of these variables suggests that a common concept is lurking just under the surface: each of these two sets of variables describes a product. When using getline(input), you do not need to use cin >>. The getline function reads an entire line of input, including the newline character at the end of the line and puts those characters except for the newline character into a string variable. Every class has a public interface: a collection of member functions through which the objects of the class can be manipulated. The public interface must be defined for a class first and foremost. Interface of the product class consists of all functions that are wanted to apply to product objects. Need to be able to: make a new product object, read in a product object. 2: compare two products and find out which one is better, print a product.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents