Concept explainers
Design a class to represent a credit card. Think about the attributes of a credit card; that is, what data is on the card? What behaviors might be reasonable for a credit card? Use the answer to these questions to write a UML class diagram for a credit card class. Then give three examples or instances of this class.
Unified Modeling Language (UML)
Unified Modeling Language (UML) is a modeling language in software engineering, which is used to visualize the design of the proposing system.
- In software development life cycle, it comes under the “documenting the program” phase.
- UML is used to document the developing system; this documentation helps the end user to understand the whole project.
- It visualizes all the components used in the developed object-oriented software; it shows all the elements and its relation.
Class diagram:
Class diagram is a static model which represents the system’s static structure and its relationship using attributes, relationships, objects, and operations.
- The relationship between the classes in the class diagram is called association.
- It is represented by drawing a line called association path between classes and placing the labels in between the association path.
- The instance of one class can be associated with more than one instance of another class and it is referred as multiplicity.
Steps to create class diagram:
- Identify objects
- Identify the attributes and behaviors
- Draw association between the classes.
Representing the class diagram:
- Every class in the class diagram is represented using a rectangle.
- The rectangle is divided into three parts,
- The first part contains the name of the class
- The middle part contains the attributes and derived attributes
- The last part contains the methods.
Class name |
-Attribute name |
+Operation name() |
Explanation of Solution
Attributes:
- Initially, identify the reasonable attributes for “CreditCard” class.
- The “CreditCard” contains the card number, card name, expiry date for card, and so on.
- So, let us take the followings are the attributes for “CreditCard” class.
- “cardNo”
- “name”
- “cardExpiryDate”
Explanation of Solution
Behaviors:
- Initially, identify the reasonable behaviors for “CreditCard” class.
- The “CreditCard” contains the “getCredit”, “getPurchase” and so on.
- So, let us take the followings are the behaviors for “CreditCard” class.
- “getCredit()”
- “getPurchase()”
Explanation of Solution
The UML class diagram for credit card is shown below:
The “CreditCard” class is shown in the following class diagram:
Explanation:
In the above diagram,
- The class name is “CreditCard”.
- The “cardNo”, “name”, and “cardExpiryDate” are attributes of “CreditCard” class.
- The “getCredit()” and “getPurchase()” are methods or operation name of “CreditCard” class.
- “getCredit()” method is used to gets the credit card amount from bank.
- “getPurchase()” is used to purchase the products by using the credit card.
Examples of objects of this “CreditCard”class:
First object:
The first object is “customer1” for this “CreditCard” class is shown below:
Explanation:
In the above diagram,
- The “customer1” object for “CreditCard” class.
- Assign the “cardNo” as “123456”, “name” as “XXXX” and “cardExpiryDate” as “03/02/2001” are the attributes of the “CreditCard” class.
Second object:
The second object is “customer2” for this “CreditCard” class is shown below:
Explanation:
In the above diagram,
- The “customer2” object for “CreditCard” class.
- Assign the “cardNo” as “234578”, “name” as “YYYY” and “cardExpiryDate” as “12/11/2022” are the attributes of the “CreditCard” class.
Third object:
The third object is “customer3” for this “CreditCard” class is shown below:
Explanation:
In the above diagram,
- The “customer3” object for “CreditCard” class.
- Assign the “cardNo” as “341579”, “name” as “ZZZZ” and “cardExpiryDate” as “01/02/2010” are the attributes of the “CreditCard” class.
Want to see more full solutions like this?
Chapter 5 Solutions
Java: An Introduction to Problem Solving and Programming (8th Edition)
Additional Engineering Textbook Solutions
Problem Solving with C++ (10th Edition)
Mechanics of Materials (10th Edition)
SURVEY OF OPERATING SYSTEMS
Java How to Program, Early Objects (11th Edition) (Deitel: How to Program)
Starting Out with C++ from Control Structures to Objects (9th Edition)
Elementary Surveying: An Introduction To Geomatics (15th Edition)
- Modern life has been impacted immensely by computers. Computers have penetrated every aspect of oursociety, either for better or for worse. From supermarket scanners calculating our shopping transactionswhile keeping store inventory; robots that handle highly specialized tasks or even simple human tasks,computers do much more than just computing. But where did all this technology come from and whereis it heading? Does the future look promising or should we worry about computers taking over theworld? Or are they just a necessary evil? Provide three references with your answer.arrow_forwardWhat are the steps you will follow in order to check the database and fix any problems with it? Have in mind that you SHOULD normalize it as well. Describe in full, consider the following:• Taking the database offline is not allowed since people are connected to it.• Personal data might be bridged and not secured. Provide three refernces with you answerarrow_forwardYou are called by your supervisor to go and check a potential data bridge problem. What are the stepsyou will follow in order to check the database and fix any problems with it? Have in mind that youSHOULD normalize it as well. Describe in full, consider the following:• Taking the database offline is not allowed since people are connected to it.• Personal data might be bridged and not secured. Provide three refernces with you answerarrow_forward
- (A) A cellular system has 12 microcells with 10 channels per cell. The microcells are split into 3 microcells, and each microcell is further split into 4 picocells. Determine the number of channels available in system after splitting into picocelles.arrow_forwardQuestion 8 (10 points) Produce a relational schema diagram that corresponds to the following ER diagram for a Vacation Property Rentals database. Your relational schema diagram should include primary & foreign keys. Upload your relational schema diagram as a PDF document. Don't forget that the relation schemas for "Beach Property" and "Mountain Property" should each have primary keys. FYI: "d" in this notation denotes a subclass. Figure 2: ER Diagram for Question 8 id first RENTER name middle last address phone email 1 signs N id begin date RENTAL AGREEMENT end date amount N street address books city id 1 state address num. rooms PROPERTY zip code base rate type propertyType blocks to beach activity "B" "M" BEACH PROPERTY MOUNTAIN PROPERTYarrow_forwardNotes: 1) Answer All Question, 2) 25 points for each question QI Figurel shows the creation of the Frequency Reuse Pattern Using the Cluster Size K: (A) illustrates how i and j can be used to locate a co-channel cell. huster 3 Cluster Cluster 2 X=7(i=2,j1)arrow_forward
- You are called by your supervisor to go and check a potential data bridge problem. What are the stepsyou will follow in order to check the database and fix any problems with it? Have in mind that youSHOULD normalize it as well. Describe in full, consider the following taking the database offline is not allowed since people are connected to it and how personal data might be bridged and not secured.Provide three references with you answer.arrow_forwardYou are called by your supervisor to go and check a potential data bridge problem. What are the stepsyou will follow in order to check the database and fix any problems with it? Have in mind that youSHOULD normalize it as well. Describe in full, consider the following:• Taking the database offline is not allowed since people are connected to it.• Personal data might be bridged and not secured. Provide three refernces with you answerarrow_forwardYou are called by your supervisor to go and check a potential data bridge problem. What are the stepsyou will follow in order to check the database and fix any problems with it? Have in mind that youSHOULD normalize it as well. Describe in full, consider the following:• Taking the database offline is not allowed since people are connected to it.• Personal data might be bridged and not secured. Provide three refernces with you answer from websitesarrow_forward
- Modern life has been impacted immensely by computers. Computers have penetrated every aspect of oursociety, either for better or for worse. From supermarket scanners calculating our shopping transactionswhile keeping store inventory; robots that handle highly specialized tasks or even simple human tasks,computers do much more than just computing. But where did all this technology come from and whereis it heading? Does the future look promising or should we worry about computers taking over theworld? Or are they just a necessary evil? Provide three references with your answer.arrow_forwardObjective: 1. Implement a custom Vector class in C++ that manages dynamic memory efficiently. 2. Demonstrate an understanding of the Big Five by managing deep copies, move semantics, and resource cleanup. 3. Explore the performance trade-offs between heap and stack allocation. Task Description: Part 1: Custom Vector Implementation 1. Create a Vector class that manages a dynamically allocated array. 。 Member Variables: ° T✶ data; // Dynamically allocated array for storage. std::size_t size; // Number of elements currently in the vector. std::size_t capacity; // Maximum number of elements before reallocation is required. 2. Implement the following core member functions: Default Constructor: Initialize an empty vector with no allocated storage. 。 Destructor: Free any dynamically allocated memory. 。 Copy Constructor: Perform a deep copy of the data array. 。 Copy Assignment Operator: Free existing resources and perform a deep copy. Move Constructor: Transfer ownership of the data array…arrow_forward2.68♦♦ Write code for a function with the following prototype: * Mask with least signficant n bits set to 1 * Examples: n = 6 -> 0x3F, n = 17-> 0x1FFFF * Assume 1 <= n <= w int lower_one_mask (int n); Your function should follow the bit-level integer coding rules Be careful of the case n = W.arrow_forward
- Programming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningNew Perspectives on HTML5, CSS3, and JavaScriptComputer ScienceISBN:9781305503922Author:Patrick M. CareyPublisher:Cengage Learning