Question: Hello can someone help me with this in C++ code. Skeleton Code: #include #include #include #include Wordnum.h using namespace std; /** * Creates a Wordnum
Hello can someone help me with this in C++ code.

Skeleton Code:
#include
#include "Wordnum.h"
using namespace std;
/** * Creates a Wordnum for a given value * * @param n the value of the number */ Wordnum::Wordnum(int n) { value_ = n; }
/** * Creates a Wordnum equivalent to other * * @param other the other value */ Wordnum::Wordnum(const Wordnum& other) { value_ = other.value_; }
/** * Inserts a Wordnum into an output stream as a word string * * @param os the stream to insert into * @param n the value to insert * @return the modified stream */ ostream& operator
/** * Extracts a Wordnum in word string form from an input stream * * @param is the stream to extract from * @param n the value to assign * @return the modified stream */ istream& operator>>(istream& is, Wordnum& n) { string text; if (is >> text) { n.value_ = Wordnum::read_number(text); } return is; }
/** * Returns sum, difference, product, or quotion of n1 and n2 */ Wordnum operator+(const Wordnum& n1, const Wordnum& n2) { return Wordnum(n1.value_ + n2.value_); }
Wordnum operator-(const Wordnum& n1, const Wordnum& n2) { return Wordnum(n1.value_ - n2.value_); }
Wordnum operator*(const Wordnum& n1, const Wordnum& n2) { return Wordnum(n1.value_ * n2.value_); }
Wordnum operator/(const Wordnum& n1, const Wordnum& n2) { return Wordnum(n1.value_ / n2.value_); }
/** * Writes a number word string * * @param n the number to write * @return the word string */ string Wordnum::write_number(int n) { return ""; // replace with your conversion code }
/** * Reads a number word string * * @param n the string to read * @return the value read */ int Wordnum::read_number(string n) { return 0; // replace with your conversion code }


Your task for this assignment is to define a class, named Wordnum, that will read and write numbers expressed in word form. To use the class in the calculator, simply include the class header file and change the type of the numbers nl and n2 to Wordnum. Then the program can read input consisting of expressions such as five six ninety nine - ninety nine one million / negative one hundred and for each line it will write the result in words: eleven zero six_hundred seventy_ thousand sixty_two negative ten thousand Download the file wordnum_0.zip, which contains the calculator code and a skeleton version of the Wordnum class. The class defines (but doesn't fully implement) appropriate constructors to initialise instances of Wordnum, extract and insert operators for input and output of Wordnum values, and of course arithmetic operators to compute the results. Note that for a numeric type such as this, the arithmetic operators and IO operators are best be defined as friend functions. The extract and insert operators are the most difficult to implent (indeed, they are the sole reason for defining this class), but if the number's value is represented using an int,the arithmetic operators are trival to implement
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
