Purchase Solution

Java Array Demonstration

Not what you're looking for?

Ask Custom Question

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 .

Purchase this Solution

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 Preview

import java.io.*;

public class ArrayDemo{
//Declare
int[] currentMembers; // declare an array of integers
int memberID;
boolean isAMember;
int k;

ArrayDemo(){
//Initialize
memberID = 5;
boolean ...

Purchase this Solution


Free BrainMass Quizzes
C# variables and classes

This quiz contains questions about C# classes and variables.

Inserting and deleting in a linked list

This quiz tests your understanding of how to insert and delete elements in a linked list. Understanding of the use of linked lists, and the related performance aspects, is an important fundamental skill of computer science data structures.

Word 2010: Table of Contents

Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.

Basic Networking Questions

This quiz consists of some basic networking questions.

Word 2010: Tables

Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.