I'm currently writing a program that takes in a function such as ( 7x+19 ) and I need to evaluate the function that user inputs at range of numbers. I've got the loop figured out to loop through my desired numbers, but I don't know what to call the function when the user cin>>function. Should it be a char, string, int, double? Because later I'll need to call function and mult. it by lets say 3, or 5, or 12, etc? So what should I do to accomplish what I need to get done, I'm kind of stuck on this one. I'm kind of a beginner.
swbuko
0
Newbie Poster
Recommended Answers
Jump to PostDepends, is the function hard coded or can the user enter any function at the command line?
Jump to PostDo you want to multiply numbers or do you want to replace the x in your inputfunction with a value?
All 8 Replies
iamthwee
ddanbe
2,724
Professional Procrastinator
Featured Poster
ALAZHARY
0
Newbie Poster
swbuko
0
Newbie Poster
VernonDozier
2,218
Posting Expert
Featured Poster
skatamatic
371
Practically a Posting Shark
ddanbe
2,724
Professional Procrastinator
Featured Poster
skatamatic
371
Practically a Posting Shark
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.