Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program called flags.c that is capable of creating an image of the flags of Poland, Netherland, and Italy. country_code should be 1, 2,

Write a program called flags.c that is capable of creating an image of the flags of Poland, Netherland, and Italy. country_code should be 1, 2, and 3 for Poland, the Netherlands, and Italy, respectively.

Here's my code so far

#include

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);

int main(){

int width=0;

int country_code=0;

fprintf(stderr, "Enter the country_code of the chosen flag.(1 for Poland, 2 for Netherlands, 3 for Italy)");

fscanf(stdin, "%d", &country_code);

fprintf(stderr, "What width(in pixels) do you it be?");

fscanf(stdin, "%d", &width);

fprintf(stderr, " Making country %d's flag with width %d pixels... ",country_code,width);

return(0);

}

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

Database Programming Languages 12th International Symposium Dbpl 2009 Lyon France August 2009 Proceedings Lncs 5708

Authors: Philippa Gardner ,Floris Geerts

2009th Edition

3642037925, 978-3642037924

More Books

Students also viewed these Databases questions