SophiaPretty

(5)

$14/per page/Negotiable

About SophiaPretty

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Accounting,Algebra See all
Accounting,Algebra,Applied Sciences,Architecture and Design,Art & Design,Biology,Business & Finance,Calculus,Chemistry,Communications,Computer Science,Economics,Engineering,English,Environmental science,Essay writing Hide all
Teaching Since: Jul 2017
Last Sign in: 304 Weeks Ago, 4 Days Ago
Questions Answered: 15833
Tutorials Posted: 15827

Education

  • MBA,PHD, Juris Doctor
    Strayer,Devery,Harvard University
    Mar-1995 - Mar-2002

Experience

  • Manager Planning
    WalMart
    Mar-2001 - Feb-2009

Category > Computer Science Posted 30 Oct 2017 My Price 8.00

Need code that dynamically allocates an array of pointers

Need help with a couple questions. I'm not very good with pulling random things out of nowhere for these questions.

This needs to be done within 2 hours! Please!

 

1.Need code that allocates an integer on the stack and allocates another integer on the heap.

 

2.Need an abstract base class called Item that has the following methods: equip and getName.

 

3.Need code that dynamically allocates an array of pointers to class Foo with 10 elements. Dynamically allocate a new Foo object for each element of the array. Then, de-allocate each element, along with the array.

 

4.Consider the following class.

class ManagedArray {

public:

float * data;

int size;

ManagedArray():data(0),size(0){}

void setSize(int a_size){ size = a_size; data = new float[size]; }

};

Overload the output operator for this class so that it prints out each element in the data array.

 

5.Fill in the following function so that if the object pointed by "obj" is of type "Item," the If statement will trigger as true.

void printIfItem(Object * obj)

{

 

if( ) // print if obj is an Item

{

cout << obj << " is Item" << endl;

}

}

 

6.Write code with a pointer pointing at an instance of class of type Foo, and then typecast it to a pointer of type Bar.

 

7.Need a class named LivingThing and another class called Frog, which inherits from LivingThing (LivingThing is the parent class and Frog is the child class).

 

8.Write code for a class called "Integer." The Integer class should have a single int member, value. with accessors and mutators for value. The default constructor of Integer should set value to zero.

 

9.Write code for a struct called "Napkin." The Napkin class should have a floating-point member for width and height and thickness, a c-string member for material, and an integer member for color.

 

 

Again thank you and time is running out...

Answers

(5)
Status NEW Posted 30 Oct 2017 06:10 AM My Price 8.00

-----------  ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly

Not Rated(0)