Share
Explore BrainMass

C++

C++ Program

Please help with the following problem. Write a class called Dog which keeps track of the dog's name, breed, age, and license fee. The license fee will be a set amount: $12.25, since you only need one copy of this in memory, make it static. Include a method which prompts a user to set the dog's name, breed and age at the com

C++ Mortgage Calculator input and w/ menu option

I created a mortgage calculator for user to input requested amount and menu. Somehow, I think that I have it half right... I think I have lost my way somehow..See Attached files. The assignment is as follows: Modify your program so that the user will input the amount of a mortgage after selecting from a menu of mortgage l

Software language

2. What are the major differences between the Java programming language and the language discussed in question 1. Don't let this questions get out of hand, the main point of this questions is to discuss programming languages. SQL, HTML OR XML does not qualify as a programming language for this question.

C++ - points in a two-dimensional plain

Assume you are participating in a big project that deals with points in a two-dimensional plain. You are given the following structure definitions for points and segments that you should use and not modify: struct point2D { int x; int y; }; struct segment2D { point2D p1; point2D p2; }; A point, therefore,

C++ Tree (Integers)

Write a program containing a function that outputs the elements stored in the tree (integers) to the screen. The integers have to be output level by level in the order they appear in the tree. For example, if the tree stores numbers 3 2 6 4 7 1 5 as shown below, then the tree will have the following form: 3

Writing a Program that Finds the "Smallest" and "Largest" Words

Write a program that finds the "Smallest" and "Largest" in a series of words. After the user enter the words, the program will determine which words would come first and last if the words were listed in dictionary order. The program must stop accepting input when the user enters a four-letter word.assume that no word is more tha

C++ - british pounds,shillings,pence

British pounds-shillings-pence money notation: Design a class: pounds (type long), shillings (type int), pence(type int) data items. create following member functions: - no-argument constructor - one-argument constructor, taking type double(for converting from decimal pounds) - three-argument constructor, taking pounds, s

C++ console program for employee evaluation.

A retail store wishes to evaluate its employees four times a year at the end of each quarter. Evaluation Item Weight ----------------------------------- ------ First Quarter (0.00 - 100.00) 0.20 Second Quarter (0.00 - 100.00) 0.22 Third Quarter (0.00 - 100.00)

C++ Traveller program finding the shortest route.

Assume you are given a set of N < 10 cities with pairwise distances between them represented as real numbers. A traveler starts from city #1 and wants to visit all other cities just once and return back to the origin. Assume there is a direct airline between any two of these N cities. Your task is to design a C++ program that wi

Guidance using classes in C++

I am trying to learn about how to use classes with private and public variables in c++. I've got a conversion program that I would like to use as a prop. If I was to add a class to this program, what I think I know is... (Just to say, this is still fresh and I don't have a full grasp of all the concepts yet) I know t

Write a C++ program to compute and display election results.

I need help with the following program. I have an attachment with the code written. I just need the code added to where the info can be read in from a file. Write a program that allows the user to enter the last names of five candidates in a local election and the number of votes received by each candidate. The program should

Converting Infix to Postfix with C++

For every postfix expression there exists a corresponding and uniquely defined infix expression that evaluates to the same number. The converse is not true. The infix expression a + b + c can be represented as either abc++ or ab+c+ in postfix. The reason for the ambiguity is the lack of brackets in the infix expression. If th

C++ stack storing integers, strings, pairs of numbers

Extend the improved stack class stack2 so that the derived class stack would be also capable to store integers, strings, or pairs of integers. Model the pair by a structure with two integer-valued fields x and y. In the main program, define several integers, strings, and pairs and demonstrate pushing them to and popping from

C++ Function Declaration

Please show all work. Here are the problems: 2. Given the following function declaration, fill in the body so that the function will return 5 times the parameter squared plus 22.7 times the parameter minus 17.6 double funTwo (double x) // your code here return z end function funTwo 3. Given the following functi

Simple C++ program using "if" statements.

A control system applies a force to an actuator proportional to the voltage of a signal coming into the control system. It is desired not to allow actuator to quiver back and forth in the presence of small corrections near zero-force point. More force is required for the actuator to move to the left (negative direction of motion

Various small C++ programming problems

6. Consider the following sequence of C++ code int age; cout << "Please enter your age: "<<endl; cin>> Age; Would this code sequence compile? Explain. (5 points) Answer: 17. What does the following pseudocode do? (4 points) Input x Input y Set result = (x+y)/2 Output result Answer: 18. Using pseudocode o

Football Ticket Sales Console Program C++

The manager of a football stadium wants you to write a program that calculates the total ticket sales after each game. THere are four types of tickets box, sidelline, premium and general admission. After each game data is stored in a file in the following form ticketPrice numberOfTicketsSold Sample data shown below 250 57

Parking garage charges a minimum fee program using C++

A parking garage charges a minimum fee of $2.00 to park for up to 3 hours. The garage charges an additional $0.50 per hour for each hour or part thereof in excess of 3 hours. The maximum charge for any given 24-hour period is $10.00. Assume that no car parks for longer than 24 hours at a time. Write a program that will calculate

C++ - simple fractions

Design a C++ program containing a class Fraction. The class data should have two variables numerator and denominator, both of type integer, to represent the fraction numerator/denominator. The fraction representation within the object must allow no simplification. That is, the numerator and denominator have to have no common div

C++: Write a Class Coord that Includes Degrees

In ocean navigation, locations are measured in degrees and minutes of latitude and longitude. For example, 149 degrees 34.8 minutes west longitude, and 17 degrees 31.5 minutes south latitude, to be written as 149°34.8' W, 17°31.5' S. There are 60 minutes in a degree. Longitudes are measured from 0 to 180 degrees, east or west

Write a C++ program that uses a two-dimensional array to store the highest and lowest temperature for the first five months of the year. The program should output the average high, average low, and the highest and lowest temperatures for the year.

Write a C++ program that uses a two-dimensional array to store the highest and lowest temperature for the first five months of the year. The program should output the average high, average low, and the highest and lowest temperatures for the year. The program must consist of the following functions: * Function indexHighTemp

C++ Program: Dealing with Matrices

Write a C++ program that uses class Matrix for dealing with the square matrices (n x n tables of integers). The class constructor has to create a dynamic nxn matrix for n passed as a parameter. Supply the class with a copy constructor. Two overloaded operators + and * have to be implemented for adding and multiplying two matrice

C++ Program to store values in a linked list

Create a structure that has one variable called value and one pointer to the list (making it a linked list). Prompt for 5 values from the keyboard as input and store them in the linked list. Print out the current contents of the list. Allow the user to add one more value to the linked list, and print the contents of the list aga

Switch statements

Make this program using switch statements in Visual Basic/C++. Based the tuition fee of the student to the following: Year Code Year Name Downpayment 1 Freshmen 10% of tuition fee 2 Sophomore 15% of tuition fee 3 Junior 20% of tui

Design a module named getNumber which uses a reference parameter variable to accept an Integer argument. The module should prompt the user to enter a number and then store the input in the reference parameter variable.

Design a module named getNumber which uses a reference parameter variable to accept an Integer argument. The module should prompt the user to enter a number and then store the input in the reference parameter variable. I'm having difficulty comprehending the concept of a reference variable. I've written my module below, howe

Software Engineering

Do this exercise in C++ language, prefer use Visual C++ or DevC to compile. Exercise 6.3: A polynomial of degree n has the form Where are numeric constants called the coefficients of the polynomial and #0. For example: is a polynomial of degree 4 with integer coefficients 1, 3, 0, -7 and 5. One common implementati