Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Read a usuczions beore beginnine your work CoMP1200-c- assign 02 Due 11:39 pm Fr

ID: 3743945 • Letter: R

Question

Read a usuczions beore beginnine your work CoMP1200-c- assign 02 Due 11:39 pm Friday-Sepe. 7,2018 NOTE ia Cunvus spell and eed as instucied Prakem from MATLABfor Engineers, Moore, Problem 3.4 Chenical reaction rutes ure proportiocal to a rute constezt k that chumges with temperature according to the Armenius equation. The Arrhenius equation equency Recto nstructions for all assign seritsr see Standards for Documentation ofC Pograms on the Covas Resources page. rsert cocrments at the top and throughout eoch file. o Incbade the follow couments at the beginning of this (and ALL) iles. a submitter's same, Grade of ZERO for files if submitter name sot part of Canvas group. Not in a group? GROUP* i,-nont". For your own protection, /f other group members' names // progran file name..ussign02ac f due dae of the ssignmen type "none" if submitting alone. statements) about ellaboration short narrutive about what the file does Zero points for commcnts If no collaboration statement o Use the algorithm given s conenents throuhout your program. Ohserve the instructo's rale for aming variables o Us ALL CAPS for constants veiable ames o Start otier vanables with lower case 3 points for abreno ofany of chese reguired cowments at the ap ofeachse Use descriptive viable mimes. Use Sample InputOutput as a guide. Code clarity: If yeu de not submit individually, there will be S POINTS FENALTY for eot joining o Indent blocks as eded. Use Generate CDS o Divide your solution program code into sections as roted in the algorithm. group on Can Groups can be 2-4 students. DO NOT jodn agroup alas you have worked with the other eabers. If you do, yeu will be remaved from the group and given the grade of eero Use blank lines asneeded to group smtements o Use section coaments us well as the algorithm step comments Use comments 10 show utis. Ue the CONSTANT and vuriable names; not numbers. No entre cutpt, ie. use semscolons COMPt2tOC-Spring 2018-wign02-p.1af3

Explanation / Answer

ScreenShot

--------------------------------------------------------------------------------

assign02a.c

//Group name
//Other group member's name
//assign02a.c
//11.59pm-Friday-sept 7 2018
//Collaboration details
/*
Get input variable as given in instructions
Compute rate constants
Display temperature and rate constant
*/
#include<stdio.h>
#include<math.h>
//****CONSTANTS****
#define ACT_ENERGY 8000 //cal/mol
#define GAS_CONSTANT 1.9870 //cal/mol k
#define FREQUENCY 1200 //min^-1
int main()
{
   //****VARIABLES****
   int temperature;    //Kelvin
   //****INPUT****
   //Get input temperature in kelvin
   temperature = 300; //Kelvin
    //****COMPUTE****
   //Calculate rate constant
   double K = FREQUENCY * exp(-(ACT_ENERGY / (GAS_CONSTANT*temperature))); //Rate constant
   //****OUTPUT****
   //Print temperature in kelvin and rate constant
   printf("Temperature (K)= %d ", temperature);
   printf("Rate Constant: %.5lf ", K);
   return 0;
}

Output

Temperature (K)= 300
Rate Constant: 0.00178
Press any key to continue . . .

----------------------------------------------------------------

assign02b.c

//Group name
//Other group member's name
//assign02b.c
//11.59pm-Friday-sept 7 2018
//Collaboration details
/*
Get input variable as given in instructions
Compute rate constants
Display temperature and rate constant
*/
#include<stdio.h>
#include<math.h>
//****CONSTANTS****
#define ACT_ENERGY 8000 //cal/mol
#define GAS_CONSTANT 1.9870 //cal/mol k
#define FREQUENCY 1200 //min^-1
int main()
{
   //****VARIABLES****
   int temperature;   //Kelvin
   //****INPUT****
   //Get input temperature in kelvin
   printf("Enter a temperature (100k-500k): ");
   scanf("%d", &temperature);
   while (temperature < 100 || temperature>500) {
       printf("Enter a temperature (100k-500k): ");
       scanf("%d", &temperature);
   }
    //****COMPUTE****
   //Calculate rate constant
   double K = FREQUENCY * exp(-(ACT_ENERGY / (GAS_CONSTANT*temperature))); //Rate constant
   //****OUTPUT****
   //Print temperature in kelvin and rate constant
   printf("Temperature (K)= %d ", temperature);
   printf("Rate Constant: %.5lf ", K);
   return 0;
}

-------------------------------------------

Output

Enter a temperature (100k-500k): 300
Temperature (K)= 300
Rate Constant: 0.00178
Press any key to continue . . .

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote