Questions
We wish to implement a BigNumber class that represents nonnegative integers with up to 100 digits....

We wish to implement a BigNumber class that represents nonnegative integers with up to 100 digits. To make this work, we will use an array of digits as the underlying representation. In particular, we will use an array of char, where each char represents an actual number from 0 to 9, not the ASCII characters '0' to '9'. That means when you implement the stream insertion operator you'll need to cast each array element to an int. So out << int(digits[i]) rather than out << digits[i].

Below it the code that will go in your BigNumber.h. You'll want to add the implementation file BigNumber.cpp where you implement all the prototypes in BigNumber.h. You'll also need to implement a Driver.cpp to with a main to test your functions.

class BigNumber

{

       friend ostream &operator<<(ostream &, const BigNumber &);     // stream insertion operator

// output the number as we would normally read it e.g. output 17 means the number seventeen.

private:

       char digits[100];  // to hold the digits with digits[i] representing the 10^i's place.

       int numDigits;  // number of digits in the number, e.g 5 has one digit but 45 has two. ZERO should have zero digits

public:

       BigNumber(int value = 0);  // default constructor.

  

int getNumDigits() const;         // return numDigits

       bool isZero() const;      // return true iff *this is equal to ZERO

       bool operator< (const BigNumber & c) const;     // less than

       bool operator>= (const BigNumber & c) const;    // greather than or equal

       bool operator<= (const BigNumber & c) const;    // less than or equal

       bool operator== (const BigNumber & c) const;    // equal

       bool operator!= (const BigNumber & c) const;    // not equal

};

//OUTPUT SHOULD BE AN INTEGER

UPLOAD THREE FILES: BigNumber.h and BigNumber.cpp and Driver.cpp. I should be able to load the three files in Visual Studio and everything will compile fine. I will also run your code with my driver so be sure your class will work correctly when tested extensively.

Your Driver.cpp will look something like this:

#include "BigNumber.h"

#include

using namespace std;

int main()

{

  BigNumber n(123);

  cout << n << endl;

// (etc.)

return 0;

}

In: Computer Science

The factorial of a nonnegative integer n is written n! (Pronounced “n factorial”) and is defined...

The factorial of a nonnegative integer n is written n! (Pronounced “n factorial”) and is defined as follows: n! = n.(n-1). (n-2).……...1 (for values of n greater than 1) n!=1 (for n = 0 or 1)
For instance, 5! = 5.4.3.2.1 which is 120.
Write a Python program that reads a nonnegative integer n and calculates and prints its factorial. Your program should display a suitable error message if n entered as a negative integer.

   Figure   6.   Exercise   6   Sample   Run   for   n   =   0,   -8   and   5.

In: Computer Science

ALGORITHM ANALYSIS AND DESIGN Analyze the given questions and answer accordingly 1.       Given the algorithm to...

ALGORITHM ANALYSIS AND DESIGN

Analyze the given questions and answer accordingly

1.       Given the algorithm to calculate the factorial of ‘n’. Mathematically analyze the given recursive algorithm to find out the time complexity of the algorithm.   

Algorithm F(n)

If n = 0 return 1

Else

Return f(n-1) * n

In: Computer Science

Describe what a stateful packet filter is as compared to a normal packet filter, especially the...

Describe what a stateful packet filter is as compared to a normal packet filter, especially the characteristics that a stateful packet filter has and that allow some protocols, e.g., FTP, to work, if it is configured to block unwanted incoming TCP initiations from the outside to a computer on the inside network.

In: Computer Science

Create two data documents containing a patientRecord – one in XML and another in JSON format...

Create two data documents containing a patientRecord

– one in XML and another in JSON

format

Your patientRecord must contain the following data:

-A patient’s name & ID number

-The date of his/her last appointment & the date of the last update

-The patient’s allergies – you must include 2 – one for a food allergy and one for a drug

allergy

-The patient’s preference – you must include 2 – one for a doctor and one for his/her

method of contact (which would have a value of text, phone, or email)

In: Computer Science

Describe what a buffer overflow attack is, especially the main purpose of the attack. During program...

Describe what a buffer overflow attack is, especially the main purpose of the attack. During program execution, an input function is called to get a user's interactive input to the program. Describe what will happen to the return address kept in memory during the function call and the consequences if the user is an attacker performing a buffer overflow attack.

