homework

Possible compilation errors in C++

In C++, what kind of compilation errors might I run into while using function overloading, and when might these occur? ...

Recursively searching a tree to get the binary coding for a character

Hi im trying to figure out how to recursively search a tree to find a character and the binary code to get to that character. basically the goal is to go find the code for the character and then write it to a file. the file writer part i can do no problem but the real problem is putting the binary code into a string. while im searching f...

When catching an exception's parameter by value, what is the order in which the destructors are called?

In the following code, what is the order in which the destructors of b, q and e are called, and which is called before handling the exception. (The "cout..." parts are leftover for the original question) #include <iostream> using namespace std; class A { public: A(int arg) : m(arg) { cout << "A::A(int) " << m << endl; m...

Class inheritance and polymophism

Hi all, I'm extremely new to programming and c# is not very easy! This is a lesson that I can't execute. I can draw a circle, but am unable to draw a rectangle or draw a line. Can you guys see what it is that I am missing? using System; using System.Drawing; using System.Windows.Forms; namespace Shapes { public abstract class Sh...

Building a Huffman tree

I've been working on this Huffman tree builder: // variable al is an array list that holds all the different characters and their frequencies // variable r is a Frequency which is supposed to be the roots for all the leaves which holds a null string and the frequencies of the combined nodes removed from the priority queue public Frequen...

compatibility of declared variables

I have here a question: 6. Ada supports named equivalence. Given the declaration: A: array(1..10) of integer; B: array(1..10) of integer; Are A and B compatible? What if we declare this as A, B: array(1..10) of integer; Are A and B compatible? Yet another way of declaring this is Type array10 is array(1..10) of integer; A, B: arr...

How do I continue from here??

I have to implement a class Doubly-Linked List, but that doesn't have an empty head or tail node. The code listed below is what I have so far. I have no idea how to continue... The actual question: Write a program that implements a class Doubly-Linked List, but that doesn't have an empty head or tail node. Also, include a test program t...

encryption program

i need some idea for creatin a encryption program can any one help!? i need to create the program in java or c++ so need to create a logic for it this encryption prog should automatically encrypt the document n should decrypt it only if the givien conditions such as the password are fulfilled ! plz help ! ...

Sorting the three integers program

I have tried to write my program, but it doesnt come out the way I want it, can some one please revise this source code fully to show how the corrections fit in. Heres the problem: Write a program that sorts three integers. The integers are entered from the console and stored in variables numi, num2, num3, respectively. The program sort...

How to implement two periodical processes in C++ under Linux?

Hello, I am doing real time programming in C++, under Linux. I have two process, let me say A and B. A process is being started periodically, every 5ms. B process is being started every 10ms. The process A is doing some change of data. The process B is reading that data and displays it. I am confused about how to run periodically pro...

Triangular c++ edge calculation

I have been working on this source code, but nothing seems to go right. A revised source code would be extremely appreciated, or at least a visual solution to my errors. Here is the following problem: Write a program that reads three edges for a triangle and determines whether the input is valid. The input is valid if the sum of any tw...

Rectangle class

Hi everyone Im very new to c++ and may be in over my head on this problem im trying to solve. A good visual explanation and solution to my errors or even better a revised source code is all that I ask of. Thanks to everyone who invest there interest into my question. Heres the problem: Design a class named rectangle to represent a rec...

Scaling Up a Number

How do I scale a number up to the nearest ten, hundred, thousand, etc... Ex. num = 11 round up to 20 num = 15 round up to 20 num = 115 round up to 200 num = 4334 round up to 5000 ...

How to fix "can't assign function call" error?

question1=input("What is" + name+"'s" + "favorite number?") question2=input("What is" + name+"'s" + "favorite Letter?") question3=input("What is" + name+"'s" + "favorite age?") question4=input("What is" + name+"'s" + "favorite video system?") question5=input("What is" + name+"'s" + "favorite color?") question6=input("What is" + name+"'...

Need help on a php school problem

Hi everyone. I am currently in a class for the first time for php. I have run into a problem that I am racking my brain over. It consist of having to show function for OTpay. It has a pay rate, total weekly hours, regular pay, overtime pay, and also weekly pay. And it has to have an echo to the page to fill in a submit box when finis...

Compile errors for double linked list code

I have tried to implement doubly linked list in C++. Here is the code, #include <iostream> using namespace std; //double linked list class Link{ public: long data; Link *next; public: Link(long d) { data=d; } void displaylink() { cout<<data<<" "<<"\n"; } };...

Estimating running time for large inputs

An algorithm having worst-case running time of O(N^2) took 30secs to run for input size N=20. How long will the same algorithm take for input size N=400 ? ...

Remote Client-Server Application in C#

Hello everyone, In my dotNet class, we are making a simple chat application. Our professor gave us a sample code as follows: SERVER: TcpChannel channel = new TcpChannel(8085); ChannelServices.RegisterChannel(channel); RemotingConfiguration.RegisterWellKnownServiceType(typeof(RemoteObject), "myobject", WellKnownObjectMode.Singleton); C...

Prolog - find words in matrix

A friend of mine is taking a course in Programming Languages that involve Prolog. I took this course a while back and I'm pretty rusty with Prolog. My friend asked me a question in Prolog and I'm not sure how to solve it, but I guess for a seasoned Prolog programmer this would be pretty easy. If you could solve it (or at least give me th...

Optimal algorithm to calculate the result of a continued fraction

A continued fraction is a series of divisions of this kind: depth 1 1+1/s depth 2 1+1/(1+1/s) depth 3 1+1/(1+1/(1+1/s)) . . . . . . . . . The depth is an integer, but s is a floating point number. What would be an optimal algorithm (performance-wise) to calculate th...