Explore BrainMass

Explore BrainMass


    Passing parameters by value

    An example of when passing parameters by value as opposed to passing them by reference is a better. Give a example of when passing parameters by reference as opposed to passing them by value is a better technique.

    Array-Based Tree, Heaps, Binary Files and Bit Sets

    Assume that v is an array-based tree with 70 members. (a). Is v[45] a leaf node? (b). What is the index of the first leaf node? (c). What is the parent of v[50]? (d). What are the children of v[10]? (e). Does any item have exactly one child? (f). What is the depth of the tree? (g). How many leaf nodes does the t

    Analyzing Age and Weight

    Analyzing Age and Weight In this project you will combine the use of arrays and objects to perform some analysis of the age and weight relationships among a group of people. You have been contracted to write a program into which data about people, including their ages and weights, will be entered. As output the program will p

    **Java** Calculating Payroll

    Company weekly payroll. The input will be a list of hours worked by employees. The output will be the list of amounts owed to each employee plus a total sum of the amounts owed. Use two methods that work with arrays that contain the payroll data. The first method, which will be called getPayrollData(), will be called from mai

    Creating Classes and Inheretence usage

    Create an Employee class for a basic payroll program to compute the net pay salary of hourly based employees. Your program should also find the average net pay for a small company. To define the class, include the appropriate data members, member functions, and access modifiers. For simplicity, use a constant tax rate of 30% to

    Data structures

    Data structures include: 1. a linked list, 2. an ordered, one-dimensional array, and 3. a binary tree. Suppose the list of letters R, A, N, B, C, F, X and G are stored in a list. Chose which of these three data structures you believe would be the best to alphabetize the list and then add and delete letters from the list while ke

    Random Walk Simulation C program

    Need C program for problem: Random Walk Simulation A two-dimensional array (N X M) should be used to represent the number of times the bug reached each tile on the floor. All cells of this array should be initialized to zero. The position of the bug on the floor is represented by the coordinates (i-bug, j-bug). The eight

    Calculating Occurrences: Java Programming

    Need some assistance modifying attached code to meet/produce the following requirements/output: Write a program that reads numbers from the keyboard into an array of type int[]. Assume that there will be 50 or fewer entries in the array. The program should allow any number of numbers to be entered, up to 50 numbers. The outpu

    Write a program to show damage in Earthquake Richter Scale

    The National Earthquake Information Center has asked you to write a program for the following decision table to characterize an earthquake based on its Richter scale number. Richter scale characterization N<5.0 little or no damage 5.0 &#8804; n < 5.5 some damage 5.5 &#8804; n < 6.5

    Computer Science: Flowchart Creation

    The problem below is an example of a problem I'm studying to gain additional knowledge in programming. Please provide explanation along with the Flow chart. ------------------------------------------------------------------ Create a flowchart for this program that would produce a count of the number of residents residing

    Network Disaster recovery plan

    How would you approach a backup and administration plan for the hypothetical situation described below. Include any network administration systems that should be installed for remote access in the event of a network emergency. This is basically a disaster recovery plan. Hypothetical situation: ABC Corporation performs sensit

    Java Problem Implementing Cloneable and Comparable Interfaces

    I'm supposed to write a class Octagon that extends the class Circ and implements Comparable (compare the object's area) and Cloneable interfaces. The octagons sides are all of equal size. The area can be computed according to the formula: area = (2 + 4/sqrt(2)) * side * side. Write a test program that creates an array of sha

    Java application of computation

    Write a Java application using iteration that will print two of the following patterns. Select either #1 & #4 OR #2 & #3 patterns. #1 1 1 2 1 2 3 1 2 3 4 1 2 3 4 5 1 2 3 4 5 6 #2 1 2 3 4 5 6 1 2 3 4 5 1 2 3 4 1 2 3 1 2 1 #3

    Implmenting an Array Insert Functions

    Develop an Algorithm to implement the following function and describe how the required task can be achieved in a step by step process. a.Insert_in_array (element,position) The parameter element is a data item to be added to the array. The parameter position is the array index at which the new element will be inserted. Make

    Entry in a Homogeneous Array

    Suppose that a homogeneous array with 6 rows and 8 columns, is stored in row major order starting at address 20 (base ten). If each entry in the array requires only one memory cell, what is the address of the entry in the third row and fourth column? What if each entry requires two memory cells?

    Using Loops and Pseudocode

    Use a loop and an array to read in 10 integers from the keyboard. Then display them. Then create a flowchart for the above. Please also provide the Pseudocode.

    Strings as a kind of character array or primitive type

    The two most important design issues that are specific to character string types are the following: Should strings be simply a special kind of character array or a primitive type? If you were to design your own programming language, which approach would you take and why? Elaborate on the reasons based on real life programming sc

    A Program that Automatically Generates Numbers

    For this assignment, you will create a program that automatically generates numbers between a range provided by the user and stores them in an array. Your program will then calculate the number of page faults using replacement algorithms and provide the average frame replacements for each. STEPS 1. Write a program using C+

    Program Test Procedures

    Generate a set of test inputs and expected results for the Currency Conversion program. Pseudocode: Input: Arrays of Employee Name and Salary [1..N] Output: MeanSalary, nSalaryAbove, nSalaryBelow Uses: BubbleSort Declaration: Real TotalSalary, MeanSalary Integer nSalaryAbove, nSalaryBelow, Count, i Process Begin

    Pickup 10 Numbers and Store Array Using Function fillAr

    Using c-language programming (not C++): Write a complete program to do the following specification: 1. Pickup 10 numbers and store it in an array using function fillArray. 2. Print the content of array with the message "Array not sorted" using printArray function. 3. Copy array a into array b using copyArray(a,b,10) fun

    Methods, Constructors, Loops and Arrays Demonstrated in Java

    Write an interactive Java program that illustrates the use of methods, constructors, loops and arrays. Your Program will do the following: 1. Ask the user for a String input of letters, i.e., Ohio; John Doe; AnyTown. Notice that strings with spaces are allowed. 2. Offer your user two choices: 1. Determine the

    Java and Reversal Method

    I have to write a Java program method named reversal that returns a new array that is a reversal of the original array. Use [5.0, 4.4, 1.9, 2.9, 3.4, 3.5] to test the method. Also, the reversal method is to send the minimum item of the array. Output Sample: Original Array is: 5.0 4.4 1.9 2.9 3.4 3.5 The Reversal is: 3.

    Writing Syntax: Arrays and Loops

    1. Write the syntax (one line) to declare an int array with 7 values which are all 10. 2. Write the syntax using a loop to print out every odd value from the array above.

    Array Syntax, Initialization, and Headers

    1. Give an example of an array that is initialized during declaration: 2. Write a method header that accepts an array as a parameter: 3. What is the result of the syntax: double a[ ], b;

    Default Initialization Values

    What is the default initialization value for a integer array? What is the default initialization value for a character array? Which array types could hold object references?

    Recursive Algorithm for Given Integer Array A

    Implement two recursive algorithms to solve the following problems: Problem 1: Implement a recursive algorithm to find the maximum element of given integer array A. Count the number of comparisons while finding the maximum element and print input size, maximum element, and number of comparisons. Example: integer array A=[1