Assignment Solution CS504
Solution
Question No. 1: (6 Marks)
Identify the suitable design pattern for each real world/example application.
| Real-world/Example Application | Design Pattern |
| Print Spooler | Singleton Pattern |
| Oven’s Preprogrammed Switches Interface | Façade Pattern |
| Weather Alert App | Observer Pattern |
Question No. 2: (4 Marks)
Identify the most appropriate architectural style for each example application system.
| Application Systems | Architectural Styles |
| Operating System | Layered Architecture |
| Compiler | Three-tier Architecture |
Question No. 3: (10 Marks)
Following table contains some code statements in C++, which are not in proper coding convention. Make the code statements self-documented by following the naming convention and best programming practices given in the course contents. Write your answer in the 2nd column of the table in the respective row.
| Code Statements without proper coding conventions | Code Statements with proper coding conventions |
| float sum = .25; //declaring a float variable | Float sum=0.25; |
| string bookname; //declaring a string variable for book name | String bookName; |
| if (isEven) printEven(); //conditional statement | If(isEven) {printEven();} |
| floatValue = intValue | floatValue = (float) intValue; |
double speed = 0; | double speed = 0.0; |
Do Not Copy
Copyright (c) 2021 vulmsexpert All Right Reseved
0 Comments