0% found this document useful (0 votes)
9 views

B Tech Notes 2

Uploaded by

chatgpt9714
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

B Tech Notes 2

Uploaded by

chatgpt9714
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

ASSIGNMENTS FOR BTech IT, Sem -6, Subject: DESIGN PATTERNS & APPL.

FRAMEWORKS

1. What problems we face while using tradi onal Collec on API containers (prior J2SE 5.0)?
How Generic containers solved those problems.

2. Create a console based Java applica on that solves the given problem. Assume a situa on
that adults want to vote on the day of an elec on for which voters need to visit a vo ng
booth. On the day of vo ng, voters may not come as per their assigned serial numbers.
Whenever a voter visits, the officer wants to quickly find voter’s name in the vo ng register
based on the voter’s serial number. Choose appropriate generic container to solve the
problem and show tes ng of the solu on using an appropriate test scenario.

3. Create a page shown in the figure. When a user writes some new task and clicks on “+”
bu on it should be added to the list below as shown in the figure. When the user clicks on
“X” bu on, the task should get deleted from the list. When the user clicks on radio bu on
the task should get cancelled as shown in figure. For header por on use red as background
color and white as foreground. For tasks use blue as background and white as foreground
color. Keep Font type as Arial.

4. Analyze the given situa ons and draw class diagrams showing designs of the solu ons; use
proper names of classes and appropriate rela onship: (1) We can have ClassNote(s) of three
subjects (DesignPa erns, AdvancedJava, and DevOps). When a consumer (student or a
teacher) requests for an object of a class note, the copy of the class note should be created
quickly. (2) Informa on about Complaint(s) can be stored or retrieved from a persistent
storage. We should be able to quickly change persistent mechanism (DBMS, XML, or JSON)
and the client requires minimal changes.

5. Analyze the following requirements and choose appropriate design pa ern to solve the
problem; write code for a solu on of the following problem: We can have shapes such as
Square and Oval. When we display them, we can apply different styles to these shapes. The
style is do ed line and solid line. If we add new shape (e.g., Triangle) in our applica on, we
should be able to apply these styles to the new shapes.

6. Apply concepts of Java’s func onal programming to solve the given problem. There is a class
named Student. Assume this class has the following data members and appropriate
ge er/se er methods: name, cpi, gender, and twel hPercentage, in which name and gender
are String and cpi and twel hPercentage are float. Implement the following method:
List<Student> getEligible(List<Student> list, Predicate<Student> selector) that can return a
list of eligible students based on passed lambda expression, as the second argument. Also
write the method-calls to use the above method with appropriate lambda expressions for
the two cases: we want to get two lists: (i) all MALE students having cpi more than 7.49, (ii)
all students whose cpi is more than 7.49 and twel hPercentage is more than 59.99. (Note:
do not write Student class; write only implementa on of getEligible() method and two
lambda expressions.)

You might also like