Share
Explore BrainMass

C++

C++ Programming

Write a program that reads a student's name together with his or her test scores. The program should then compute the average test scores for each student and assign the appropriate grade. The grade scale is as follows: 90-100, A; 80-89, B; 70-79, C; 60-69, D; 0-59, F. Your program must use the following functions

C++ Programming (User Defined Functions)

1. It is not necessary to name your formal and corresponding actual parameters the same. What are the benefits of doing so? 2. Write a value-returning function that returns the sum of two numbers. Then write the code to produce the same outcome using a void function and passing variables by reference. In what situations

Coding rules explanation and use of Sequential file access

1. Discuss why naming conventions are important and why programmers should consistently follow them. Include in this discussion problems that could arise in naming variables if one convention is not followed. 2. Why is it important to consistently follow coding rules and techniques? What are the pitfalls of not doing so?

Examples of use of cout in C++

15. What is the output of the following statements? Suppose a and b are int variables, c is a double variable, and a = 13, b = 5, and c = 17.5. a. cout <<a + b - c << endl; = 0.5 b. cout << 15 / 2 + c << endl; = 25 c. cout << a / static_cast<double>(b) + 2 * c << endl; = 37 d. cout << 14 % 3 + 6.3 + b / a << endl; =

Basic Elements of C++

1. Discuss the importance of defining the problem and what can happen if the problem is not defined properly. Note that in class problems will be defined, however in the business world a great deal of time would need to be devoted to properly defining the problem (in terms of input and output) so everyone has a clear under

Introduction to C++

Write a constant declaration to associate MPH with the integer 55 in proper syntax.

C++ output payroll report

Repeatedly prompt the user to determine whether or not there is data pertaining to an employee to be input. (Program should work for 0 or more employees.) If the user responds in the affirmative, the program prompts for each of the input data items for a single employee; the user responds in the negative when there is no more

C++ programming-Function

Max is a function that accepts two int parameters and returns the value of the larger one. Four int variables, p1, p2, p3, and p4 have already been declared and initialized. Write an expression (not a statement!) whose value is the largest of p1, p2, p3, and p4 by calling max. Call max three times and you will need to pass the

C++ programming-Function

Write a function definition called backward, with three parameters, the first and second parameters are arrays of integers of equal size and the third is an integer indicating the size of each array. The function will return true when and only if one of the array is reverse order of the other, that is having the same elements bu

C++ programming-Function

Write a function definition called addarray that takes two parameters- one an array as an int and the other an int that contains the number of elements of the array. The function will return the sum of the number of elements of the array as int.

Writing a simple C++ PROGRAM (Practice)

Consider a simple textual table describing the catalogues of retail stores, with a line for each product offered by a store, like Argos Barbie 6.99 Argos PS2 159.99 Hamleys Barbie 16.99 Each line consists of three words: a vendor code, a product code and the price of that product from that vendor (a floating

C++ text centering help compliling finding errors

I have attached a lab assignment and a html document with c++ code to solve the problem (which i got from another TA) but I can seem to get it to run when it complies it returns errors. I got it down to one error by putting int MAX = 60; under the main functin and taking the .h off iostream etc. but still had one error and not

C++ code

I am having a difficult time getting started generating a C++ code for this function. char *ism_repallfile(const char *szin, const char *sztarget, const char *str, const char *sub) This is what the code is supposed to do: Takes a text file, szin opens it in line_by_line. For each line, it replaces any occurrences of str wi

Cantilever Beam Deflection

A problem is needed using microsoft visual C++ to do the following. Problem Description: For your strength of materials course you wilii write a single program using control structures(including nested loops)and file I/O to explore the deflection of a cantilever beam with a point load at the free end. This is to be on the

C++ cin.ignore function simple question

I wrote the following c++ code to a source file /this program will calculate federal and fica taxes withheld and calculate net pay //for an employee #include <iostream> #include <string> #include <stdlib.h> using namespace std; //function prototypes void empInput(string&, float&, float&, float&); float calcFwt(f

Classes in C++, implementing a member function.

I am having a dificult time understanding Classes in C++ and how to implement member functions. Given the attached code I need to: 1: Add the code to implement all of the member functions. 2: Test them from main as coded. 3: Show the order the constructors are called. 4: Show the order the destructors are called.

C++ Program help

I need someone to help me with this C++ program. I need it urgently to study for a text and compare it with mine. I'll really appreciate your answer. Thank you in advance.