Computer Science Homework Solutions
Problem
#60672

Demo of Java array and code that assigns values based on the membership of the array

Given:
an  int variable  k ,
an  int array  currentMembers that has been declared and initialized,
an  int variable  memberID that has been initialized, and
an  boolean variable  isAMember ,
write code that assigns  true to  isAMember if the value of  memberID can be found in  currentMembers , and that assigns  false to  isAMember otherwise. Use only  k ,  currentMembers ,  memberID , and  isAMember .


Solution Summary

It's a practical solution in Java that helps understand the nature of arrays and how to use object oriented methods to initialize an array and check membership of the array.

Solution
What is this?
By OTA - Overall OTA Rating
Purchase Cost Now
$2.19 CAD (was ~$3.99)
Included in Download
  • Plain text response
$2.19 Instant Download
Add to Cart
Why you can trust BrainMass.com
  • Your Information is Secure
  • Best Online Academic Help Service
  • Students find real academic Success
Related Solutions
  • Demo of Java array and code that assigns values based on the membership of the array - Given: an int variable k , an int array currentMembers that has been declared and initialized, an int variable memberID that has been initialized, and an boolean variable isAMember ...
  • Java - What does the following program do? - SomeClass.java - // Exercise 15.13 Solution: SomeClass.java public class SomeClass { public String someMethod( int array2[], int x, String output ) { if ( x < array2.length ) ...
  • Write a java syntax - 1. Write Java syntax which declares a 1D integer array myary that holds 5 values. 2. Instantiate and initialize the array from Q#1 with values: 5, 3, 5, 7,
  • Arrays in java - Write the definition of a method, isReverse , whose two parameters are arrays of integers of equal size. The method returns true if and only if one array is the reverse of the other. ("Reverse" her ...
  • Trying to figure out code for a Java program. - I need an array that holds six objects, which I will place data in. I need a method to sort the array in ascending order and I need to call the method and display the results.
Browse