ScholarMatic | 24/7 Homework Help

ScholarMatic Will Help You Write Your Essays and Term Papers

Answered » You can buy a ready-made answer or pick a professional tutor to order an original one.

Programming Project

by | Nov 30, 2023 | questions

Create one graph using the given skeleton (Project 1 Skeleton Code.zip)that meets all the stated requirements (CMSC 405 – Programming Project 1.pdf). It is suppose to be made in Visual C++ with GLUT/Open GL(EnvironmentSetup.docx). Five classes total.

Document Preview:

graphic.cpp // CMSC 405 Computer Graphics
// Project 1
// Duane J. Jarc
// August 1, 2013

// Function bodies of class that defines all graphic objects

#include “stdafx.h”

// Constructor that can only be called by the subclasses to initialize the color

Graphic::Graphic(Color color)
{
this->color = color;
}

// Sets the color of the graphic to be draw. Must be called first by the draw function of the subclasses

void Graphic::colorDrawing() const
{
glColor3d(color.red, color.green, color.blue);
}
graphic.h // CMSC 405 Computer Graphics
// Project 1
// Duane J. Jarc
// August 1, 2013

// An abstract class that defines all graphic objects

// All subclasses must define the abstract (pure virtual) function draw

class Graphic
{
public:
virtual void draw() const = 0;
protected:
Graphic(Color color);
void colorDrawing() const;
private:
Color color;
};
lexer.cpp // CMSC 405 Computer Graphics
// Project 1
// Duane J. Jarc
// August 1, 2013

// Function bdies of lexical analyzer used by the parser to parse the scene definition file

#include “stdafx.h”

static string punctuation = “,;.()”;
static Token punctuationTokens[] = {COMMA, SEMICOLON, PERIOD, LEFT_PAREN, RIGHT_PAREN};

// Constructor which must be supplied the name of the scene definition file

Lexer::Lexer(string fileName)
{
in = new ifstream(fileName);
lineNo = 1;
}

// Returns the next token each time it is called, Tokens are defined in token.h

Token Lexer::getNextToken()
{
stringstream ss;

// Skips leading spaces

while (isspace(in->peek()))
{
if (in->peek() == ‘n’)
lineNo++;
in->get();
}

// Checks for a string token

if (in->peek() == ‘”‘)
{
in->get();
while (in->peek() != ‘”‘)
ss get();
in->get();
lexeme = ss.str();
return STRING;
}

// Checks for punctuation tokens

for (unsigned i = 0; i peek() ==…

ScholarMatic: Explanation & Answer

Your ready answer from a verified tutor is just a click away for as little as $14.99


  

Click Order Now to get 100% Original Answer Customized to your instructions!

HOME TO CERTIFIED WRITERS

Why Place An Order With Us?

  • Certified Editors
  • 24/7 Customer Support
  • Profesional Research
  • Easy to Use System Interface
  • Student Friendly Pricing

Have a similar question?

PLAGIRAISM FREE PAPERS

All papers we provide are well-researched, properly formatted and cited.

TOP QUALITY

All papers we provide are well-researched, properly formatted and cited.

HIGHLY SECURED

All papers we provide are well-researched, properly formatted and cited.

ScholarMatic: Get Started

Assignment Writing Service

Feel safe and secure when placing an order on our portal!
Fruitful cooperation begins with solid guarantees, and we are professional enough to promise perfect results. Let’s get it started!