Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

BIGINT LIBRARY make a menu introducing these options: Introducing the library Me

ID: 3859680 • Letter: B

Question

BIGINT LIBRARY

make a menu introducing these options:

Introducing the library

Menu (Big integer arithmetic)

1- Adding two big integers (two options: user mode, random mode)

2- Multiplication of two big integers using classic algorithm (two options: user mode, random mode) 3

3- Multiplication of two big integers using Karatsuba algorithm (two options: user mode, random mode)

4- Multiplication of two big integers using Toom-Cook algorithm (two options: user mode, random mode)

5- Comparing the execution time of multiplication algorithms (two options: user mode, random mode)

6- Testing the correctness of algorithms

7- Continue or quit

these functions need to be in the bigInt.h header file:

ClassicalMult (bigInt A, bigInt B, int base)

karatsubaMult (bigInt A, bigInt B, int base)

ToomMult (bigInt A, bigInt B, int base)

CompareAlgorithms (char firstalgorithm, char firstalgorithm, int size)

Large_Rnd (bigInt size)

Timer ()

PrintBI (bigInt A)

GetBI(bigInt A)

Explanation / Answer

BigArithmetic.h
----------------------------
#include <stido.h>
#include <stdlib.h>     // for srand() and rand()
#include <time.h>       // for time()


#ifndef BIGARITHMETIC_H
#define BIGARITHMETIC_H


typedef struct {


} bigInt;


bigInt Large_Rnd(bigInt size) {


}


Timer() {


}


void GetBI(bigInt A) {


}


bigInt PrintBI(bigInt A) {


}


bigInt ClassicalMult(bigInt A, bigint B, int base) {


}


bigInt karatsubaMult(bitInt A, bigInt B, int base) {


}


bigInt ToomMult(bigInt A, bigInt B, int base) {


}


void CompareAlgorithms(char firstAlgorithm, char secondAlgorithm, int size) {


}


#endif // #ifndef BIGARITHMETIC_H

-----------------------------------------------------------
main.c
-----------------------

#include <stdio.h>
#include "BigArithmetic.h"


void print_menu(void) {

    putchar(' ');
    printf("1. Addition of two big integers ");
    printf("2. Multiplicaiton of two big integers (Classical) ");
    printf("3. Multiplicaiton of two big integers (Karatsuba) ");
    printf("4. Multiplicaiton of two big integers (Toom-Cook) ");
    printf("5. Compare the execution time of multiplication algorithms ");
    printf("6. Test the correctness of algorithms ");
    printf("7. Quit ");
    putchar(' ');
}


int main(void) {


    return 0;
}