Explore BrainMass

Explore BrainMass

    C++

    BrainMass Solutions Available for Instant Download

    3 C++ questions !!! Functions, Arguments, XML !!!

    1. How do functions evaluate arguments? also give an example and explain how data is sent to and retrieved form functions. 2. give some examples of how using a function could save you alot of time and effort? What kind of code would you put into a function? Give an example. 3. Should XML be part of C++? If so what could

    C++ Program Factors and Integrals

    I know that the factorial of an integer n, written n!, is basically the product of consecutive integers 1 through n. Like, if I had 8, the factorial should be calculated 8! = 8 x 7 x 6 x 5 x 4 x 3 x 2 x 1 = 40320. How should I go about putting this program into a C++? I need a prompt to ask for and integer. I have written wh

    COMPUTER LABS PROJECT

    You run four computer labs.Each lab contains computer stations that are numbered as the table below. Lab number Computer Station numbers 1 1-5 2 1-6 3 1-4 4 1-3 Each user has a unique five-digit ID number.Whenever a user logs on, the users's ID,lab number,and t

    Create and prepare a disk file for records containing the structure used in attached file. Store the account records in the file using the same hashing/rehashing technique used for storing them in an array of structures. * i just need help storing accounts to a file instead of a structure using standard c ex: fopen fclose, feel free 2 ask any questions

    Create and prepare a disk file for records containing the structure used in attached file. Store the account records in the file using the same hashing/rehashing technique used for storing them in an array of structures. * i just need help storing accounts to a file instead of a structure using standard c ex: fopen fclose,

    SQL Database Security

    See attached file. Details: Congratulations! You are one of the world's finest security professionals. Throughout the next few weeks, you will be living the life of travel, tight deadlines, and vague projects. Your deliverables will require the highest level of professionalism. All of your deliverables should be presented

    C++: converting function to template

    The following function compares integers of type int and gives as a result the smaller number. int min (int a , int b) { If (a < b) Return a; Else Return b; } Convert this function to a C++ template.

    C++: capitalizing words beginning with letter "a" in a file

    Write a C++ program that reads from the external file input.txt, capitalizes all words that begin with the letter "a," and then writes them to an external file output.txt . Do not forget to copy the blanks. You may wish to use infile.get and outfile.put in your program.

    C++ l. Create a program to determine the smallest number out of 15 numbers entered (numbers entered one at a time from the keyboard). This should be done in prototype: double smaller (double x, double y); Make sure you use a for loop expression inside your function. Be sure to include your program prompts for input and a display of the smallest number when you have found it. 2. You are a mortgage broker who is determining whether you should provide a mortgage to perspective home purchasers. If you are willing to provide a mortgage, you need to decide how much you should charge the borrower. You design a point system that assigns perspective borrowers a score of 1,2,3,4, or 5 based on some mysterious formula. Based on these scores, you come up with the following decisions: Score Decision 5 Provide mortgage at 5% interest rate 4 Provide mortgage at 6% interest rate 3 Provide mortgage at 7% interest rate 2 Do not provide mortgage 1 Do not provide mortgage Create a program that takes the scores as input and provides as output the management decision. In the program, include 2 void functions titled getScore and printdecision, each with an int argument. ? The function getScore should have a Reference parameter that gets the score in getScore and then passes the value back to be printed in main (), and ? print Decision should have a Value parameter. The function getScore will prompt the user for the integer score from 1 to 5, get the input from the user, and display the input received on the screen. The function printDecision will determine the mortgage decision and print the decision. (Be careful and note that this problem requires you to input the score into getScore and not directly into the main function.) 3. Define a class called Date that has 3private members that represent the month, day, and year respectively. They will be represented as integers. Include a constructor and a public void function called print that prints out the date. (For example, if the month is 2, the day is 25, and the year is 1946, print provides as output 2/25/1946.) Include the class in a program that prints out the date 2/25/1946.

    L. Create a program to determine the smallest number out of 15 numbers entered (numbers entered one at a time from the keyboard). This should be done in prototype: double smaller (double x, double y); Make sure you use a for loop expression inside your function. Be sure to include your program prompts for input and a displ

    Functions and Structures

    See the attached file. Need some help with a practice problem: Using the supplied code, make the following modifications: a) Place the account record into an appropriate structure, and store the accounts in an array of structures. b) Use a function to do the account lookup. The function must use the follo

    C program working with arrays, list, macro

    1.Begin this program by creating two arrays of integers, each holding ten elements of data. Create a third array of integers for a result array. Your main program will take the two arrays of integers and pass them to the function subtract(). Inside the function, subtract the first array from the second array and put the differen

    Practice Program Loops, Simple I/O & Simple Calculations

    Need Some Assisstance With A Practice Problem: Be sure you have access to an ANSI C (not C++) compiler. Code compiles for C++ may or may not be compatible with C. Assignment 1. You are to write the basis for what will become, in increments, a small "banking system." This first increment just maintains up to 25 acc

    Creating Classes in C++

    I am very confused with classes in C++. I need help with my problem below: Create a class called car. Have several variables with the necessary variables that that store, gas level, amount of gas, gear car is in, car in motion.. etc Have functions that do: Check the battery level Check the gas level Turn r

    Create three arrays of 20 integers each

    1 Create three arrays of 20 integers each. Fill in two arrays with data, leaving the third blank. From main, pass these three arrays into a function. Inside the function, add the value of each array element and store it in the third. third_array[i] = second_array[i] + first_array[i] Back in main, print out the value of ever

    C++ Mortgage Calculator Reading a Sequential Files

    Here is what I need to do to completion this assignment: Write the program as an object-oriented C++ program that allows the user to select which way they want to calculate a mortgage: by input of the amount of the mortgage, the term of the mortgage, and the interest rate of the mortgage payment or by input of the amount of a m

    Create a program to determine the largest number out of 15 numbers entered

    I need help with these problems Create a program to determine the largest number out of 15 numbers entered (numbers entered one at a time). This should be done in a function using this prototype: double larger (double x, double y); Make sure you use a for loop expression inside your function. Enter 15 num

    C++ - Stacks and Stl

    Implement a Stack class yourself - NOT using the STL. Your stacks should contain elements whose type is specified by the class user as a template parameter. Create a constructor which accepts a single argument giving the maximum size to which the stack can grow. Include methods named pop and push with the standard functionality,

    Answer the questions based on given hash function object type.

    Consider the hash function object type Class hFint256 { Public: unsigned int operator() (int item) const { Return (item/16 % 256); } }; (a) What is the size of the hash table? (b) What are hFint256() (16) and hFint256() (257)? (c) In general, what is the action of the hash function?

    Understanding a bad hash function

    12.16 Consider the given hashing function object for strings. What can you say about strings "aefghk" and "gaefkh"? Is this a good hashing function? Why? class hFstr { public: unsigned int operator () (const string& s) const { int i; unsigned int hashval = 0; for ( i = 0; i < s.length(); i++)

    Object-Oriented C++ Program

    Write the program as an object-oriented C++ program that calculates and displays the mortgage payment amount from user input of the amount of the mortgage, the term of the mortgage, and the interest rate of the mortgage. Allow the user to loop back and enter new data or quit. Insert comments in the program to document the progra

    Data Structures with C++ Using STL

    Binary Trees: 10.26 Use the following tree, in its original from, for each part of this question: ---- See Attached. --- (a). If the value 33 is inserted into the tree, which node would be its parent? (b). If the value 72 is inserted into the tree, which node would be its parent? (c). If the root node 50 is de

    C++: Delete largest value from the list (priority queue)

    Assume that a doubly linked list "header" stores the elements of a priority queue. Implement the function pop(), which deletes the element with the largest value from the list (priority queue). template < typename T > void pop(dnode< T > *header); Here is my best Guess at the problem! { if ( header->next = = header)

    C++ Mortgage Calculater

    Write the program as an object-oriented C++ program that allows the user to select which way they want to calculate a mortgage: by input of the amount of the mortgage, the term of the mortgage, and the interest rate of the mortgage payment or by input of the amount of a mortgage and then select from a menu of mortgage loans:

    C++: Counting the occurrence of an item in a list

    Implement the function "count" which takes a list of items and an item as arguments, and returns the number of times the item occurs in the list. template < typename T > int count (const list < T > & aList, const T& item); Write a C++ program that generates 20 random numbers in the range from 0 to 4. For each number, outp

    C++ OOP Problem

    I need help, I can't seem to get my program right. I have a tendency to do it in Java and not C++. Thanks Write the program as an object-oriented C++ program that allows the user to input the amount of a mortgage and then select from a menu of mortgage loans: - 7 year at 5.35% - 15 year at 5.5% - 30 year at 5.75%. Us

    Programming Questions

    1. Cross (2007) discusses the advantages for a software company to release beta versions instead of final versions of products. What is Cross's reasoning? Do you agree with it? Explain why some companies may avoid beta releases from software companies. 2. Read the "Q&A with Bjarne Stroustrup..." article (2007) and pick one