Write a class declaration for a student


Discuss the below:

Q1: 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.

Q2: 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 (" ").

Q3: 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.

Q4: 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.

Q5: 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.

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Write a class declaration for a student
Reference No:- TGS01934819

Now Priced at $20 (50% Discount)

Recommended (97%)

Rated (4.9/5)