Click here to Skip to main content
15,920,217 members

Comments by Member 12985896 (Top 6 by date)

Member 12985896 6-Feb-17 19:20pm View    
D: What's that supposed to mean?
Member 12985896 6-Feb-17 18:41pm View    
Sorry I was not totally clear and I think your answer makes a lot of sense, but my professor wanted me to use those equations. The equations being 1) TF = TR - 459.67 for converting Fahrenheit to Rankine and 2) TR = (9/5)TK for converting Rankine to Kelvin. I agree that it would be simpler to do it your way with only one equation, but this is how my professor wants it (he can be pretty unreasonable sometimes).

Is there a way that I can use those exact equations with the fahrenheit, kelvin, and rankine similar to the way I did? I think the reason why it's not working which is similar to the way you put it is because I have the equations in the format where the already initialized TF_ = TR_ - 459.67 when it should be TR_ = TF_ + 459.67, right?

Here are my professor's exact words: "Do not introduce new equations or other equations. The equations must show in this form in the program at least once."

PS: By "TF_" I mean temperature in fahrenheit, which I could have just put as TF, but my professor wants at least three characters per variable.
Member 12985896 6-Feb-17 17:26pm View    
Here is an example of a code I did without really initializing anything.

#include <stdio.h>
#include <math.h>
#define PI 3.1416

void main(void)
{
double T_period;
int Adair_mass, k11, k22;

printf("Enter the mass in kg:\n");
scanf_s("%d", &Adair_mass);
printf("Enter the stiffness value for the first spring:\n");
scanf_s("%d", &k11);
printf("Enter the stiffness value for the second spring:\n");
scanf_s("%d", &k22);

T_period = (double)2*PI*(sqrt((Adair_mass) / (k11 + k22)));

printf("The period of movement (T) for the entered values = %6.2Lf\n", T_period);
printf("The period in scientific notation is: %6.3e\n", T_period);
}

It worked perfectly fine and even though I did use int, I could have done it with double I believe.
Member 12985896 6-Feb-17 17:22pm View    
Thank you for the help, but wouldn't doing what I did end up initializing the variable "TF_" once scan_s goes through, because I will be typing in a variable then. If not, could you give me an example of how to get it to work?
Member 12985896 6-Feb-17 17:18pm View    
By initializing a variable, do you mean giving it a value? Such as using "double TF_ = 81.3;" instead of "double TF_;" and then later doing "scan_s("%Lf", &TF_);"? I'm appreciate the help, but i'm not sure what you mean. My professor isn't the best and programming is definitely not my strong suit as of now.