Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Regular C Programming please. I can't understand Make a Program that is able to create an image of flags Germany, France, and Botswana. country_code should

Regular C Programming please. I can't understand

Make a Program that is able to create an image of flags Germany, France, and Botswana. country_code should be 1, 2, and 3 for Germany, France, and Botswana

1. Use fprintf(stderr, ...) to prompt the user for input.

2. Use an if-else, or switch statement based on the country_code and put the code to create the flags within each part of the if-else or switch, whichever you have chosen.

3. Use nested for loops to iterate through the image, and generate an image of the correct size as determined by the users input to width.

4. Determine what row and column the program is currently iterating through, and write the correct color based on where on the flag that is.

so my variables are like this

void make_pixel (int r, int g, int b);

void make_ppm_header (int width, int height);

void make_ppm_image (int country_code, int width);

it should run like this

image text in transcribed

also measurements are in pixels

a.out flags.c ./a.out > Germany. ppm What country's flag do you want to create? 1 What width (in pixels) do you want it to be? 500 Making country l's flag with width 500 pixels... Done! is a.out flags.c Germany. ppm a.out flags.c ./a.out > Germany. ppm What country's flag do you want to create? 1 What width (in pixels) do you want it to be? 500 Making country l's flag with width 500 pixels... Done! is a.out flags.c Germany. ppm

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

XML Data Management Native XML And XML Enabled Database Systems

Authors: Akmal Chaudhri, Awais Rashid, Roberto Zicari, John Fuller

1st Edition

ISBN: 0201844524, 978-0201844528

More Books

Students also viewed these Databases questions