Question
Hello I need help with this question, thank you. Use the following specification to code a complete C++ module named PickingOrder : enum class BagSize
Hello I need help with this question, thank you.
Use the following specification to code a complete C++ module named PickingOrder:
enum class BagSize { FiveLB, TenLB, FifteenLB, TwentyLB };
This module represent a guest that comes to an orchard to pick apples directly from trees.
Basic Details
Your PickingOrder class includes at least the following data members:
the address of a C-style null-terminated string of client-specified length that holds the guest name (composition relationship).
Valid Name: any string that starts with an upper-case letter.
the size of the bag using one of the enumeration constants defined above, defaulting to FiveLB.
Public Member Functions
- Default constructor
A custom constructor that receives as parameters:
- the size of the bag (optional);
- the address of a C-style null-terminated string containing the guest name.
A function named getPrice.
If the current object is not in an empty state, this function calculates the price for the order according to the following rules:
- FiveLB costs 15$,
- TenLB costs 25$,
- FifteenLB costs 35$,
- TwentyLB costs 45$
A class function named totalNoOfOrders returns the number of PickingOrder objects that currently exist in the program and have not yet been destroyed.
Other Features
Include in your design all special member functions required to manage your objects.
You are allowed to add as many private members as you see fit.
Your design should not generate any memory leaks, should meet the C++17 standard and should apply best practices.
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