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.
Assume that v is an array-based tree with 70 members. (a). Is v a leaf node? (b). What is the index of the first leaf node? (c). What is the parent of v? (d). What are the children of v? (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 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
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
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 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
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
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
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 ≤ n < 5.5 some damage 5.5 ≤ n < 6.5
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
If you choose to answer problem 1 in Section B, you must complete both parts a and b. a) Write a C program that has a declaration in main() to store the following numbers into an array named channels: 2, 4, 5, 7, 9, 11, 13. There should be a function call to display() that accepts the channels as an argument named channels a
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
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
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
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
What complications are imposed if one tries to implement a dynamic list using a traditional 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?
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.
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
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+
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
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
Examine the BinSearch.java program. Write a Word or text document detailing how the binary search code works. Text document ok. See the attached file.
What would you suppose the most common type of error is when using arrays? Why? How can you guard against it?
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
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.
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.
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;
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?
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