Share
Explore BrainMass

C++

Chinese Remainder Theorem Visual C++.NET 2003 (3)

I need help to writing a program "VC++.net"with the specified input and output. Please, Implement the Chinese Remainder Theorem. Allowing at least 3 pairwise relatively prime positive integers. Example: Problem #1 Solve p1: x = 2 (mod 3) p2: x = 3 (mod 5) p3: x = 2 (mod 7) From p1, x = 3t + 2, for some in

Chinese Remainder Theorem Visual C++.NET 2003

I need help to writing a program "VC++.net"with the specified input and output. Please, Implement the Chinese Remainder Theorem. Allowing at least 3 pairwise relatively prime positive integers. Please attention This program must run in the Visual C++.NET. Some time I have problem with that, so, please the whole project in

Problem with Microsoft Visual C++ Cannot open include file

I have problem with Microsoft Visual Studio .Net 2003 C++ I can't run almost all of program that already worked. when I do "copy" and "past" these programs in Microsoft Visual Studio .Net C++ , all these program send same error: f:Assignment-1stdafx.cpp(9): fatal error C1083: Cannot open include file: 'iostream.h': No such

C++ code to recognize comments using /* and */

I am attempting to teach myself some basic C++ programming and in working my way through a Programming Languages book, I have come across a question I am having difficulty with. The problem is two-fold. The first is to design a state diagram to recognize one form of the comments of the C-based programming languages, those th

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. I

Functions

Write a function that if given the number of hours ruturns the number of seconds. **Note: Answer must be in C++ code

Types

Programming Problem (Types) -------------------------------------------------------------------------------- Write a program to convert a measurement given in feet to the equivalent number of (a) yards, (b) inches, (c) centimeters, (d) meters (1 ft = 12in. 1 yd = 3 ft, 1 in. = 2.54 cm, 1 m = 100 cm). I need this solut

How to find errors in C++ source code ?

Please correct the errors with replacement lines beside it. And then give short notes on why it is wrong. The code is attached. 1) Please correct the errors with replacement lines beside it. And then give short notes on why it is wrong. class Person { private: char name[30]; int age; public: Person (st

C++ Programming

1. Create a class named Veterinarian. Include the doctor's name, address, and phone number. Create a class named Pet with the Pet's name, owner's name, age of Pet, breed of Pet, and veterinarian's name. Both classes contains set and display functions. Create a Pet class member function that displays the Pet's name, owner's

C++ Programming

A) Define a class named GroceryItem. Include private fields that hold an item's stock number, price, quantity in stock, and total value. Write three public functions that each set one of the three fields, based on user keyboard input. The function that sets the stock number requires the user to enter exactly four digits; con

program that asks the user for two integers and a character

Write a program that asks the user for two integers and a character, 'A', 'S', or 'M'. Call one of three functions that adds, substracts, or multiplies the user's integers, based on the character input. This is what I have so far but I cant figure out how to link the character data A, M, or S to the specific funtions. #i

C++

Write a program that asks the user for two integers and a character, 'A', 'S', or 'M'. Call one of three functions that adds, substracts, or multiplies the user's integers, based on the character input.

Code for reading Raster Data (Resubmit)

Dear Champake Mendis, MEngSc (IP), Many thanks for your reply, but I would like to resubmit. Please note that I have segmented my character as (10x10) pixels number plates 8-bit. When I used the code provided by Bill Green, TEST.bmp 20 row by 20 column BMP image, I found the right and expected result. However, when I tried

Code for reading Raster Data

'A project on Number plates; I have successfully implemented a method for character localisation, character segmentation and character recognition. Main problem at the moment is to find a method capable of reading raster data and print it to file. Have segmented characters into a 10x10 pixels, 8-bit(Bitmap) black

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++ program cpp file and the executable file

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

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.