Answered step by step
Verified Expert Solution
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
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
Step 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