Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please use C and graphics.h Write a program that draws a picture of the Halloween pumpkin shown in the following diagram: As in the house.c

Please use C and graphics.h image text in transcribed
Write a program that draws a picture of the Halloween pumpkin shown in the following
diagram:
As in the house.c program shown in Figure 7-7, your picture should be controlled by several
constants:
#define HeadRadius 1.0
#define StemWidth 0.1
#define StemHeight 0.15
#define EyeWidth 0.3
#define EyeHeight 0.2
#define NoseWidth 0.2
#define NoseHeight 0.2
#define NTeethPerRow 7
#define ToothWidth 0.083333
#define ToothHeight 0.15
These values are the ones used to produce the pumpkin shown in the diagram, and you should
be able to figure out what each constant means by looking at the picture. Your program must
be written so that changing any of these constants changes the picture in the appropriate way.
For example, if you change NTeethPerRow to 4, the new diagram should have only four teeth
in each row, but the mouth should still be centered horizontally. The two eyes and the mouth of
the pumpkin face should be drawn halfway from the center to the edge of the circle in the
appropriate direction, so that changing HeadRadius also changes the positions at which these
features are drawn. The center of the circle representing the pumpkin should appear at the
center of the screen
7.filename: pumpkin.c (There are no output files provided, please visually validify your output images to the ones in the book and submit your c code.) Write a program that draws a picture of the Halloween pumpkin shown in the following diagram: As in the house. program shown in Figure 7-7. your picture should be controlled by several constants: #define HeadRadius #define Stem Width #define Stem Height #define Eye Width #define Eye Height #define Nose Width #define Nose Height #define NTeeth PerRow #define Tooth Width #define Tooth Height 1.0 0.1 0.15 0.3 0.2 0.2 0.2 7 0.083333 0.15 These values are the ones used to produce the pumpkin shown in the diagram, and you shou be able to figure out what each constant means by looking at the picture. Your program must be written so that changing any of these constants changes the picture in the appropriate wa For example, if you change NTeeth PerRow to 4, the new diagram should have only four teeth in each row, but the mouth should still be centered horizontally. The two eyes and the mouth the pumpkin face should be drawn halfway from the center to the edge of the circle in the appropriate direction, so that changing HeadRadius also changes the positions at which thes features are drawn. The center of the circle representing the pumpkin should appear at the center of the screen. TC 10 0.15 03 : #define HeadRadius #define Stem Width define Stem Height #define Eye Width #define Eye Height #define Nose Width #define Nose Height #define Teeth PerRow #define Tooth Width #define Tooth Height 02 02 02 0.083333 0.15

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_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

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

Get Started

Students also viewed these Databases questions