Explore BrainMass
Share

Explore BrainMass

    JAVA code snippets

    This content was COPIED from BrainMass.com - View the original, and get the already-completed solution here!

    Write a method definition to count and then return the number of elements in a passed integer array, that have a value greater than 0.

    Write a nested loop structure that prints out the following number series: 111 112 121 122 211 212 221 222. The innermost loop may have only one print statement and no literal string output except a space (" ").

    Write a class declaration for a student that has String first, last, and middle names as data fields. Declare only the data members and a no-arg constructor.

    Write a method definition that prints out the value of 2 to the powers of 1 - 31 in a 10 character width, right-justified column. You may not use any literals or Math methods.

    Write a program (with main) that will ask the user for 10 data elements which will be assigned sequentially to an array, print the array and then copy that data into a second array in reverse order and print it.

    © BrainMass Inc. brainmass.com October 9, 2019, 11:48 pm ad1c9bdddf
    https://brainmass.com/computer-science/java/java-code-snippets-268507

    Solution Summary

    This solution provides an explanation how to perform the given functions in Java. Including a writing a nested loop structure, several method definitions, and a program.

    $2.19