Share
Explore BrainMass

C++

Constructor, Object and Accessor Functions in C++

Given below is a c++ class called Sbox used in shipping. We can declare an object of type Sbox to hold the dimensions of a shipping box, a height, width and depth. We define a height (h), width (w) and depth (d) for the three sides of a box. For shipping, it is required the height to be no greater than 45 inches. The width can

Basics of Passing Arguments in C++

Use the program, Passing-by-Value, on Ex5_02 of the text and the program, Passing-by-Reference, on Ex5_07 as a starting point for this assignment. Write a similar program, but change the code to pass two variables to the function call rather than one. Answer the following questions after completing both programs: - W

Dealing with Arrays using For Loop

Using a for loop, print the contents of the array. The output should appear like this: PRINTING CONTENTS OF ARRAY ================================== A B C D E F G H I J K L M N O P Q R S T U V W X Y Z Change the program logic to prompt you for a position within the array that coincides with the letter. See the followi

Trouble Shooting C++ Code

This code prints all elements of the array geo for ( int i = 0; i < geo.length; i++ ) { //the code is missing here } __________________________________________________________________ Where is the error in this code sequence? // a is an ArrayList of strings // a has already been declared and instantiated a.size ( )

Advanced file operation

Write a program that determines how many consonants are in an entered string of 50 characters or less. Output the entered string and the number of consonants in the string. Write a program that will read records from a file (create your data file by using data from sample below) and store them in a binary file. That file will

A Program To Calculate Volume Flow Rate

I need writing a program to calculate the volume flow rate in cubic feet per second of water flowing through a pipe of diameter d in inches and a velocity of v feet per second. The formula for the flow rate is given by Q = area * velocity Where area= πd² /4 in square feet.

C++ char array program

Please help with the following problem. I'm having trouble with a program that is supposed to search message.txt and print out the message. i will upload instructions. We must use functions, and we were not instructed on how to search char arrays for this purpose and I am lost. Your help would be greatly appreciated! Ent

working with 2d arrays and functions

I'm to write a program to do calculations with a 2-d array. The following functions are to be developed to support a new development initiated by a local Multi-Optimal-Dimension Company (MAD COMP). Your program should handle any two dimensional array up to 100 by 100. (Dimension your array 100 by 100) You will need two array

C++ sphere objects in linked list

Write a program that instantiates four sphere objects (assigning a radius to each instance) and adds them to a pointer-based linked list. Include a function to display the statistics of each sphere in the list. // *************************************************** // Header file for the class sphereClass. // **************

Impletation of a Calculator Class in C++

See the attached file. The main function is provided that will create an object of the calculator class and calling methods from this object. The calculator class definition will have to be defined in the "calculator.h" file. The class should have the prototypes for all the methods called in the "main" function and a private

c++ Prime Number

Hi, I need some assistance with this assignment. It is dealing with pointers. I have attached the assignment and the specs. I have learned how to code and to declare pointers and that is about all I know really. Help would be appreciated, thanks! CS 318 Prime Numbers? You are to find all the prime numbers between 90,000

C++ Programming: Constructors and Destructors

Please help identify the following statements as either true or false. If an answer is true, I need to explain why and, where appropriate, provide an example. If the answer is false, I also need to explain why. a. Constructors can have names different from their classes. b. Destructors have default arguments. c. If a progr

Test the stack class by determining if the given strings have matching open and closing () and/or {} and/or []. Write the code to test the queue class by determining if the given strings are char-by-char palindromes.

Please help me in writing the code to test the stack class, and enhancing and testing the queue class. 1. Test the stack class by determining if the following strings have matching open and closing () and/or {} and/or [] : () [](){} [{()}] [[)) {()[()]} The fourth one is the only one that should not have

C++ Stack, Memory Problem

I have created my stack template (not using stl). my methods work for the testing file. Even though the program runs correctly, there is a memory problem somewhere in the program and I can't figure out what I have done wrong. I have allocated new memory for my stack and I'm deleting it as well, but still there is a problem so

Design and implement a class called statistician in C++.

Design and implement a class called statistician in C++. After a statistician is initialized, it can be given a sequence of double numbers. Each number in the sequence is given to the statistician by activating a member function called next_number. For example, we can declare a statistician called s, and then give it the seq

Dynamic Arrays C++

In class, we have been discussing creating objects using the new operator and releasing the memory using the delete operator. Two other similar operators are new[] and delete[]. These operators work the same as the new and delete but with arrays, these are called dynamic arrays: int size = 5; // Dynamic arrays don't h

C++ Template Linked List Program

Please refer to attachment as well. The purpose of this assignment is to practice pointers. To this end, we will study a data structure, Linked Lists. When studying arrays, we found some limitations on arrays: * Arrays have fixed size. Once an array is created, the size cannot be changed. * Assuming an array has to be s

C++ Conditional Statement Based on Time

I have written a program for multidimensional integration that employs several techniques of integration, varying over different ranges, because one technique will take less time to integrate over a certain region of space than another. I would like to know how to write a conditional statement based on the amount of time th

Write Card, Deck and Player Classes in C++

1. Write a class called "Card" with the following traits: it holds two private variables, a suit and a value (ace is high). It has public functions that randomly generate and modify the suit, value and print out the suit/value to the screen. Write a suitable main function to test that it is working properly. 2. Write a cla

Find values of an array using C++ Algorithm

Using the following Array, S = { -55.985, 14.75, .00049, 35.42, -.00049, 883.03, 19.03 } use code (the language of your choice) to write a program to do the following Exercises Problem 2 : Write an algorithm that returns the smallest value in the array. Use a for loop Problem 3: Write an algorithm that outpu