Share
Explore BrainMass

C++

Operating System Process Simulator in C++

The program must be done in C++. The program is not in Visual C++, in other words it must show everything in the command prompt window. Please use cout and cin and not printf and scanf nor other C standards See attached file for full problem description.

Inheritance - SalariedEmployee - C++

Write a program that uses the class SalariedEmployee shown below. Your program is to define a class called Administrator, which is to be derived from the class SalariedEmployee. You are allowed to change private in the base class to protected. You are to supply the following additional data and function members: A member vari

Strings and Vectors C++

Please enhance this program. Write the definition of the readAndCount function. The function should read the input line, character by character, counting the number of words (a sequence of letters) and the number of occurrences of each letter. The array to hold the number of occurrences of each letter is the parameter let

C++ Names.cpp

Write a program that reads a person's name in the following format: first name, then middle name or initial, and then last name. The program then outputs the name in the following format: Last_Name, First_Name Middle_Initial. For example, the input Mary Average User should produce the output: User, Mary A. The inp

queue and stack in C++

I need two separately programs from the same code. 1.) Modified the code so it has a Pop() function that makes the function of a Queue. Example: Input: Enter Id: 1 Enter Name: Ana Enter Id: 2 Enter Name: Carlos Ouput: (After a pop): Id: 1 name: Ana 2.) Modified the code so it has

Friends and Overloading Operators C++

Complete and test this exercise. Implement the default constructor and the constructor with one int parameter. Overload the + and - operators to add and subtract percents. Also, overload the * operator to allow multiplication of a percent by an integer. Write a program to test all the member functions and overloaded operator

Infinite Loop C++ Programs

Can you find a bug in this program and then fix it so that it won't have an infinite loop? #include <iostream> #include <fstream> using namespace std; void CalculateAvgScore(ifstream &fIn,ofstream &fOut); int main(int argc, char *argv[]) { ifstream fin; ofstream fout; char inFileName[20],outFileName[20];

I/O Streams

Write a program that reads text from one file and writes an edited version of the same text to another file. The edited version is identical to the unedited version except that every string of two or more consecutive blanks is replaced by a single space. Thus the text is edited to remove any extra blank characters. Your progr

C++ Programming: Inputting Courses and Students

Please assist with providing a program that will ask the user how many courses he wants to input and how many students he wants to add to each course and the name of each student. Example of a run: INPUT: How many courses? 2 Enter the name of the #1 course: Structure Programming Enter the how many students: 3 Enter t

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

convert a octal value for UNIX file permissions to a text value

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

Problem with Data Structures C++

All doctor offices have not become 100% computerized yet. You can still see good % of offices use manual patient record files indexed by the first letter of patients' last names. Is this manual search close to searching in a sorted array or in a sorted linked list? Write your thoughts.

C++ Functions and Responses

C++. See attached file for full problem description. Question 21 Refer to the figure above. Which of the following members in the UML diagram adds an element to the front of the queue? front addQueue back None of the above Question 22 An effective way to implement a priority

C++

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

C++ explained in this solution

C++. See attached file for full problem description. Thank you so much! Question 31 A queue is modeled on a ____ structure. LIFO FIFO stack list Question 32 The function deleteQueue does which of the following? uses one queue to delete another removes the back

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

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