Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Strategy pattern is used when we have multiple algorithms for a specific task and client decides the actual implementation to be used at runtime. For
Strategy pattern is used when we have multiple algorithms for a specific task and client decides the actual implementation to be used at runtime. For this task, complete the simple Shopping Cart implementation modelled in the CDC diagram below where there are two payment strategies using Credit Card or using PayPal. Summary: Create a simple application described in a provided CDC diagram. Questions: Task : Strategy pattern is used when we have multiple algorithms for a specific task and client decides the actual implementation to be used at runtime. For this task, complete the simple Shopping Cart implementation modelled in the CDC diagram below where there are two payment strategies using Credit Card or using PayPal. Complete the Implementation of the application in the CDC diagram following exactly the steps below: Create a folder named YourIDTask and initialize in it a Git repository. Configure the repository to ignore class files. Open Notepad and create a text file for Git commands and its output. Initially, save the file empty with name logtxt Use Notepad create Java files for your code. Save files into the repository. During coding, make sure you work incrementally; that is: a Define an empty class b Save file containing class c Compile file using javac followed by the file name d If your compilation is successful, stage the source file, store it in the repository, e Copy all Git commands to logtxt and save it to the repository folder, stage it and store it into the Git repository. f Repeat Step d Repeat Step until all classes and methods are completed. Track all files. Store all files to the repository. Show the status of your repository. Append Git commands and results to logtxt and store it to your repository. Compress the repository and upload at Task link in the Lab course website. Your Solution: Interface PaymentStrategy Public class PaypalStrategy Public class CreditCardStrategy
Strategy pattern is used when we have multiple algorithms for a specific task and client decides the actual implementation to be used at runtime.
For this task, complete the simple Shopping Cart implementation modelled in the CDC diagram below where there are two payment strategies using Credit Card or using PayPal.
Summary: Create a simple application described in a provided CDC diagram.
Questions:
Task : Strategy pattern is used when we have multiple algorithms for a specific task and client decides the actual implementation to be used at runtime. For this task, complete the simple Shopping Cart implementation modelled in the CDC diagram below where there are two payment strategies using Credit Card or using PayPal.
Complete the Implementation of the application in the CDC diagram following exactly the steps below:
Create a folder named YourIDTask and initialize in it a Git repository.
Configure the repository to ignore class files.
Open Notepad and create a text file for Git commands and its output. Initially, save the file empty with name logtxt
Use Notepad create Java files for your code. Save files into the repository.
During coding, make sure you work incrementally; that is:
a Define an empty class
b Save file containing class
c Compile file using javac followed by the file name
d If your compilation is successful, stage the source file, store it in the repository,
e Copy all Git commands to logtxt and save it to the repository folder, stage it and store it into the Git repository.
f Repeat Step d
Repeat Step until all classes and methods are completed.
Track all files.
Store all files to the repository.
Show the status of your repository.
Append Git commands and results to logtxt and store it to your repository.
Compress the repository and upload at Task link in the Lab course website.
Your Solution:
Interface PaymentStrategy
Public class PaypalStrategy
Public class CreditCardStrategy
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