In: Computer Science

1) Given the list of integers 1, -2, 3, -6, 7, -8, 9, 10, -11, indexed...

1) Given the list of integers 1, -2, 3, -6, 7, -8, 9, 10, -11, indexed from 1 to 9, the left-to-right linear scan algorithm (O(n) algorithm) will set as candidate start positions for a maximum contiguous sequence the elements at the index positions:

(a) 1,3,4,6

(b) 1,3,4,6,9

(c) 1,3,5,7

(d) none of the above

2)The Fibonacci sequence 1,1,2,3, ... can be generated iteratively by starting with the first two (0th and 1st) and generating every subsequent one by adding the previous two. In fact, the nth Fibonacci number can be generated by n − 1 additions for n ≥ 2. Thus we need 5 additions to generate the 6th Fibonacci number. However, a recursive program to generate the 6th Fibonacci number needs:

(a) 12 additions (b) 11 additions (c) 10 additions (d) None of the above

3)we can use a stack to check if a string made up of open, “(”, and closed, “)”, parentheses is balanced. Simulate this algorithm on the input string “((()))(())()” to determine if it is balanced or not. (this means you must explicitly write down the sequence of pushes and pops that the algorithm would generate

In: Computer Science

What makes someone a "power" internet user? What makes someone a regular internet user?

What makes someone a "power" internet user? What makes someone a regular internet user?

In: Computer Science

In C++ Write a program to store exam scores into a file. The program will ask...

In C++ Write a program to store exam scores into a file. The program will ask the user how many exam scores to enter. Then it will ask the user for each exam score and store them in a file called scores.dat The file output should have the following format: Exam 1: 97 Exam 2: 85

In: Computer Science

The Scenario: A company is transitioning from a spreadsheet model to a database to track customers...

The Scenario:

A company is transitioning from a spreadsheet model to a database to track customers and purchases.

The Request:

  • You need to normalize the data up to N3.

Requirements and Information:

  • Normalize the below spreadsheet:
    • Normalize_Assignment2.csv

Need help as the following:

Upload an excel spreadsheet wit the normalized data

Customer Name Customer Address Phone Number(s) Products Purchased Distribution Warehouse Distribution Warehouse Address Distribution Warehouse Phone Number Date of Purchase
Matt Smith 11 Kevlar Ln., Grand Rapid, MI 49508 616-610-2718, 616 473-2813 Blu Ray Player, HDMI cable East Mountain Distribution Center 23 Hangster St. Brooklyn, NY 13867 212202-4321 10/31/18
Keith Jones 66 Buthers Point, Carson City, Nebraska 89403 775-246-3712 U2 Album West Coast Distribution Center 3245 Lovers Ln, Lexington, KY 21482 414.321.4326 11/1/18
Brian Adams 63 Lovingtin Cir., Newark DE 19701 410-428-2367 Retro Pi, MicroSD Card, Raspberry Pi Case Tri-State Distribution Center 1397 S. Main Street, Middletown, DE 19709 302-434-5566 10/31/18
Julia Townsend 5 Pennywise Ln., Yardley, PA 19067 972-274-6289 Blu Ray Player Tri-State Distribution Center 1397 S. Main Street, Middletown, DE 19709 302-434-5566 11/5/18
Mo Rocca 871 Eagle Ct., Newark, NJ 21908 Unknown Mini NES, DaVinci Code Book East Mountain Distribution Center 23 Hangster St. Brooklyn, NY 13867 212202-4321 10/31/18
Steven James 4 Autumn Ter., Boulder CO 80301 970-273-1856 White glue, glitter, saline solution, baking soda West Coast Distribution Center 3245 Lovers Ln, Lexington, KY 21482 414.321.4326 11/7/18
Rick Ford 333 33rd St NY, NY 10027 347-383-8844 Paint Set, Canvas, Paint Brushes East Mountain Distribution Center 23 Hangster St. Brooklyn, NY 13867 212202-4321 11/5/18
Harrison Wells 12534 Silver Lake Ave., Houston TX 77027 269-226-1599, 267-227-4891 Harry Potter Book Series West Coast Distribution Center 3245 Lovers Ln, Lexington, KY 21482 414.321.4326 11/3/18
Jen Cusak 8 Washington Ln., Baton Rouge LA 70808 645-378-2889 LOL Surprise Dolls West Coast Distribution Center 3245 Lovers Ln, Lexington, KY 21482 414.321.4326 11/7/18
Brian Adams 63 Lovingtin Cir., Newark DE 19701 302-338-6279, 410-428-2367 Cat Puzzle East Mountain Distribution Center 23 Hangster St. Brooklyn, NY 13867 212202-4321 11/3/18
Matt Smith 11 Kevlar Ln., Grand Rapid, MI 49508 Sweater Tri-State Distribution Center 1397 S. Main Street, Middletown, DE 19709 302-434-5566 11/3/18
Mo Rocca 33 Patriot Dr., Santa Monica, CA 90405 310-268-9921 Knife set East Mountain Distribution Center 23 Hangster St. Brooklyn, NY 13867 212202-4321 11/1/18
Brian Adams 63 Lovingtin Cir., Newark DE 19701 302-338-6279, 410-428-2367 Paint Brushes West Coast Distribution Center 3245 Lovers Ln, Lexington, KY 21482 414.321.4326 11/3/18

Expert Answer

An expert answer will be posted here

In: Computer Science

In Java, Write a JavaFX application that draws multiple circles using a rubberbanding technique. The circle...

In Java, Write a JavaFX application that draws multiple circles using a rubberbanding technique. The circle size is determined by a mouse drag. Use the initial mouse press location as the fixed center point of the circle. Compute the distance between the current location of the mouse pointer and the center point to determine the current radius of the circle.Thank you and could you also show the finished product?

In: Computer Science

Write a program in C++ that declares an array of 100 integers named scores[]. Prompt the...

Write a program in C++ that declares an array of 100 integers named scores[]. Prompt the user for how many scores they want to enter. Then read in the specified number of ints and store them in the array. Then prompt the user for a passing grade. Use a for loop to go trough the array and count how many scores are passing. Print the count of how many passing scores, and also print a double that is the percent of scores that were passing. Note that although the scores array is allocated to store 100 ints,only the number of scores specified by the user are actually stored, so generally only part of the array storage capacity is used.

Intro into C++

In: Computer Science

Suppose we perform a sequence of n operations on a data structure in which the ith...

Suppose we perform a sequence of n operations on a data structure in which the ith operation costs logi if
i is an exact power of 2, and 1 otherwise. Use two different methods to determine the amortized cost per
operation.

In: Computer Science

List all the items sent from Client only, involved in establishing an SSL session, assuming the...

List all the items sent from Client only, involved in establishing an SSL session, assuming the followings:

o A new session is to be established

o No compression method is to be used

o Key exchange method is RSA

o Authentication of client is required

In: Computer Science

Using the object-oriented programming principles, write a currency exchange converter in Java. You should also use...

Using the object-oriented programming principles, write a currency exchange converter in Java. You should also use 3 different classes it could be currency1 and currency2 and currencytest, and set() and get() method and tostring() method. A person will be presented with 3 currencies (i.e., USD, AED, MYR) that they can convert to/from AED Dirham. The program will allow the user to input the amount of Dirham or other currency to be converted. The Money changer will take AED50 commission if converted amount is equal or more than AED900, or it will take AED10 commission if the converted amount is less than that.

Your program should throw an error message if the user tries to convert an amount less than AED30.

Note: 1 AED=0.27 USD,  1 AED=1.14 MYR

Sample output:

Please enter your currency (USD, AED, or MYR only): USD

What currency do you want?: AED

How much you want to convert? : 1000

Thank you. The converted amount is AED3673.20. We will take AED50 commission, and you will get 3623.20.

Please enter your currency (USD, AED, or MYR only): USD

What currency do you want?: AED

How much you want to convert? : 100

Thank you. The converted amount is AED367.32.  We will take AED10 commission, and you will get 357.32.

Please enter your currency (USD, AED, or MYR only) : AED

What currency do you want?: USD

How much you want to convert? : 367.32

Thank you. The converted amount is USD100.  We will take AED10 commission, and you will get USD97.28.

In: Computer Science