Explore BrainMass

Explore BrainMass

    C++

    BrainMass Solutions Available for Instant Download

    C++ Queuing Systems for Objects

    C++. See attached file for full problem description. Question 11 What is the time-complexity of the overloaded assignment operator? O(1) O(n) O(log n) O(n^2) Question 12 template<class Type> void linkedStackType<Type>::linkedOperation1() { nodeType<Type> *temp;

    C++ Output Functions

    C++. See attached file for full problem description. Question 1 What would the operation isEmptyStack return if applied to the stack above? 0 5 true false Question 2 template<class Type> void stackType<Type>::operation1(const Type& newItem) { if(!isFullStack(

    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.

    Reverse a stack

    Write a function template, reverseStack, that takes a parameter a stack object and a queue object whose elements are of the same type. The function reverseStack uses the queue to reverse the elements of the stack.

    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

    Create a class MusicalComposition and its UML diagram

    Create a class named MusicalComposition that contains fields for title, composer, and year written. Include a constructor that requires all three values and a appropriate display function. The child class NationalAnthem contains an additional field that holds the name of the anthem's nation. The child class constructor requir

    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.

    String in C++

    Write a function that accepts a pointer to a string as an argument and capitalizes the first character of each sentence in the string. For instance, if the string argument is "hello. my name is Joe. what is your name?", the function should manipulate the string so it contains "Hello. Myname is Joe. What is your name?" Ask th

    coding a word counter

    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. 10. Write the definition of the function template clear that takes as a parameter a stack object of the type stack (STL class) and removes all the elements from the stack.

    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

    Coding in Visual C++

    All information is provided in a text file and the .cpp for Visual C++. Need some help getting me going in the right direction. Also, it is rather long.. 300 lines.. Simple concept but tough coding. A SMALL QUIZ WITH 20 QUESTION MUTIPLE CHOICE. MY THEME IS A DMV SAMPLE QUIZ. PROGRAM IS TO STORE THE ANSWERS IN AN ARRAY. A

    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

    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,

    College Course Class C++ Programming

    A CollegeCourse class includes fields representing department, course number, credit hours, and tuition. Its child, LabCourse, includes one more field that holds a lab fee charged in addition to the tuition. Create appropriate functions for these classes, and write a main() function that instantiates and uses objects of each c

    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++ Statement Locations

    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

    Linked Lists in C++

    13. Suppose that intList1 and intList2 are list containers and intList1 = {3, 58, 78, 85, 6, 15, 93, 98, 25} intList2 = {5, 24, 16, 11, 60, 9} Show intList1 after the following statement executes: intList1.splice(intList1.begin(), intList2);

    linked list and output of the c++ statements

    What is the output of the following C++ statements? See attached file for full problem description. 2. What is the output of the following C++ statements? a. cout<<list->info; b. cout<<A->info; c. cout<<B->link->info; d. cout<<list->link->link->info; 5. Write C++ statements to do the following: a. Make A poin