+1(978)310-4246 credencewriters@gmail.com
  

Description

1.5 Marks

Learning Outcome(s):

LO4: Develop a program based on specification using programming language elements including syntax, data types, conditional statement, control structures, procedures and arrays.

Question One

Write a program that asking the user to enter 5 numbers. Then, at the end, your program should display the count the number of positive, negative and zero entered. You should use For-loop statement.

Note:

Paste your

editable

code for the question answer and Include the screenshot of your code’s output as a part of your answer. Otherwise, you will be marked zero for this question.

Example of output is shown below.

1 Marks

Learning Outcome(s):

LO4: Demonstrate Integrated Development Environment (IDE) for the editing, building, debugging, and testing of programs.

Question Tow

Each of the following Java code contains

one

or

more

syntax/logical error(s). Find the error(s) and modify the code so that it will work properly. The first one is given as an example to you.

#

Original Code

Correct Code

1.

for(j =0; j<=10,j++); System.out.print(j + " ") for(int j =0; j<=10;j++) System.out.print(j + " "); 2. double[] numbers = new int[5] 3. ArrayList names = new ArrayList(); names.add("Ahmad"); System.out.println(names.length); 4. int[4] myarr = {2, 9, 4, 5}; for (int i = 0; i < myarr.length(); i++) System.out.println(myarr[i]); 5. String[] names = {‘Ali’, ‘Mohand’}; for (int i : names) System.out.print(i + " "); 1 Marks Learning Outcome(s): LO3: Demonstrate Integrated Development Environment (IDE) for the editing, building, debugging, and testing of programs. LO4: Develop a program based on specification using programming language elements including syntax, data types, conditional statement, control structures, procedures and arrays. Question Three Write a complete java program by using for loop to print even number from 2 to 20. The output should be as following: Note: Paste your editable code for the question answer and Include the screenshot of your code’s output as a part of your answer. Otherwise, you will be marked zero for this question. Example of output is shown below. 1.5 Marks Learning Outcome(s): LO3: Demonstrate Integrated Development Environment (IDE) for the editing, building, debugging, and testing of programs. LO4: Develop a program based on specification using programming language elements including syntax, data types, conditional statement, control structures, procedures and arrays. Question Four Write a complete java program to calculate the total values of all the elements in an array. Example: For the following input values for the array {2,6,8,3,2,2,1}, the output should be: Note: Paste your editable code for the question answer and Include the screenshot of your code’s output as a part of your answer. College of Computing and Informatics Business Computer Languages IT401 Assignment #2 Deadline: Wednesday 14/04/2021 @ 23:59 [Total Marks for this Assignment are 5] Student Details: Name:### ID:### CRN: 22248 Instructions: • • • • • • • • • • You must submit two separate copies (one Word file and one PDF file)using the Assignment Template on Blackboard via the allocated folder. These files must not be in compressed format. It is your responsibility to check and make sure that you have uploaded both the correct files. Zero mark will be given if you try to bypass the SafeAssign (e.g. misspell words, remove spaces between words, hide characters, use different character sets or languages other than English or any kind of manipulation). Email submission will not be accepted. You are advised to make your work clear and well-presented. This includes filling your information on the cover page. You must use this template, failing which will result in zero mark. You MUST show all your work, and text must not be converted into an image, unless specified otherwise by the question. Late submission will result in ZERO mark. The work should be your own, copying from students or other resources will result in ZERO mark. Use Times New Roman font for all your answers. Question One Pg. 01 Learning Outcome(s): LO4: Develop a program based on specification using programming language elements including syntax, data types, conditional statement, control structures, procedures and arrays. Question One 1.5 Marks Write a program that asking the user to enter 5 numbers. Then, at the end, your program should display the count the number of positive, negative and zero entered. You should use For-loop statement. Note: 1. Paste your editable code for the question answer and Include the screenshot of your code’s output as a part of your answer. Otherwise, you will be marked zero for this question. 2. Example of output is shown below. Question Three Pg. 02 Learning Outcome(s): LO4: Demonstrate Integrated Development Environment (IDE) for the editing, building, debugging, and testing of programs. Question Tow 1 Marks Each of the following Java code contains one or more syntax/logical error(s). Find the error(s) and modify the code so that it will work properly. The first one is given as an example to you. # 1. 2. Original Code for(j =0; j Purchase answer to see full attachment

  
error: Content is protected !!