You will create the class appleproduct this class


Programming Assignment

Introduction

iPhone X was announced on September 12, 2017 at the Steve Jobs Theater in the Apple Park campus in Cupertino. The device marks the iPhone's tenth anniversary, with X being used for the symbol 10. It eventually was released across the globe for purchase starting on November 3, 2017. With this product introduction, the AppleStore was selling iPhone X, iPhone 8, iPhone 8 Plus as well as Watch 1, Watch 3 and iPad and iPad Pro products in various color and memory configurations.

Task

Your assignment is to produce a two classes that work together to sell Apple products. In an effort to help you, the design of these two classes will be discussed here. In addition, some sample code has been provided to assist you with this task. Various UML diagrams are shown below to communicate the code you need to create. Please follow the steps outlined below and don't jump ahead until you have finished the earlier step.

Both of these classes must be part of namespace cs31.

First, you will create the class AppleProduct. This class represents a generic product sold by Apple Inc. Please review the class diagram shown here:

987_Class-Diagram.jpg

As designed, the class AppleProduct store two different strings, a double and an enumerated kind value. and provides accessor methods for each one. The Kind enumeration will need to be a public part of the class AppleProduct . The class diagram lists all the possible Kind value choices to be either NOTSPECIFIED, IPHONE, IPAD or WATCH. Create a .h and .cpp for this class. Write some sample driver code and assertions to verify that your accessor methods are all working properly. The AppleProduct class should accept whatever parameters are supplied to it. It should not perform any data validation and it should not incorporate the logic of the configuration tables shown above. It should just take the value of the passed arguments and place them into the class member variables.

The second class you will create is called AppleStore. A customer will use the AppleStore class to buy the particular AppleProduct they are interested in. Please review the class diagram shown here:

1856_Class-Diagram1.jpg

All of the public operations of AppleStore will validate the arguments supplied and then return an AppleProduct. The relationship between the class AppleStore and AppleProduct referred to as "creational pattern" and can be diagrammed in the following manner:

1958_AppleStore.jpg

Once you get to this point, there are seven remaining class methods to implement. Each are described below.

1. AppleProduct AppleStore::buyWatch1(string color);

This method should return a AppleProduct with the version set to "1", the kind set to WATCH, the color set to the string parameter passed here and the cost set to $249.00.

2. AppleProduct AppleStore::buyWatch3(string color);

This method should return a AppleProduct with the version set to "3", the kind set to WATCH, the color set to the string parameter passed here and the cost set to $329.00.

3. AppleProduct AppleStore::buyiPad( string color, int gigabytes );

This method should return a AppleProduct with the version set to "", the kind set to IPAD, the color set to the string parameter passed here and the cost set to either $329.00 or $429.00, depending on the gigabytes desired. Should the user pass an invalid value for the desired gigabytes, this method should throw a std::logic_error to communicate this failure back to the calling code.

4. AppleProduct AppleStore::buyiPadPro( string color, int gigabytes );

This method should return a AppleProduct with the version set to "Pro", the kind set to IPAD, the color set to the string parameter passed here and the cost set to either $649.00, $799.00 or $999.00, depending on the gigabytes desired. Should the user pass an invalid value for the desired gigabytes, this method should throw a std::logic_error to communicate this failure back to the calling code.

5. AppleProduct AppleStore::buyiPhone8( string color, int gigabytes );

This method should return a AppleProduct with the version set to "8", the kind set to IPHONE, the color set to the string parameter passed here and the cost set to either $699.00 or $849.00, depending on the gigabytes desired. Should the user pass an invalid value for the desired gigabytes, this method should throw a std::logic_error to communicate this failure back to the calling code.

6. AppleProduct AppleStore::buyiPhone8Plus( string color, int gigabytes );

This method should return a AppleProduct with the version set to "8Plus", the kind set to IPHONE, the color set to the string parameter passed here and the cost set to either $799.00 or $949.00, depending on the gigabytes desired. Should the user pass an invalid value for the desired gigabytes, this method should throw a std::logic_error to communicate this failure back to the calling code.

7. AppleProduct AppleStore::buyiPhoneX( string color, int gigabytes );

This method should return a AppleProduct with the version set to "X", the kind set to IPHONE, the color set to the string parameter passed here and the cost set to either $999.00 or $1,149.00, depending on the gigabytes desired. Should the user pass an invalid value for the desired gigabytes, this method should throw a std::logic_error to communicate this failure back to the calling code.

You are free to create additional public and private methods and data members as you see fit. However, the test cases will only be driving the public methods of the two classes diagrammed here. Please be certain to create these exactly as stated in this specifications.

The source files you turn in will these classes and a main routine. You can have the main routine do whatever you want, because we will rename it to something harmless, never call it, and append our own main routine to your file. Our main routine will thoroughly test your functions. You'll probably want your main routine to do the same. If you wish, you may write functions in addition to those required here. We will not directly call any such additional functions. If you wish, your implementation of a function required here may call other functions required here.

The program you turn in must build successfully, and during execution, no method may read anything from cin. If you want to print things out for debugging purposes, write to cerr instead of cout. When we test your program, we will cause everything written to cerr to be discarded instead - we will never see that output, so you may leave those debugging output statements in your program if you wish.

Attachment:- Assignment.rar

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: You will create the class appleproduct this class
Reference No:- TGS02678763

Expected delivery within 24 Hours