Object Oriented Program (OOP)

Hi everyone.
This is my first post in the Cplusplus website, so I apologize if I mess up.

I'm a beginner at programming; I have been working with C++ for only a couple of months. I understand the basics - cout, cin, datatypes, switch cases, loops, conditional statements, all that kind of stuff.

But recently my tutor asked me to learn more about Object Oriented Programming, and asked me to create an image on my compiler - Command Prompt. I haven't had any practice so I was wondering whether someone could give me an extremely basic and simple code that shows something on the screen so that I can review that code and then create my own. Or could someone explain how to make a code on my own?

My tutor said to include altitude and velocity.

Thanks,
Vasuman
Surely the assignment was more detailed than "Create an image. Oh, and by the way, include altitude and velocity."
It wasn't really a formal assignment. That actually was all he had said. It can pretty much be anything, but I would prefer it be basic so I can really understand what the code is doing.
I can not think of a single context in which the words "image", "altitude" and "velocity" can be used appropriately. Maybe in a mental ward interview.
You could maybe make a so called "ASCII art generator" - a program which loads an image, and then outputs characters in a text file that represent the grayscale values of each pixel.

It would work something like this:
1.) Load an image - probably .bmp because of their simple header structure.
1.5.) You can either write your own bitmap loader, or get a free one like EasyBMP.
2.) Iterate through each pixel of the image, and calculate the grayscale value. Use that value to derive an index location to a character array which holds characters used to represent a range of grayscale values.
2.5.) It might be sexy to clamp the image to a certain aspect ratio, otherwise your ouput textfile will be very large, as each character represents a pixel.
3.) Write the characters to a file
Last edited on
closed account (Dy7SLyTq)
i dont know too much about this, but could they perhaps be talking about something like opengl? i believe that (can) teaches a lot about oop and would include altitude and velocity i believe
Hello,

What was he smoking when he gave the assignment? Or you when you received it? It's pretty obvious that if you can't explain clearly what the goal is, neither you nor anyone else can write code to produce it.

The instructions that you portray are very much like... Take the ship (no name) from the port (none mentioned) and deliver the cargo. Let me know when you get there.

Better get more info on the assignment. Then it would be nice if you at least make an attempt to code it up before re-asking.

Largins7 (Larry)
Topic archived. No new replies allowed.