Question

Make a matrix whose rows are the architectural styles discussed in this chapter and whose columns are architecture quality attributes, such as performance, reliability, and maintainability. Rate each...

Make a matrix whose rows are the architectural styles discussed in this chapter and whose columns are architecture quality attributes, such as performance, reliability, and maintainability. Rate each style on a oneto-five scale (five being the highest) with respect to each quality attribute.

The architectural styles mentioned in the chapter are The Event-Driven architectural style, also called the ImplicitInvocation architectural style, Shared-Data architectural style, Pipe-and-Filter architectural style, and Layered architectural style

0 0
Add a comment Improve this question Transcribed image text
Answer #1

import java.util.Scanner;

public class Architectural {

   public static void main(String[] args) {
      
       /*
       * We will create below matric of 4 Rows and 3 columns.
       * Rows for different architectural style and Column for quality attribute
       * and assign each matrix cell with a value between 1 to 5
       */
      
       /*                           performance reliability maintainability
       *    ImplicitInvocation           5               3           4
       * Shared-Data                   3               4           5
       * Pipe-and-Filter            2               5           3
       * Layered                       4               4           3
       */
      
       int[][] matrix = new int[4][3];
       Scanner sc = new Scanner(System.in);
       System.out.println("Rate each style on a one-to-five scale (five being the highest) ");
       for(int i=0;i<4;i++) {
           for(int j=0;j<3;j++) {
               if(i == 0) {
                   System.out.print("Give Rating for ImplicitInvocation architectural style for ");
               }else if(i == 1) {
                   System.out.print("Give Rating for Shared-Data architectural style for ");
               }else if(i == 2) {
                   System.out.print("Give Rating for Pipe-and-Filter architectural style for ");
               }else if(i == 3) {
                   System.out.print("Give Rating for Layered architectural style for ");
               }
              
               if(j == 0) {
                   System.out.println("Performance");
               }else if(j == 1) {
                   System.out.println("reliability");
               }else if(j == 2) {
                   System.out.println("maintainability");
               }
              
               matrix[i][j] = sc.nextInt();
           }
       }
      
       System.out.println(" \tPerformance \t reliability \t maintainability");
       for(int i=0;i<4;i++) {
           if(i == 0) {
               System.out.print("ImplicitInvocation\t");
           }else if(i == 1) {
               System.out.print("Shared-Data \t");
           }else if(i == 2) {
               System.out.print("Pipe-and-Filter \t");
           }else if(i == 3) {
               System.out.print("Layered \t");
           }
           for(int j=0;j<3;j++) {
               System.out.print(matrix[i][j] + "\t\t");
           }
           System.out.println();
       }
   }
}

//output:

Rate each style on a one-to-five scale (five being the highest)
Give Rating for ImplicitInvocation architectural style for Performance
1
Give Rating for ImplicitInvocation architectural style for reliability
2
Give Rating for ImplicitInvocation architectural style for maintainability
3
Give Rating for Shared-Data architectural style for Performance
1
Give Rating for Shared-Data architectural style for reliability
1
Give Rating for Shared-Data architectural style for maintainability
2
Give Rating for Pipe-and-Filter architectural style for Performance
1
Give Rating for Pipe-and-Filter architectural style for reliability
5
Give Rating for Pipe-and-Filter architectural style for maintainability
4
Give Rating for Layered architectural style for Performance
3
Give Rating for Layered architectural style for reliability
1
Give Rating for Layered architectural style for maintainability
2
   Performance    reliability    maintainability
ImplicitInvocation   1       2       3      
Shared-Data    1       1       2      
Pipe-and-Filter    1       5       4      
Layered    3       1       2      

DArchitectural.java else if(i 3) f 56 57 58 59 50 61 System.out.print(Layered for(int j-0;j3;j++) f System.out.print (matrix

Add a comment
Know the answer?
Add Answer to:
Make a matrix whose rows are the architectural styles discussed in this chapter and whose columns are architecture quality attributes, such as performance, reliability, and maintainability. Rate each...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT