Question: Write the UML class diagram for this class below on https://creately.com/Draw-UML-and-Class-Diagrams-Online ################### Asteroid.h ############# class Asteroid { private: int size , speed; public: Asteroid(); void

Write the UML class diagram for this class below on https://creately.com/Draw-UML-and-Class-Diagrams-Online

################### Asteroid.h #############

class Asteroid { private: int size , speed; public: Asteroid(); void setSize(int s); void setSpeed(int s); };

################### Asteroid.cpp #############

#include "Asteroid.h"

Asteroid::Asteroid() { } void Asteroid::setSize(int s){ if(s < 1){ size = 1; } else if(size > 20){ size = 20; } else{ size = s; } }

void Asteroid::setSpeed(int s){ speed = s; }

############ main.cpp ########

#include #include "Asteroid.h" using namespace std;

int main() { Asteroid a1; a1.setSpeed(45); a1.setSize(34);

Asteroid a2; a2.setSpeed(34); a2.setSize(5); return 0; }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!