https://github.com/julianamancera/lab_sw-3_visitor_pattern
https://github.com/julianamancera/lab_sw-3_visitor_pattern
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/julianamancera/lab_sw-3_visitor_pattern
- Owner: JulianaMancera
- Created: 2025-03-05T05:32:06.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2025-03-05T05:40:39.000Z (2 months ago)
- Last Synced: 2025-03-05T06:29:46.685Z (2 months ago)
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Lab_SW-3_Visitor_Pattern
Imagine you are looking for a new mobile plan for your smartphone. Three major telecommunication providers are offering enticing deals: Smart, Globe, and Ditto.
- **Smart:** Offers a data allowance of 15 GB for ₱500 per month. However, they do not offer any free calls or texts, and you will be charged per use.
- **Globe:** Provides a data allowance of 10 GB for ₱450 per month. This plan comes with unlimited calls and texts to subscribers within their network. Calls and texts to other networks are charged extra.
- **Ditto:** Offers a data allowance of 8 GB for ₱400 per month. This plan includes unlimited calls and texts to all networks within the country.### Test your codes before the given client program:
```
public class TelcoPromo {
public static void main(String[] args) {
TelcoSubscription smart = new Telco(15, 500, Smart,false);
TelcoSubscription globe = new Telco(10, 450, Globe,true);
TelcoSubscription ditto = new Telco(8, 400, Ditto,true);UsagePromo promo = new TelcoAllowance();
UnliCallOffer unli = new UnliCallTextPackage();System.out.println("Smart Data Usage Offer and price: " + promo.showAllowance(smart.getTelcoName(), smart.getPromoPrice()));
System.out.println("Globe Data Usage Offer and price" + promo.showAllowance(globe.getTelcoName(), globe.getPromoPrice()));
System.out.println("Ditto Data Usage Offer and price" + promo.showAllowance(ditto.getTelcoName(), ditto.getPromoPrice()));System.out.println("\nSmart unlimited calls and text package: " +
unli.showUnliCallsTextOffer(smart.getTelcoName(), smart.getUnliCallText()));
System.out.println("Globe unlimited calls and text package: " +unli.showUnliCallsTextOffer(globe.getTelcoName(), globe.getUnliCallText()));
System.out.println("Ditto unlimited calls and text package: " +unli.showUnliCallsTextOffer(ditto.getTelcoName(), ditto.getUnliCallText()));
}
}`````
### UML DIAGRAM
