Question: Please do in clion c executable c 9 9 . practice.c and practice.h code that was given is included. Also please don't answer using python
Please do in clion c executable c practice.c and practice.h code that was given is included. Also please don't answer using python code or an answer that doesn't even use anything in the question. thank you
Q: How Many Days
Write a program that determines the day number to in a year for a date that is provided as input data. As an example, January is day December is day December is day since is a leap year. A year is a leap year if it is divisible by four, except that any year divisible by is a leap year on accept the month, day, and year as integers. Include a function leap that retuns if called with a leap year, o otherwise. This problem is based on Chapter Problem #: Given a month, day, and year, calculate how many days
into the year that date is This is the framework:
c h a p t e r q u e s t i o n
i n t l e a p i n t y e a r ;
i n t daynumber i n t month i n t day i n t y e a r ;
The problem is really only asking you to build the daynumber function, but, its easier to build that if we
have a function that tells us whether a given year is a leap year. Therefore, build the leap function first and
have it return if the year is a leap year and zero otherwise. Then, use that to build the daynumber function.
Q : Pollutants
Write a program that interacts with the user like this Carbon monoxide Hydrocarbons Nitrogen oxides Nonmethane hydrocarbons Enter pollutant number Enter number of grams emitted per mile Enter odometer reading Emissions exceed permitted level of gramsmile Use the table of emissions limits below to determine the appropriate r message First Miles Second Miles gramsmile gramsmile gramsmile gramsmile carbon monoxide gramsmile gramsmile gramsmile gramsmile nitrogen oxides nonmethane hydrocarbons. This problem is based on Chapter Problem # Given the pollutant type, how much is being emitted, and
the odometer reading of the car, you are supposed to calculate whether the car is legal within the limits or
illegal exceeding the limits
c h a p t e r q u e s t i o n
t y p e d e f enum p o l l u t a n t t y p e c a r b o n m o n o x i d e h y d r o c a r b o n s
n i t r o g e n o x i d e s n o n m e t h a n e h y d r o c a r b o n s p o l l u t a n t t y p e ;
t y p e d e f enum p o l l u t a n t l e v e l t y p e l e g a l i l l e g a l p o l l u t a n t l e v e l t y p e ;
p o l l u t a n t l e v e l t y p e e m i s s i o n s p o l l u t a n t t y p e p d o u b l e g r a m s p e r m i l e i n t o d o m e t e r ;
You see two typedefs here: one for a enum of the types of pollutants and one for an enum for legal or illegal.
Line is the specification of the function you are to build. It has three parameters:
pollutanttype p: one of the pollutanttype values
double grampermile: the rate the car is emitting that pollutant
int odomoter: how far the car has been driven
Your job is to make the function return either illegal or legal based on the table in the book. Note that the
values in the table are legal only exceeding them is illegal
practic.c code:
int leapint year
Your code here
return ;
int daynumberint month, int day, int year
Your code here
return ;
pollutantleveltype emissionsenum pollutantleveltype p double gramspermile, int odometer
Your code here
return carbonmonoxide;
practice.h code:
chapter question
int leapint year;
int daynumberint month, int day, int year;
chapter question
enum pollutantleveltypecarbonmonoxide, hydrocarbons, nitrogenoxides, nonmethanehydrocarbons;
double emissionsenum pollutantleveltype p double gramspermile, int odometer;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
