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

COURSE DESCRIPTION: design and create advanced web-based applications. Content w

ID: 3838702 • Letter: C

Question


COURSE DESCRIPTION:  

design and create advanced web-based applications. Content will consist of hands-on experience with advanced Java and scripting language applications. Topics will include the development of applications to provide web-based interfaces for relational databases.

questions:

5. Write the Java code for creating an integer array named jack with 10 elements.







7. int[ ] scores = new int[5];

The index value of the fifth member of the scores array will be _____________.





8. __________ is the php statement that facilitates html display in a browser.



9. What output is produced by the following code?

int z = 500;
System.out.println ("z" + 300 + 50);





10. zipCode is a JTextField object. Under what circumstances would the following expression evaluate to true?


(!Pattern.matches("\s*", zipCode.getText()))


Explanation / Answer

5th Ans :

//This is the method where we can create an array if we know exactly how many elements are needed for the program

import java.lang.Math; // headers MUST be above the first class

// one class needs to have a main() method
public class Array_creation
{
// arguments are passed using the text field below this editor
public static void main(String[] args)
{
//create a java int array
   int jack[] = new int[10];
  
   //Declare a variable to access the array
int i;
  
// Assign elements to the array
jack[0] = 10;
jack[1] = 20;
jack[2] = 30;
jack[3] = 40;
jack[4] = 50;
jack[5] = 60;
jack[6] = 70;
jack[7] = 80;
jack[8] = 90;
jack[9] = 100;

// (3) print our Jack integer array
for (i=0; i<jack.length; i++)
{
System.out.println(jack[i]);
}
}
}

7th Ans:The index value of the fifth element in the array is 4.

Explanation:
The index of an array starts from 0 and ranges till length-1.
Example for suppose if an array is declared as int array[10];
it has 10 elements with index ranging from 0,1,2,......9

8th Ans:echo and print. echo is used extensively

Explanation:

The echo and print are the php statements that facilitates html display in a browser.
echo and print are more or less the same. They are both used to output data to the screen.
The differences are small: echo has no return value
while print has a return value of 1 so it can be used in expressions.
echo can take multiple parameters (although such usage is rare) while print can take one argument.
echo is faster than print.
example:
<?php
echo "Hello! welcome to chegg world<br>";
?>

<?php
print "Hello! welcome to chegg world<br>";
?>


9th Ans: z30050
Explanation:
Here the string Z is concatenated with integers 300 and 50 and then printed


10th Ans: Not sure about the answer but as per my knowledge it would give the pincode which doesnot support
alphanumeric character including underscore at the very first place, white space character in second place repeating more than 0 or more times
Explanation:
Used to indicate that the next character should NOT be interpreted literally.
For example, the character 'w' by itself will be interpreted as 'match the character w',
but using 'w' signifies 'match an alpha-numeric character including underscore'.
Used to indicate that a metacharacter is to be interpreted literally.
For example, the '.' metacharacter means 'match any single character but a new line',
but if we would rather match a dot character instead, we would use '.'.

s   Matches a single white space character. This includes space, tab, form feed and line feed.

* Matches the preceding character 0 or more times.