Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

a. Using c++, Write a class Scandinavian_flag that can construct the flags of De

ID: 3929441 • Letter: A

Question

a. Using c++, Write a class Scandinavian_flag that can construct the flags of Denmark, Finland, and Norway, and a main which creates each flag like this: Scandinavian_flag Denmark(white, red); and draws the two flags with the country name underneath. Don't worry about any variations in the proportions of the different flags, just make the flags recognizable as belonging to that country.

b. Take these 5 flags (Austria, Russia, Germany, Estonia, and Bulgaria) that have three horizontal stripes. Change question a to show 1 flag at a time (each flag should have country name underneath) for 5 seconds per flag( use the statement system("sleep 5"); to give each flag 5 seconds ) in a continuous loop.

Explanation / Answer

enum Value

{

EVEN = (1<<0), //<< it is the shoit operator

ODD =(1<<2), // << shift operator mainly increments from right side lets you generate squential bit.

ANOTHER_FLAG=(1<<3),

YET__ANOTHER_FLAG=(1<<4),

SOMETHING_ELSE=(1<<5),

SOMETHIMG_COMPLETELY_DIFFERENT=(1<<6),

ANOTHER_EVEN = EVEN|ANOTHER_FLAG

};

the above is the simple way of trying out the flags diaplay.

Else below can be tried out.

struct Flags

{

enum Value

{

EVEN = 0x01

ODD = 0x02

ANOTHER_FLAG =0x03

ONE_MORE_FLAG = 0x04

SOMEOTHER_FLAG= 0x012

SOMETHER_FULLY_DIFFERENT =0x25

int CreateNum(int flags)// create num is the class that has been declared

{

f ((flags & Flags :: EVEN) \ f is the funstion mainly created for the EVEN

{

same it can be cont for the odd, somether flag and something else which is different.

}

}

main() \ main class declaration

{

reatnum(flags : EVEN | flags :: ODD);

Above can also be used for the integer, constants.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote