Explore BrainMass


User Defined Functions

Write a value-returning function, isVowel, that returns the value true if a given character is a vowel and otherwise returns false. This is what I have so far with no luck compiling the program. Any help would be greatly appreciated. #include <iostream> using namespace std; char isVowel(); int main() { char c

Exam Question on grammar from Languages&their implementation

(ii) Using the grammar below:- S -> pAb Production No. 1 A -> cB | a Productions No. 2 and 3 B -> cb Production No. 4 Construct a table with four columns that indicate the step number, state of the input, derivation, and rule applied, and hence show how the string:- pccbb can be parsed top-dow

Classes and Enumerators

Write a program similar to the following: wavelength.cpp computes the wavelength of light for a fiven Color. Input: theColor, a Color value Precondition: theColor is one of RED, ORANGE, YELLOW, GREEN, BLUE, INDIGO, VIOLET Output: the wavelegth of light corresponding to theColor, but that uses the Color class hierarchy.


Write a function calculateTaxes () that calculates and returns the amount of city incom tax and the amount of federal income tax to be withheld from an employee's pay for one pay period. Assume that city income tax withheld is computed by taking 1.15 percent of gross pay on the first $40,000 earned per year and that federal inc


The graph of a person's emotional cycly y=f(x) is a sinc curve having an amplitude of 1 and a period of 28 days. On a given day, the person's emotional index is f(age), where age is his or her age in days. Similarly, the physical and intellectual cycles are sine curves having an amplitude of 1 and periods of 23 and 33 days,

Using Classes

Write a program to display the lyrics of "Happy Birthday to You."

Program for wind speed, temperature, humidity

In a certain region, pesticide can be sprayed from an iairplane only if the temperature is at least 70 degrees, the relative humidity is between 15 and 35%, and the wind speed is at most 10 miles per hour,

To change numerals into normalized form of floating point.

Change the following numerals into normalized form of floating point representation: (a) 1.25487×106 (b) .0125487×106 (c) 12.5487×106 (d) .000125487×106 (e) 125.487×106 (f) 125487×106 (g) 12548.7×106 See attached file for full problem description.


A datagram subnet allows routers to drop packets whenever they need to. The probability of a router discarding a packet is p. Consider the case of a source host connected to a source router, which is connected to the destination router, and then to the destination host. If either of the routers discards a packet, the source host

Stop and Wait Problem

A channel has a bit rate of 64 kbps and a propagation delay of 20 msec. For what range of frame sizes does stop-and-wait give a channel efficiency of at least 50%.

Give an example of a weighted directed graph with at most 5 vertices such that Dijkstra's algorithm will NOT give the correct results for the shortest path lengths from source s to every other vertex. algorithm

Give an example of a weighted directed graph with at most 5 vertices such that Dijkstra's algorithm will NOT give the correct results for the shortest path lengths from source s to every other vertex. Your graph may have negative edge weights but NO negative weight cycles. Indicate what answer Dijkstra's algorithm would give a

Storage on a disk with 2 surfaces

Background: I have a hard magnetic disk w/2 surfaces. The storage area on each surface has an inner radius of 1cm and and outer radius of 5cm. Each track holds the same number of bits even though the size differs from each other. The max storage density of the media is 10,000 bits/cm. The spacing between corresponding points

Bit pair recoding

I have to use use bit pair recoding to multiply 010011 (multiplicated) by 011011 (multiplier).

Smooth functions

PLEASE see attachment for proper display of equations. Let f be a function from N to R+ . Function f is eventually nondecreasing if such that . Function f is smooth if it is eventually nondecreasing and such that . (a) Is the function + such that a smooth function? Verify! (b) Is the function + such th

Binary Floating Point Addition

I need this problem in the same format with 23.5 and 12.5 used as the decimals to be used. I need this to validate my own answer. A full example of Binary Floating Point Addition: Add decimals 10.5 and 3.5 using binary floating-point addition. 10.5 = 1010.1 3.5 = 11.1 Normalize: 10.5 = 1.0101 x 2^3 3.5 = 1.11

Command sequence: Access

Write the command sequence to list P_Descript, P_Indate, P_Price,and V_Code from the product table contents for either V_Code=21344 or V_Code=24Q28

The use of "this"

In writing the code for a method, a programmer might use the keyword "this". When the method is invoked from somewhere in the program, what does this refer to?