Explore BrainMass



In C++ Write an if else programe that given a state, return its capital? Maryland - Annapolis Massachusetts - Boston Michigan - Lansing Minnesota - St. Paul Mississippi - Jackson Missouri - Jefferson City Montana - Helena Nebraska - Lincoln Nevada - Carson City New Hampshire - Concord New Jersey - Trenton New Me

Greatest Common Divisor (GCD) in C++

I need the following problem in C++ with a recursive function and a driver programe to test the function ? * A recursive program to calculate the Greatest Common Divisor of two integers using the Euclidean Method. The algorithm in non-recursive form is as follows: EuclidGCD(a,b) { while (b not 0) { swap(a,b) b = b

How to control variations in program

Since every program that is created is different from every other program, what are the variations that we look for and how do we control them?

C++ Programming.

Please solve the Programming project 1 in the attached file. I have attached the program (display 16.4) which should be used in the project 1. I need the coding and the exe file.

C++ Programming Language

Please modify the attached program so it will satisfy the below requirements: Write the program as a procedural C++ program. Allow 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% Use an array for the different loans. Displ


I have attached the document and several pages from my textbook please convert the traffic program from C++ to JAVA BlueJ. I DON'T NEED THE GRAPHS. HOWEVER, IT SHOULD DISPLAY NUMERICAL FEEDBACK TO THE USER AND ALLOW INPUT FROM USER ALSO.

PQ #1

I have a query that starts with the line: SELECT books.isbn, order_lines.isbn ...why would I want to see isbns from two different tables? What sort of query would warrant that - an inner join or an outer join? Assume the table "books" contains books that the company stocks. Assume the table order_lines only

Data Structures with C++ (STL)

Consider the class declaration class demoClass { public: // assign arguments as initial values for the data members demoClass(int a = 5, int b = 10); // function returns the maximum of itemA and itemB // int max() const; private: int itemA, itemB; }; (a) Give t

Reading from a file in c++

I need to modify this code, instead of asking the user for the matrix, it will read the matrix from a file called Data.txt. The matrix must be 4x4.


Using the attached file all numbers class do the following: - write a template function for the class called Add15() that adds 15 to each of the two numbers and display the result - write a template function for the class called multiplybypoints5() that multiples 0.5 to each numbers in the parameter list and display result

C++ Problem

Program that does the following: delcale an integer (var1) declare a pointer (ptr1) that points to var1 declare a reference (ref1) to var1 assign the address of var1 to ptr1 print the value of var1 using the pointer use the ref1 to change the value of var1 to var15 print the value of var1 using the ref1

C++ problem

Write a program, employe_data.cpp, with the Employee class that has two employees; sets their age, yearsOfService, and salary (rounded to the nearest thousands of dollars; and prints their values. (you will need to write the code in member functions.) And, Change the Employee class such that you can initialize age, yearsOfSer

Visual C++

The following class uses composition to define a line object in terms of two point objects. class line { public: Point startingpoint(); point endingpoint(); float length(); line (int startX, int startY, int endX, int endY); private: point startPoint; point endPoint: }; 1) write a fucntin defintion for the Lin

Visual C++

Give the class declaration class point { public: int xcoordinate(); int ycoordinate(); point(in initializeX, in initialize Y); private: int x; int y; }; 1: Suppose we have a type declaration as follows: enum status {on, off}; declare a class Pixel that inherits from class Point. Class Pixel will have an ad

Visual C++ Classes

Write a program that read in an integer. If the integer is a negative number, catch the exception and print an error message "Invalid Integer: value negative" and prompt the user for another number. If the integer is zero, catch the exception and print a message, "Integer cannot be zero, and end the program. Otherwise, just pri

Visual C++

Write a C++ value returning function that implements the recursive formula F(n) = F(n-1) + F(n+2) with base cases F(0)=1 and F(1) =1

Crossed and inverted words (C++ programming)

I need a program that when a word is entered knows if the word is odd or even of characters and if it is odd it should display the word in a cross and if it's even it should display the word inverted. Example: Microsoft M M i i c c r r o s s o o f f

Priority Queues (C++ Programming)

I need a program that uses the structure of priority queues that implement the right way to take care of an emergency room. Priorities: 1. Respiratory failure 2. No circulation 3. Hemorrhages It should be taken in consideration that if exists two persons with the same level of priority the first one to arrive is the fir

Inheritance - SalariedEmployee - C++

Write a program that uses the class SalariedEmployee shown below. Your program is to define a class called Administrator, which is to be derived from the class SalariedEmployee. You are allowed to change private in the base class to protected. You are to supply the following additional data and function members: A member vari

Strings and Vectors C++

Please enhance this program. Write the definition of the readAndCount function. The function should read the input line, character by character, counting the number of words (a sequence of letters) and the number of occurrences of each letter. The array to hold the number of occurrences of each letter is the parameter let

C++ Names.cpp

Write a program that reads a person's name in the following format: first name, then middle name or initial, and then last name. The program then outputs the name in the following format: Last_Name, First_Name Middle_Initial. For example, the input Mary Average User should produce the output: User, Mary A. The inp

Friends and Overloading Operators C++

Complete and test this exercise. Implement the default constructor and the constructor with one int parameter. Overload the + and - operators to add and subtract percents. Also, overload the * operator to allow multiplication of a percent by an integer. Write a program to test all the member functions and overloaded operator

Infinite Loop C++

Can you find a bug in this program and then fix it so that it won't have an infinite loop? #include <iostream> #include <fstream> using namespace std; void CalculateAvgScore(ifstream &fIn,ofstream &fOut); int main(int argc, char *argv[]) { ifstream fin; ofstream fout; char inFileName[20],outFileName[20];

I/O Streams

Write a program that reads text from one file and writes an edited version of the same text to another file. The edited version is identical to the unedited version except that every string of two or more consecutive blanks is replaced by a single space. Thus the text is edited to remove any extra blank characters. Your progr

C++ Programming

I need a program that will ask the user how many courses he wants to input and how many students he wants to add to each course and the name of each student. Example of a run: INPUT: How many courses? 2 Enter the name of the #1 course: Structure Programming Enter the how many students: 3 Enter the name of the #1 stud

C++ Programming

I need a program that will add mega numbers (20 digits). It has to be done with arrays. Example: INPUT: 2 numbers of 20 digits 12345678901234567890 12345678901234567890 OUTPUT: 12345678901234567890 12345678901234567890 +_____________________ 24691357802469135780

C++ Programming

I need a program that contains a function that receives an array of integers of 3 elements. The function must implement a "shift" to the right. For example if the numbers 1 2 3 are entered, after passing to the function the values must be 2 3 1. The program must display the two values.

Simple linked list C++

When I typical write a linked list class to store int values I would setup the class something like this.... struct Node { int _item; Node *_next; }; Node *_head; However, I know have to write a program that will use IntNode.h to create a linked list implementation. The way the designer setup this .h file is