Share
Explore BrainMass

C++

C++ Programming

I need a program that contains a function that receives an array of integers of 3 elements. The function must implement a "shift" to the right. For example if the numbers 1 2 3 are entered, after passing to the function the values must be 2 3 1. The program must display the two values.

Simple linked list C++

When I typical write a linked list class to store int values I would setup the class something like this.... struct Node { int _item; Node *_next; }; Node *_head; However, I know have to write a program that will use IntNode.h to create a linked list implementation. The way the designer setup this .h file is

Octal Value for UNIX file permissions

Can anyone explain to me how to convert a octal value for UNIX file permissions to a text value to display on screen. For example I need to write code in C++ that would take in octal value 100666 and display rw-rw-rw I have found this information but still can not figure out the conversion. Octal digit Text equivalent Bin

Data Structures C++

Explain the following code line by line, and submit your answer: shortestPath() & printShortestDistance() in weightedGraph.h

Data Structures C++

Why does closed hashing typically check more elements compared to open hashing?

C++

C++. See attached file for full problem description.

C++

C++. See attached file for full problem description.

C++

C++. See attached file for full problem description.

C++

C++. See attached file for full problem description.

Queues C++

Add the operation queueCount to the class queueType (the array implementation of queues), which returns the number of elements in the queue. Write the definition of the function template to implement this operation.

Queues C++

Write the definition of the function template moveNthFront that takes as a parameter a queue and a positive integer, n. The function moves the nth element of the queue to the front. The order of the remaining elements remains unchanged. For example, suppose queue = {5, 11, 34, 67, 43, 55} and n = 3. After a call to the fun

Queues C++

Consider the following statements: stackType<int> stack; queueType<int> queue; int x; Suppose the input is: 15 28 14 22 64 35 19 32 7 11 13 30 -999 Show what is output by the following segment of code. stack.initializeStack(); queue.initializeQueue(); stack.push(0); queue.addQueue(0); cin>>x; while(x != -99

C++ program using parallel vectors

Write a program to keep track of a hardware store's inventory. The sore sell various items. For each item in the store the following information is kept: item ID, item name, number of pieces ordered, number of pieces currently in the store, number of pieces sold, manufacturer's price for the item, and the stores selling price.

Implementing Queues in C++

2. Suppose that queue is a queueType object and the size of the array implementing queue is 100. Also suppose that the value of queueFront is 99 and the value of queueRear is 25. a. What are the values of queueFront and queueRear after adding an element to queue? b. What are the values of queueFront and queueRear after rem

Stacks C++

Write the definition of the function template second that takes as a parameter a stack object and returns the second element of the stack. The original stack remains unchanged.

Project String Manipulation

Trying to put my last program together. I have put all my files in Visual CPP file and 2 text files. I have been working this issue for a while. Would like just a little assistance in getting this program running.

Counter for words

Seeking help with coding a word counter. I have 2 codes that I'm working with and I not sure where I went wrong with them. Text file with code provided..Visual C++

Stack C++

Stack C++. See attached file for full problem description.

Stack C++

Stack C++. See attached file for full problem description.

Stacks C++

1. Let us say you are given a basic stack data structure with just "core" operations push and pop. Is it possible to implement top using these two operations? Explain. (or) Are the following code segments equivalent? Why? x = s.top(); x = s.pop(); s.push(x);

C parameter passing methods.

I do not have any experience in C or C++ so I am struggling with understanding what the parameter passing of these are. Consider the following program written in C syntax: void main() { int value = 2, list[5] = {1, 3, 5, 7, 9); swap(value, list[0]); swap(list[0], list[1); swap(value, list[value]); } void swap(in

C++ Programming

Create two classes. The first holds sales transactions. Its private data members include date, amount of sale, and salesperson's ID number. The second class holds salespeople, and its private data members include each salesperson's ID number and name. Each class includes a constructor with which you can set the field values.

C++ List

Write C++ code that does the following: &#61607; Create a list with the elements: 43,67,11,78 and 52 &#61607; Add item 60 to the list &#61607; Sort the list in descending order &#61607; Delete item 52 &#61607; Use Binary Search to find item 70 in the list Sample output shown: Printing the 5 elements in the list...

Two Dimensional Array

Write a C++ program that uses a two dimensional array, testgrades[][], for 10 students and scores from 5 tests. &#61607; Write a function initializeArray(), which will initialize the array to the following values o 1,75,65,85,90,60 o 2,70,85,90,60,70 o 3,65,68,73,83,95 o 4,86,92,73,89,64 o 5,78,89,72,63,97 o 6,65,93,83,

Recursion C++

Consider the following function: int Func(int x) { if(x == 0) return 2; else if(x == 1) return 3; else return (Func(x - 1) + Func(x - 2)); } What is the output of the following statements? a. cout<<Func(0)<<endl; b. cout<<Func(1)<<endl; c. cout<<Func(2)<<endl; d. cout<<Func(5)<<endl;

Recursion C++

Consider the following recursive function. int mystery(int number) { if(number == 0) return number; else return(number + mystery(number - 1)); } a. Identify the base case. b. Identify the general case. c. What valid values can be passed as parameters to the function mystery? d. If mystery(0) is a valid call,

Recursion C++

2. What is a base case? 3. What is a recursive case?

C++

Consider the following statements: int *p; int num; Assume that memory location 1200 is allocated for p and memory location 1800 is allocated for num. The statement p=&num; stores the address of num that is, ____ into p. A 1800 B 24 C 1200 D num