Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

(LO1): 30 Points Name the basic activities (phases) that are involved in a softw

ID: 654372 • Letter: #

Question

(LO1): 30 Points

Name the basic activities (phases) that are involved in a software development process.

Write declarations statements for the following:
1. to store student's name
2. To store student's grade

3. To store a logical value
4. To store numeric IDs of a class of 25 students
5. To store the scores of 25 students with 4 tests each

(LO2): 30 Points

Write a method named sumOfNegativeValues that accepts a one dimensional array of type int, finds and returns the sum of all negative values in the array.

Write a complete method that accepts four integer arguments (x1, y1) and (x2, y2) representing the coordinates of two points. Compute and return the distance between the two points using the following formula: Distance =. Make sure you use valid java syntax statements.

Assume that the method rotateLeft (see below) is already written in the same class. Write a complete method named rotateLeftNTimes that accepts a one dimensional array of type int and another argument n of type int indicating the number of times we want to rotate the array left. You are supposed to invoke the rotateLeft method from rotateLeftNTimes method. No need to implement the rotateLeft method.

public void rotateLeft (int [] list) {

      // Implemented

}

            public void rotateLeftNTimes (int [] list, int n) {

            //Complete this method

            }

(LO3): 30 Points

Write a method named computeGrades that accepts one dimensional array of scores of type int and prints grades as follows:
Excellent if score > average + 10
Unsatisfactory if score < average - 10
Satisfactory otherwise
Assume that the class has a method named average that accepts one dimensional array of type int and returns its average value of type double.

You were asked to design a UML diagram for MyCourse that deals with student names, scores, and grades. Assume each student has several scores. Write the different components of the UML diagram. Possible services, reading data, computing grades, displaying class information, and so on. Do not implement the class, just the UML diagram. Include any set of variables and methods.

(LO4): 20 Points

What output is produced by the following code fragment?
int num = 0, max = 13;
while (num < max){

if ( num %5 == 0)

System.out.print (num + " );
num++;

}

What output is produced by the following code fragment?
for (int i = 0; i < 7; i += 2)

System.out.print (i + " ");

  

What output is produced by the following code fragment?

int total = 10;
int max = 30;
total = (total > max) ? total + 1: total * 2;
System.out.println (total);

What output is produced by the following code fragment?

int num = 10;
int max = 30;
while (num < max) {

if (num == max/2)

      }

                      (LO5): 20 Points

Write the class described by the UML diagram below. The default size, format, and color is 1024, FAT128, and Black respectively. The canFit method determines if the amount does or does not fit within the size of the FlashDrive.

FlashDrive
-size:int
-format: String

-color: String

+FlashDrive()
+FlashDrive (size:int, format: String, color: String)
+canFit (amount: int):boolean

+toString():String

The toString returns drive format, size, and color with appropriate labels to be printed on three separate lines.

       VI             (LO6): 20 Points

Show the exact output of the following statement.
Note: Use underscore to indicate a space in the output

System.out.printf ("%10d%8s%8.2f ",54321,"CS1301",12.4932);

System.out.printf (" %-10d%-8S%8s",1,"One",VSU);

1234567890|12345678|12345678 //scale
-------------------------------------------------------

-------------------------------------------------------

-------------------------------------------------------

-------------------------------------------------------

Identify and fix the errors in the following code (You may want to write the entire code without errors. Underline your changes):

public void main (string args) {

int j = i + 1;

int k = 5.5;

System.out.println ("j is " + j + " and

k is " + k);

}

Explanation / Answer

LO1

The basic phases used in the software development process are:

Requirements analysis

Design

Coding

Testing

Deployment

Maintenance

Requirement Analysis:

During this phase, the need for developing the given project is analysed. This means that the stakeholders discuss the cost vs benefit analysis of going ahead with the project. In addition, information is collected regarding the users of the system, the required inputs and outputs. After gathering all the relevant information, analysis of how the requirements can be incorporated in the system. This is followed by the creation of the Requirement specification document.

Design:

In the design phase of the software development life cycle, the system design is created by taking inputs from the Requirement specification document. It defines how the requirements studies in the first phase would actually be provided by the system. This includes detailed information about the inputs required by the system as well as the output expected from it. In this phase, the conceptual design of the ER schema, forms, reports, etc. are decided. In addition, the hardware and software specification of the new system is also finalised. In this phase, the overall system architecture is defined.

Coding:

This phase takes the largest share of time to complete. In this phase, the system design is implemented to create the actual project. The coding design is used to program the system and all the conceptual designs created in the design phase are programmed and the software is developed using the appropriate programming language.

Testing:

Once the system has been developed, it needs to be tested in order to ensure that the final product meets the requirements specified in the requirements phase. This phase involves conducting of program tests as well as the system tests. The program test is conducted on test data whereas the system test is conducted on actual data.

Implementation:

Once the testing is completed successfully, the system is finally implemented. This involves various steps such as hardware and software installation, training the users of the system, and documentation of the product. This phase also includes conversion of the existing data into the new format.

Maintenance:

While working on the system, if any problems are encountered, they need to be solved. In addition, any errors discovered in the functioning of the system during the execution also need to be rectified. All this forms a part of maintenance.

2) Declaration statements:

to store student's name

String stud_name;

To store student's grade

char stud_grade;

To store a logical value

boolean is_registered=true;

To store numeric IDs of a class of 25 students

int[] Class_IDs = new int[25];

To store the scores of 25 students with 4 tests each

int[][] result=new int[25],[4];