Question
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
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. ppmStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started