Purchase Solution

Chinese Remainder Theorem Visual C++.NET 2003

Not what you're looking for?

Ask Custom Question

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 integer t. Substituting this into p2 gives 3t = 1 (mod 5). Looking up 1/3 in the division table modulo 5, this reduces to a simpler equation

p4: t = 2 (mod 5)

which, in turn, is equivalent to t = 5s + 2 for an integer s. Substitution into x = 3t + 2 yields x = 15s + 8. This now goes into p3: 15s + 8 = 2 (mod 7). Casting out 7 gives s = 1 (mod 7). From here, s = 7u + 1 and, finally, x = 105 u& + 23.

Note that 105 = lcm(3, 5, 7). Thus we have solutions 23, 128, 233, ...

This program must run in the Visual C++.NET. Some time I have problem with that, so, please the whole project included in the attached Zip file.

Purchase this Solution

Solution Summary

The Chinese Remainder Theorem for visual C++ are determined. Three pairwise prime positive integers are given.

Solution Preview

The Visual Studio .net project is attached in file chi.zip.
I hope you have no difficulty using it but, just in case, I also attached the executable chi.exe

As you have not specified your preference on the form of user interface, I made it a Dialog - it is much more convenient for ...

Purchase this Solution


Free BrainMass Quizzes
Word 2010: Table of Contents

Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.

Javscript Basics

Quiz on basics of javascript programming language.

Word 2010: Tables

Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.

Basic Computer Terms

We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.

Excel Introductory Quiz

This quiz tests your knowledge of basics of MS-Excel.