15,920,217 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
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.
Member 12985896
6-Feb-17 15:55pm
View
In class we don't use the debugger, but anyways aren't the variables initialized when I use "double TF_, TK_, TR_;", same as they would be if I used "int"? The program works if I reverse the equations like "TF_ = TR_ - 459.67;" would be "TR_ = TF_ + 459.67;".
Show More