โ Back to Classes
Question 44
Display Product
Display Product
Create a class Product with private fields name (string) and price (double). Add display() that returns: "name: price". Do NOT write a main function.
Expected Output:
Notebook: 2.5
Topics:
Classes
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท Ctrl+Space to expand shortcuts (cout, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.