bartleby

Concept explainers

bartleby

Videos

Question
Book Icon
Chapter 5, Problem 1E
Expert Solution
Check Mark
Program Plan Intro

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”
Expert Solution
Check Mark

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()”
Expert Solution
Check Mark

Explanation of Solution

The UML class diagram for credit card is shown below:

The "CreditCard" class is shown in the following class diagram:

Java: An Introduction to Problem Solving and Programming (8th Edition), Chapter 5, Problem 1E , additional homework tip 1

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:

Java: An Introduction to Problem Solving and Programming (8th Edition), Chapter 5, Problem 1E , additional homework tip 2

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:

Java: An Introduction to Problem Solving and Programming (8th Edition), Chapter 5, Problem 1E , additional homework tip 3

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:

Java: An Introduction to Problem Solving and Programming (8th Edition), Chapter 5, Problem 1E , additional homework tip 4

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?

Subscribe now to access step-by-step solutions to millions of textbook problems written by subject matter experts!
08:30
Students have asked these similar questions
Python - Need help! How do I have an input in turtle to display my name below the circle it draws and another input to display my age written below that? Code: import turtlebackground = "#FFFFFF" def draw_circle(radius, line_color, fill_color): my_turtle.color(line_color) my_turtle.fillcolor(fill_color) my_turtle.begin_fill() my_turtle.circle(radius) my_turtle.end_fill() def move_turtle(x, y): my_turtle.penup() my_turtle.goto(x, y) my_turtle.pendown() turtle.done()
Need help fixing my python code! Images attached on the required modficications I dont know how to do. Simpler the better.Code: (in images)
Answer all of the questions with steps by step explanation to every question.

Chapter 5 Solutions

Java: An Introduction to Problem Solving and Programming (8th Edition)

Chapter 5.1, Problem 11STQ Chapter 5.1, Problem 12STQ Chapter 5.2, Problem 13STQ Chapter 5.2, Problem 14STQ Chapter 5.2, Problem 15STQ Chapter 5.2, Problem 16STQ Chapter 5.2, Problem 17STQ Chapter 5.2, Problem 18STQ Chapter 5.2, Problem 19STQ Chapter 5.2, Problem 20STQ Chapter 5.2, Problem 21STQ Chapter 5.2, Problem 22STQ Chapter 5.2, Problem 23STQ Chapter 5.3, Problem 24STQ Chapter 5.3, Problem 25STQ Chapter 5.3, Problem 26STQ Chapter 5.3, Problem 27STQ Chapter 5.3, Problem 28STQ Chapter 5.3, Problem 29STQ Chapter 5.3, Problem 30STQ Chapter 5.3, Problem 31STQ Chapter 5.3, Problem 32STQ Chapter 5.4, Problem 33STQ Chapter 5, Problem 1E Chapter 5, Problem 2E Chapter 5, Problem 3E Chapter 5, Problem 4E Chapter 5, Problem 5E Chapter 5, Problem 6E Chapter 5, Problem 7E Chapter 5, Problem 8E Chapter 5, Problem 9E Chapter 5, Problem 10E Chapter 5, Problem 1P Chapter 5, Problem 2P Chapter 5, Problem 3P Chapter 5, Problem 4P Chapter 5, Problem 5P Chapter 5, Problem 1PP Chapter 5, Problem 2PP Chapter 5, Problem 3PP Chapter 5, Problem 4PP Chapter 5, Problem 5PP Chapter 5, Problem 6PP Chapter 5, Problem 7PP Chapter 5, Problem 8PP Chapter 5, Problem 9PP Chapter 5, Problem 10PP Chapter 5, Problem 11PP Chapter 5, Problem 12PP

Additional Engineering Textbook Solutions

Find more solutions based on key concepts
Safety measures involved in land surveying

Elementary Surveying: An Introduction To Geomatics (15th Edition)

Knowledge Booster
Background pattern image
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
    SEE MORE QUESTIONS
    Recommended textbooks for you
    Text book image
    Programming Logic & Design Comprehensive
    Computer Science
    ISBN:9781337669405
    Author:FARRELL
    Publisher:Cengage
    Text book image
    Microsoft Visual C#
    Computer Science
    ISBN:9781337102100
    Author:Joyce, Farrell.
    Publisher:Cengage Learning,
    Text book image
    EBK JAVA PROGRAMMING
    Computer Science
    ISBN:9781337671385
    Author:FARRELL
    Publisher:CENGAGE LEARNING - CONSIGNMENT
    Text book image
    C++ for Engineers and Scientists
    Computer Science
    ISBN:9781133187844
    Author:Bronson, Gary J.
    Publisher:Course Technology Ptr
    Text book image
    C++ Programming: From Problem Analysis to Program...
    Computer Science
    ISBN:9781337102087
    Author:D. S. Malik
    Publisher:Cengage Learning
    Text book image
    New Perspectives on HTML5, CSS3, and JavaScript
    Computer Science
    ISBN:9781305503922
    Author:Patrick M. Carey
    Publisher:Cengage Learning
    Introduction to Classes and Objects - Part 1 (Data Structures & Algorithms #3); Author: CS Dojo;https://www.youtube.com/watch?v=8yjkWGRlUmY; License: Standard YouTube License, CC-BY