Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions