The three levels inheritance hierarchy is shown in the UML below.      A) A set of pre-conditions, post-conditions and invariants are given as below.  pre-condition: 0

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter1: A First Program Using C#
Section: Chapter Questions
Problem 7RQ: The technique of packaging an objects attributes into a cohesive unit that can be used as an...
icon
Related questions
Question

The three levels inheritance hierarchy is shown in the UML below. 

 

 

A) A set of pre-conditions, post-conditions and invariants are given as below. 

pre-condition: 0<input <100
pre-condition:  0<input  <50
pre-condition:  0< input  < 1000

post-condition: Finds all the characters that are repeated more than 5 times in the parentField in the interval of [0, input) and returns them in a form of a string. 
post-condition: Finds all the duplicated characters in the parentField in the interval of [0, input) and returns them in a form of a string, while it labels the number of the duplication before the character 
post-condition: Finds all the duplicated characters in the parentField in the interval of [0, input) and returns them in a form of a string. 

 

invariant: parentFiled remains unchanged and contains letters only. 
invariant: parentFiled remains unchanged and contains letters and numbers only.
invariant: parentFiled remains unchanged.

Specify to which class's methodA (Parent's methodA, Child's methodA and Grandchild's methodA),  these DBCs (design by contracts) belong and why?

B) One of the methods  in this hierarchy throws an Exception . Which one can it be? 

The three levels inheritance hierarchy is shown in the UML below.
Parent
+ parentField: String
+ methodA(int): String
Child
+ ChildField: int
+ methodA(int): String
Grandchild
+ grandchildField: double
+ methodA(int): String
A) A set of pre-conditions, post-conditions and invariants are given as below.
pre-condition: 0<input <100
pre-condition: 0<input <50
pre-condition: 0< input < 1000
post-condition: Finds all the characters that are repeated more than 5 times in the parentField in the interval of [0, input) and returns them in a form of a string.
post-condition: Finds all the duplicated characters in the parentField in the interval of [0, input) and returns them in a form of a string, while it labels the number of the duplication before the character
post-condition: Finds all the duplicated characters in the parentField in the interval of [0, input) and returns them in a form of a string.
invariant: parentFiled remains unchanged and contains letters only.
invariant: parentFiled remains unchanged and contains letters and numbers only.
invariant: parentFiled remains unchanged.
Specify to which class's methodA (Parent's methodA, Child's methodA and Grandchild's methodA), these DBCS (design by contracts) belong and why?
B) One of the methods in this hierarchy throws an Exception . Which one can it be?
Transcribed Image Text:The three levels inheritance hierarchy is shown in the UML below. Parent + parentField: String + methodA(int): String Child + ChildField: int + methodA(int): String Grandchild + grandchildField: double + methodA(int): String A) A set of pre-conditions, post-conditions and invariants are given as below. pre-condition: 0<input <100 pre-condition: 0<input <50 pre-condition: 0< input < 1000 post-condition: Finds all the characters that are repeated more than 5 times in the parentField in the interval of [0, input) and returns them in a form of a string. post-condition: Finds all the duplicated characters in the parentField in the interval of [0, input) and returns them in a form of a string, while it labels the number of the duplication before the character post-condition: Finds all the duplicated characters in the parentField in the interval of [0, input) and returns them in a form of a string. invariant: parentFiled remains unchanged and contains letters only. invariant: parentFiled remains unchanged and contains letters and numbers only. invariant: parentFiled remains unchanged. Specify to which class's methodA (Parent's methodA, Child's methodA and Grandchild's methodA), these DBCS (design by contracts) belong and why? B) One of the methods in this hierarchy throws an Exception . Which one can it be?
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Class
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
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage