Hi, I'm on chapter 4.4 of bjarne stroustrup book. The problem is it has starting to talk about math.
Now I'm partly dumb when it come to math. I don't get most of it, should I start learn math? Is there like minimum math level that I should at least know? It seem like statement is after the math and conversion relate part on book. I understand that part afterward.
You should at least be familiar with high school math, I should say. That is, conventional operator precedence (1 + 2 ^ 5 * 3 = ?); some understanding of polynomial functions, including solution of quadratic equations; and elementary functions: exponent, logarithm, and trigonometric functions, plus their geometric relationships. Additionally, Boolean algebra is extremely useful.
Let see, My possibilities goal of studying c++. Is to able to create game, software, bot, script. I always wanted to make my own OS.
OS is what I really want, but I assume its not possible to solo. Since I read some book about it. Seem like it require a lot of work and different focuses.
Let say, I want to make small and simply game, so what kind of math would I need to learn? I'll be prolly be self taught. Since I have no money to start with. College doesn't like me. I'm going to look up on internet, for math practical.
Game design and OS design are too different things.
I've put a good amount of hours into systems and microcontroller programming. I've only just started on my game programming and it's safe to say apples aren't oranges.
You will have to decide what you want to focus on, but both require a substantial amount of prior knowledge of the language. Operating system programming will require a decent amount of computers and how everything works in there. Something you pick up on as you practice programming and study.
I'd recommend heading helios first point and get basic mathematics down. Start small with 2D space.
I too am completely self taught. If you have the passion and will you can do it. (My fascination with the 8Bit megadrive still drives me to this day)
If you struggle to understand anything there are plenty of experienced people here to help you out. I'm not professional but feel free to PM me if something mundane is picking at your brain. :]
I cant think of anything... I'm still new to this. Just want to understand completely.
edited: new code yay... is my answer correction? I have no teacher, so I'm bit depending on this site. Thanks
its assign from book.. not homework, this is self taught.
Rewrite your currency converter Program from the previous Try this to use a switch-statement. Add conversions from yuan and kroner. Which version of the program is easier to write, understand, and modify? why?
#include "std_lib_facilities.h"
int main()
{
constexprdouble yuan_dollar = 10.5;
double kroner_per_yuan = 1;
char coin = 'a';
cout << "Please put in number of coins followed by (y or k).\n";
cin >> kroner_dollar >> coin;
switch (coin)
{
case'y':
cout << "Your yuan value in kroner is " << yuan_dollar * kroner_per_yuan << " kroner\n";
break;
case'k':
cout << "Your Kroner value in yuan is " << kroner_per_yuan / yuan_dollar << " yuan\n";
break;
default:
cout << "What the... type either y or k please.\n";
break;
}
}
I take it back, i understand the point of ++i now. ha
The variable 'kroner' is improperly named, because the unit its value is in depends on user input. If the user enters "42 y", you have a situation where a variable named 'kroner' contains a value in yuan, which is like having this situation:
1 2 3
float centimeters;
std::cout << "Input value in inches: ";
std:: cin >> centimeters;
It would be better to name the variable 'input'.
The variable 'yuan' is also improperly named, because it actually contains a currency ratio. A better name would be 'kroner_per_yuan'.
The program looks otherwise correct, but note that the way you've coded it implies that the conversion rate is 1 yuan = 10.5 kroner. I can't tell if that's what you intended or not.