Project for C Create an application containing the following

Project for C++ Create an application containing the following: 2+ user defined classes 4+ data members per class (including at least one use of an array) 4+ methods per class (access and manipulation) 2+ if if-else statements 2+ while loops 2+ for loops 1 or more nested loops File IO for reading and writing data University of Colorado Boulder 1 1300 Fall 2016

Solution

#include<iostream>
using namespace std;
#define MAX 20
class A{
protected:
static const int x=3;
static const int x1=4;
static const int x2=5;
static const int x3=6;
int x4[MAX];
public:
void methodOne(int i){
if(i>2)
cout<<(i+x)<<endl;
if(i<2)
cout<<(i-x)<<endl;
if (i=2)
cout<<\"No Problem\";
}
void methodTwo(int i){
while (i<2){
cout<<(i-x1)<<endl;
i--;
}
while (i>2){
cout<<(i-x1)<<endl;
i++;
}
int w=0;
while (w<MAX)
x4[w]=w;
}
void methodThree(int i){
for (int s=0;s<i;s++)
cout<<(i*x2)<<endl;
for (int g=x3;g>i;g--)
cout<<(i*x2)<<endl;
for (int w=0;w<10;w++)
x4[w]=x4[w]+1;
}
void methodFour(int i){
for(int f=0;f<x3;f++)
for(int y=0;y<f;y++)
cout<<(i%x3)<<endl;
}
};
class B: public A{
public:
static const int y=10;
static const int y1 = 11;
static const int y2 = 12;
static const int y3 = 13;
int y4[MAX];
void methodOne(int i){
if(i>2)
cout<<(i+y)<<endl;
if(i<2)
cout<<(i-y)<<endl;
if (i=2)
cout<<\"No Problem\";
}
void methodTwo(int i){
while (i<2){
cout<<(i-y1)<<endl;
i--;
}
while (i>2){
cout<<(i-y1)<<endl;
i++;
}
int w=0;
while (w<MAX)
y4[w]=w;
}
void methodThree(int i){
for (int s=0;s<i;s++)
cout<<(i*y2)<<endl;
for (int g=x3;g>i;g--)
cout<<(i*y2)<<endl;
for (int w=0;w<10;w++)
y4[w]=y4[w]+1;
}
void methodFour(int i){
for(int f=0;f<y3;f++)
for(int t=0;t<f;t++)
cout<<(i%y3)<<endl;
}
};
class C{
protected:
static const int z=3;
static const int z1=4;
static const int z2=5;
static const int z3=6;
public:
int z4[5];
void methodOne(int i){
if(i>2)
cout<<(i+z)<<endl;
if(i<2)
cout<<(i-z)<<endl;
if (i=2)
cout<<\"No Problem\";
}
void methodTwo(int i){
while (i<2){
cout<<(i-z1)<<endl;
i--;
}
while (i>2){
cout<<(i-z1)<<endl;
i++;
}
int w=0;
while (w<MAX)
z4[w]=w;
}
void methodThree(int i){
for (int s=0;s<i;s++)
cout<<(i*z2)<<endl;
for (int g=z3;g>i;g--)
cout<<(i*z2)<<endl;
for (int w=0;w<10;w++)
z4[w]=z4[w]+1;
}
void methodFour(int i){
for(int f=0;f<z3;f++)
for(int y=0;y<f;y++)
cout<<(i%z3)<<endl;
}
};
int main(){
A a;
B b;
C c;
int f;
a.methodOne(1);
a.methodTwo(2);
a.methodThree(3);
a.methodFour(4);
b.methodOne(1);
b.methodTwo(2);
b.methodThree(3);
b.methodFour(4);
c.methodOne(1);
c.methodTwo(2);
c.methodThree(3);
c.methodFour(4);
cin>>f;
return 0;
}
  
  

 Project for C++ Create an application containing the following: 2+ user defined classes 4+ data members per class (including at least one use of an array) 4+ m
 Project for C++ Create an application containing the following: 2+ user defined classes 4+ data members per class (including at least one use of an array) 4+ m
 Project for C++ Create an application containing the following: 2+ user defined classes 4+ data members per class (including at least one use of an array) 4+ m

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site