I must do an assignment, so it's so hard for me to do. Now, the deadline is coming sooner and sooner, i can't finish and don't know how to do it. I need someone here can help me, i give the best regard first.
Here is the assignment; please send me the code as soon as you can, the deadline is 15th Oct, following the GMT +7 of VietNam-HaNoi.
Assignment 1: Long Integer Data Type
Revision 1.2
Worth 10%

1. Requirements

In this assignment, you are required to implement a class performing the basic arithmetic
operations, +, -, *, /, % on unlimited size non-negative integers by using Linked List data
type. All these operators are binary and their results are negative or non-negative integers. The
semantics of these operators are the same as those in C.

The programming language used to implement this assignment must be C++. You should use
VC++ to compile your program. The following libraries of C++: <string.h>, <stdio.h>, and
<stdlib.h> are only allowed to include in your program. All other libraries are forbidden.

You must use new and delete operators in C++ to allocate the memory. (DO NOT use other
functions, such as malloc( ), allocate( ), free( ), ā€¦). You must manage the dynamic memory
allocations to make sure that all dynamically allocated memory must be deallocated explicitly
before the end of your program execution.

You should read the document about C++ coding style provided in resources link and apply the
recommendations, especially item 6 Layout and comments, when coding. Your coding style is
also evaluated.

2. Operational Instructions

For your convenience, file ass1.zip is provided. You should download and extract it in a
directory, called supposedly $ROOT$. In the directory, you are given five files VeryLongInt.h,
Program.cpp, LongIntDataType.exe, input.txt, and output.txt.

The first file VeryLongInt.h is the header that contains the declarative prototype of the required
class. You must define all methods specified in the class VeryLongInt. You can augment some
your own methods into this class but you are NOT allowed to change or remove any declarations
of given methods. You must create the source file VeryLongInt.cpp that contains your

A sample driver, Program.cpp, is provided to run and test your program. We can use another
driver when testing your code. LongIntDataType.exe is the sample solution of this assignment.
You may run this program to clarify the specification. Finally, two remaining files input.txt and
output.txt are a sample test case used to test your application. You may create your own test
as following.
cases by running LongIntDataType.exe
$ROOT$> LongIntDataType.exe input.txt output.txt
Although some test files are provided, you should design your additional test cases to make sure
that your program works as desired.

3. Bonus mark
If your program can accept unlimited size negative integers, you will get a bonus (3 marks).

4. Input and output format
Input and output of your application must be in text files. In such, the input file contains two very
large integers. Each integer is terminated by NEWLINE character (ā€˜\nā€™). Rows in the output file
are results after executing the driver, Program.cpp. This means that they will depend on what
you program in the file Program.cpp. You also note that we may use another driver to test your

Your performance will be evaluated automatically by matching your results to our expected
ones. Please be sure that your results are exactly in the given format, otherwise, you fail.

5. Submission and Late Penalties
When the link Registration is activated, you must use it to provide your student ID together with
your own password. Keep the password in mind because you will use it to submit your work and
to get your result. The password is also used for next assignments and cannot be changed. If you
forget your password, please get contact to the administrator for your re-registration.

The deadline for this assignment is at 13:00 Monday, October 15
, 2007. Please use the link
Submission to submit your work and view your submitted files to make sure that they are not
corrupted. You may submit your work as many times as you like but only the last one is marked.

You are required to submit only 2 files: VeryLongInt.h (modified or not) and VeryLongInt.cpp.
Be sure that your submitted filenames are exactly correct. Any other files are not allowed.


You are strongly advised to start as soon as possible and should not wait until the last minute.
The maximum mark will be reduced by 30% for each day late. That means if you are late for 1
day, your maximum mark is 7. So, after 3 days late, you do not need to submit your assignment
anymore. Also, no excuse is accepted after this point of time.

6. Plagiarism
You must do the assignment by yourself. If it is found out that your submitted files are not your
(not only assignment mark). You are
own work, you will receive a zero-mark for this subject
also required to protect your work. You might also get zero-mark if someone else could submit
your work (with a little modification) with/without your consent.

You might be asked to attend an interview to prove that your submission is your own work.

7. Some notes when you program your assignment
+ 1234 - 1234 = 0. (Not 0000!)
+ If there is any semantic error when executing an operation, the method must return NULL.
Example: 3 / 0 => NULL; 9 % 0 => NULL

Recommended Answers

All 5 Replies

Here's a little hint from your own post

You might be asked to attend an interview to prove that your submission is your own work.

Which means, if you don't know how to write it and you just hand in someone else's work they will know. Which is completely aside from the fact that you haven't read the big READ MEs in the forum which state that we don't give homework help to those who don't try

>I need the helps,
The helps? That sounds like some kind of communicable disease.

>please send me the code as soon as you can
Why don't you just give us your teacher's email address so that we can send the code directly.

Here's my ideal, but i couldn't implement it so clear, can you help me?

class VeryLongInt{
    VeryLongInt(int val); // convert an integer into VeryLongInt object

    VeryLongInt* Clone(); // return another copy of current object (replicate the current object)
    int GetSign(); // return sign of current number
    void ToggleSign(); // toggle sign of current number
    char* ToString(); // convert current object into string
    void Print(); // output current number to console by using printf() function
    int SaveToFile(char* fileName, int appendFlag);// output to file. appendFlag: +1: append, 0: overwrite

    static VeryLongInt* Add(VeryLongInt *x, VeryLongInt *y); // x + y
    static VeryLongInt* Subtract(VeryLongInt *x, VeryLongInt *y); // x - y
    static VeryLongInt* Multiply(VeryLongInt *x, VeryLongInt *y); // x * y
    static VeryLongInt* Div(VeryLongInt *x, VeryLongInt *y); // x div y
    static VeryLongInt* Mod(VeryLongInt *x, VeryLongInt *y); // x % y
    static VeryLongInt* Power(VeryLongInt *x, int n); // x^n
    static int EqualTo(VeryLongInt *x, VeryLongInt *y); // x == y?
    static int Compare(VeryLongInt *x, VeryLongInt *y); // return +1 if x > y; 0 if x = y; -1 if x < y
    static VeryLongInt* Parse(char *str); 


I only need this time, cauz of my absence for a long time from the class. The Recursive and binary tree i study so well, i can do it, but linked list i can't, i swear, i just read the book again but it is no effect.

>Here's my ideal, but i couldn't implement it so clear
Great, you can write a class interface. But that's a far cry from implementing the interface. You still don't have anything that proves you've attempted to solve the problem.

>can you help me?
We can, but we won't. We don't help cheaters. Period.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.