Question: In C++ Make a program that allows you to create free question tests. 1. Make a class whose objects each represent a date. 2. Make
In C++
Make a program that allows you to create free question tests.
1. Make a class whose objects each represent a date.
2. Make a class whose objects represent the time the test is taken.
3. Make a class whose objects each represent a whole number. The class has to work as if it were the int type.
Test page example( the code need to show something like this )
Name:_________ ID:____________
Date: 2/2/2021 Time: 2:00pm
Questions:
1.jiochidwonbdwockbjiu
2.inoknciowdcbiuc
3.ciodwnciowdcnkdwio
class #3 I think is probably based on this code
#pragma once
#include
using namespace std;
class MyInt
{
private:
int value;
public:
MyInt();
MyInt(int);
MyInt(const MyInt& aMyInt);
~MyInt();
void setValue(int);
int getValue() const;
MyInt& operator=(const MyInt& aMyInt);
MyInt& operator=(int);
operator int() const; //cast operator
MyInt operator+(const MyInt& aMyInt) const;
MyInt operator-(const MyInt& aMyInt) const;
MyInt operator*(const MyInt& aMyInt) const;
MyInt operator/(const MyInt& aMyInt) const;
MyInt operator%(const MyInt& aMyInt) const;
bool operator==(const MyInt& aMyInt) const;
bool operator!=(const MyInt& aMyInt) const;
bool operator>=(const MyInt& aMyInt) const;
bool operator>(const MyInt& aMyInt) const;
bool operator<=(const MyInt& aMyInt) const;
bool operator<(const MyInt& aMyInt) const;
MyInt operator+(int) const;
MyInt operator-(int) const;
MyInt operator*(int) const;
MyInt operator/(int) const;
MyInt operator%(int) const;
bool operator==(int) const;
bool operator!=(int) const;
bool operator>=(int) const;
bool operator>(int) const;
bool operator<=(int) const;
bool operator<(int) const;
friend MyInt operator+(int, const MyInt& aMyInt);
friend MyInt operator-(int, const MyInt& aMyInt);
friend MyInt operator*(int, const MyInt& aMyInt);
friend MyInt operator/(int, const MyInt& aMyInt);
friend MyInt operator%(int, const MyInt& aMyInt);
friend bool operator==(int, const MyInt& aMyInt);
friend bool operator!=(int, const MyInt& aMyInt);
friend bool operator>=(int, const MyInt& aMyInt);
friend bool operator>(int, const MyInt& aMyInt);
friend bool operator<=(int, const MyInt& aMyInt);
friend bool operator<(int, const MyInt& aMyInt);
friend ostream& operator<<(ostream& out, const MyInt& aMyInt);
friend istream& operator>>(istream& in, MyInt& aMyInt);
};
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
