Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In an online billing system, Salesorder Item must have a cost data member that cannot be less than zero. How can you ensure that this
In an online billing system, Salesorder Item must have a cost data member that cannot be less than zero. How can you ensure that this condition will be maintained?Define a global variable to store the cost data and a function that checks that the cost is never less than zero. Define a SalesOrder Item class with a public cost data member and add a comment advising programmers that the cost cannot be less than zero. Define a SalesOrder Item class with a private cost data member and define public mutator functions that never let the cost value to be less than zero. All of these options can be used to ensure that the cost is less than zero.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started