Explore BrainMass

Explore BrainMass

    Algorithms

    BrainMass Solutions Available for Instant Download

    User Defined Functions

    The function printGrade in this example {see attachment} is written as a void function to compute and output the course grade. The course score is passed as a parameter to the function printGrade. Rewrite the function printGrade as a value-returning function so that it computes and returns the course grade. (The course grade

    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

    Process Action Code

    Within the zip folder you'll find a line in the "Process Action" section of code (Look near the very bottom) the line reads something like: MSGBOX(strDisplayResult) this needs to be changed to: 1) before displaying the results, add a question at the end of the string (strDisplayResult) that reads "Do you wish to q

    Order of Complexity

    The algorithm has the order of complexity shown, and takes the indicated time for a problem of size 50.0. Fill in the amount of time for the algorithm will take for the other sizes shown. Function Size 50 Size 51 Size 60 O(N ^ N) 1 second ______ ________

    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.

    Building Classes

    Write a program to do rational number arithmatic, representing each rational number as a class that has instance variables for the numerator and the denomonator. The program should read and display all rational numbers in the format a/b, or simply a if the denominator is 1.

    Building Classes

    The point-slope equation of a line having slope m and pasing through pint P with coordinates (x1, y1) is y-y1=m(x-x1). a. Write a class for a CartesianPoint, described by its x- and y- coordinates, with all appropriate operations on such objects. b. Write a LineSegment class, described by two CartesianPoint endpoints. In addi

    Stopwatch Program

    Write a stopwatch program that will display time in letters approximately 2 inches high and 1 inch wide. Display minutes, seconds, and tenths of seconds. Have the elapsed time reset to 0.00.00 when the r key is pressed, and then begin time when the t key is pressed. Stop timing, and freeze the display, when the t key is pressed

    Functions

    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

    Functions

    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.

    Hops

    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

    Binary Numerals and Decimal Values

    Question: Change the following binary numerals into decimals: (1) 101.101 (2) 11.011 (3) 1010.1011 (4) 111.1111 Make sure to show all work involved.