Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

guysss this is my 3rd time posting...I want you guys to add also the the file input output it is a very big thing can

image text in transcribed

guysss this is my 3rd time posting...I want you guys to add also the "the file input output" it is a very big thing can you guys Google it and understand it and then do ZZ..btw this is C coding I want you guys to include the G tooooo

must contain all of this in the coding ( C program) a. Comment b. Indentation c. Simple input and output (printf scanf) d. Formatted input output e. Loop f. Array g. File input output h. Function (three categories function, return value function, void function only with passing argument, void function with passing argument and return parameter value). Use them appropriately.

image text in transcribed

image text in transcribed

just do coding as I said and don't forget about the file input output Thingy basically it's a C program must contain all of this in the coding ( C program) a. Comment b. Indentation c. Simple input and output (printf scanf) d. Formatted input output e. Loop f. Array g. File input output (this one pls don't forget) h. Function (three categories function, return value function, void function only with passing argument, void function with passing argument and return parameter value). Use them appropriately.

QUESTION 1 Environmental pollution has primarily been traced back to urbanization and industrial developments around the globe. Air pollution has now been identified as one of the significant problems confronting metropolitan regions of any country, where its administrators and residents have long been dealing with potential harm to air pollution, such as the health of their citizens. The occurrences of pollutants have gone up, the concentration of PM2.5, PM10, SO2, NO2, CO, O3 are through the roof. It has been identified as some of the worst air quality standards since 1999 and potentially the worst air quality throughout the world (Om Patra et al 2020). Write a C program that will calculate the AQI and categorize the air quality of a particular area based on Figure 1. AQI AQI AQI Color 03 (ppb) Category (8hr) (1hr) (ug/m) PM2.5, PM102 (ug/m) 0-50 Good Green 0-64 0 - 15 0-54 51-100 Moderate Yellow 65 - 84 16 -40 55 - 154 85 -104 125 - 164 41 - 65 155 - 254 Unhealthy 101-150 for Sensitive Orange Groups 151-200 Unhealthy Red 105 - 124 165 - 204 66 - 150 255 - 354 201-300 Very Unhealthy Purple 125 - 374 205 - 404 151 - 250 355 - 424 301+ Hazardous Maroon | 405 - 604251 - 500 425 - 604 Figure 1: Categorization of air quality You need to study and find the equation for calculating the AQI value (Refer many resources from Internet Eg https://fit.thequint.com/health-news/explaining-air-quality- index). You may create your own data or use internet data. Introduction to File Input and Output What we need? Steps: Create the file Open the file Use the file (read from, write to, or both) Close the file Input file 5-6/22 Output file Program Input & Output file Introduction to File Input and Output Creating file Creating an internal name that declaring a variable for the file - using pointer data type, FILE fpTemps #include Declaration of file Variable int main(void) Buffered stream Internal FILE *fpTemps; File Variable : : fpTemps fopen ("Temps.dat", "w"); Temps.dat (Physical File) = External File Name Introduction to File Input and Output Closing file fclose(file variable); Use the folose member function: Don't wait for operating system to close files at program end: may be limit on number of open files may be buffered output data waiting to send to file Introduction to File Input and Output 1 // Program_08.c 2 // Multiplication program: Calculate area and circumference of a circle 3 4 #include 5 #define PI 3.142 Radius of a circle is 5.50 6. // function main begins prog, Area of the circle is 95.05 7 int main(void) circumference of the circle is 34.56 8 { 9 double radius; // the value in input file 10 double area, circumference; // variable for result tr 11 12 FILE *baca, *tulis; 10-11/22 // create 2 files 13 baca = fopen("bulat.dat", "r"); // open file to reau 14 tulis = fopen ("bulat.out", "w"); //open file to write 15 16 fscanf (baca,"%lf", &radius); // using file: read from input file 17 18 area = PI * radius * radius; // calculation 19 circumference = 2 * PI * radius; // calculation 20 21 // using file: write to output file 22 fprintf(tulis," Radius of a circle is $0.2f ", radius); 23 fprintf(tulis, "Area of the circle is $0.2f ", area); 24 fprintf(tulis,"circumference of the circle is %0.2f ", circumference); 25 26 fclose (baca); // close input file 27 fclose(tulis); // close output file 28 1 // end function main

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 Design And SQL For DB2

Authors: James Cooper

1st Edition

1583473572, 978-1583473573

More Books

Students also viewed these Databases questions

Question

=+what kinds of policies and practices should be developed?

Answered: 1 week ago

Question

How does the concept of hegemony relate to culture?

Answered: 1 week ago

Question

Why do HCMSs exist? Do they change over time?

Answered: 1 week ago