im writing a currency conversion program. I know its been covered, but my questions werent answered.
quite frankly Im terrified of you guys cuz of some of the responses I have seen...maybe its just me...but it seems like you folx are not very friendly to the newbies looking for help. but Im desperate for help, so here goes nothing.
my current project goes like this:
a simple program that asks for input, checks to make sure it is an actual number, performs conversion, and prints results.
I've pored over the FAQ's, so please do not jump on me about that.
I'm doing a homework assignment, and DO NOT want anyone write my code. I am paying a fortune to go to school, so I want to learn it for myself. Therefore my intention is to obtain some explanations of a few things...IN ENGLISH...so I can understand how some of this stuff works.
Im using the following compiler:
Miracle C version 3.2, by Tadeusz Szocik, download it here
I have access to the following textbooks:
C Primer Plus, third edition
Absolute Beginners guide to programming, second edition
Im not necessarily looking for the "best" way. Im looking for the simplest way for a total newbie to achieve the desired result.
here is the code that asks for input:
I know that scanf is not necessarily the best way to get the input...thats not my question.Code:printf("Enter the amount of US Dollars you want to convert:\n"); scanf("%f",&usd);
I want to use an IF to check if the input is a number....
something like this (psuedocode):
if usd = number, print conversion values
else print "put in a number, dummy!" and go back to input request.
thats it. thats all I want to do, but im not sure how the syntax would go.
I have the currency conversion compiling and executing perfectly...except for checking to see if the input is a number or not. I would be happy to include the rest of the code if it would help.
again, im not looking for someone to do my work for me. but I dont understand how to write this small part. maybe its a mental block or something, but I dont get it.
if you read this and can help me out, thanks in advance.