Share
Explore BrainMass

Arrays

Please modify this program so the application can handle multiple items.

Please modify this program so the application can handle multiple items. Use an array to store the items. The output should display the information one product at a time, including the item number, the name of the product, the number of units in stock, the price of each unit, and the value of the inventory of that product.

Information Systems and Design

Questions 2-8 only require "yes" or "no." 1. If you have a program with a housekeep() module, a mainloop() module, and a finishup() module, when is the second input record usually read? 2. Is it ever correct to create a loop that cannot terminate? 3. Is it inefficient to place the calculation within the loop when a c

Programming Problems

Most programming languages do not allow you to ask two or more questions in a single comparison by using a logical And Operator Most programming languages allow you to ask two or more questions in a single comparison by using logical OR operator In an AND situation, first ask the question that is more likely to be true.

Write a program implements this sort

Simple sort for (i=0;i<SIZE;++i> for (j=i+1;j<SIZE;++j) if (a[i]>a[j] swap(&a[i],&a[j]); then modify it so that all the elements of the array are printed sfter each pass of the outer loop 7 3 66 3 -5 22 -77 2

Design a hashed file

Design a hashed file of words that could be used as a spell checker. What would you use as a hash function? Would your choice of a hash function depend on the language from which the words are chosen? Why should such a file not be stored as a sequential file? (ALSO EXPLAIN IN DETAIL)

Algorithm

Quest: In English like pseudo-code, or structured English -- just to make sure everyone can read it; write an algorithm to determine if a string is a palindrome. A palindrome is a word or phrase that is spelled the same whether you are reading it forwards or backwards (ex. race car, Madam I'm Adam). Your algorithm should igno

Suppose an array

Suppose an 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? (See attached file for full problem descriptio

Order-statistic tree (Augmenting Data Structures)

Need help to show how to use an order-statistic tree to count the number of inversions in an array of size n in time O(n lg n). Note that we call a pair (i,j) an inversion if i < j, but key[i] > key[j]. Thus, an increasing sequence has no inversions. A decreasing list has the maximum number of inversions, n(n-1)/2. I beli

Sorting an array of integers in linear time

How can I sort an array of integers in O(n) time, where different integers may have different numbers of digits, but the total number of digits over ALL the integers in the array is n? My assumption is that radix sort is somehow involved.

Algorithm to find majority element

Let A be an array of n elements. An element x is said to be a majority element in A if it occurs in A more than n/2 times. Assume that the only comparisons allowed between elements are tests of equality. Give an algorithm that uses no more than 2n comparisons to determine whether the array A contains a majority element and, i

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" here means same elements but in reverse order.) So, suppose you had two int arrays, forward and backward, each with 4 elements. N

Computer Programming

Multi-dimensional arrays could cost a lot of memory. How much memory (how many bytes) does it take to create an integer array of 3 dimensions, with each dimension having 1000 elements (i.e. int myHugeArrays[1000] [1000] [1000])? Explain your answer.

big-inteter calculator program

Write a big-inteter calculator program that allows the user to enter two large integers and the operation to be performed and that calls the appropriate function to carry out the designated operation. **NOTE: I need the solution in C++ Code.

Deadlocks

Specification Implement the Banker's algorithm described in Section 8.5.3 using C/C++. Your program should ... 1) Prompt user to enter the size of matrix n and m. Your program should accept any n x m matrix and m vectors where n and m are positive integer less than 10. 2) Read in Allocation, Max, and Available from all

one-dimensional array and its components

Explain what a one-dimensional array and its components are. Explain why arrays are useful, and how they are created within Visual Basic .NET. Finally, explain how two-dimensional arrays are different than one-dimensional arrays. Thank you

Arrays, vector<T>s, and STL

If x denotes the mean of a sequence of numbers x1, x2,.....xn, the variance is the average of the squares of the deviations of the numbers from the mean, and the standard deviation is the square root of the variance. Write functions to calculate the mean, variance, and standard deviation of the values stored in an array and a d

Arrays, Vector<T>s, and STL: Rinky Dooflingy Company

The Rinky Dooflingy Company manufactures different kinds of doofingies, each identified b a product number. Write a program that reads product number and prices and stores these values in two arrays, number and price;number[0] and price[0] are the product number and unit price for the first item, number[1] and price[1] aare the

Arrays, vector<T>s, and STL

Write a big-inteter calculator program that allows the user to enter two large integers and the operation to be performed and that calls the appropriate function to carry out the designated operation.

Shortest Prefixes are emphasized.

Shortest Prefixes Input: Prefix .in Output: Prefix .out A prefix of a string is a substring string at the beginning of the given string. The prefixes of "carbon" are: "c", "ca", car", "carb", "carbo", and "carbon". Note that the empty string is not considered a prefix in this problem, but every non-empty string is conside

Arrays of Objects

This program has 2 parts. The purpose is to design a payroll program that uses array of objects to store the employees' information. Assume that the minimum wage is $6.0, and standard work load is 40 hours per week. Declare them as named constants with global scope. (See attachment for full question)

What would be the checksum field in a single parity bit scheme?

Suppose that the information content of a packet is the bit pattern 1111000010100101 and an even parity is being used a. What would be the checksum field in a single parity bit scheme? b. What would be the value of the checksum field b for the case of a two-dimensional parity scheme? Your answer should be such that a minim

Modifying the Bellman-Ford Algorithm

Show how to modify the Bellman-Ford algorithm to find and print a negative weight cycle (reachable from the source, s) in a weighted directed graph G if one exists. If there is no negative weight cycle, your algorithm should print out "no negative weight cycle reachable from". If there is a negative weight cycle reachable from