I know I’m probably aren’t supposed to ask about C++ here, but i need help. I’m a beginner at C++, i actually started with C++ before HTML and CSS. Well anyway here is my code
Hey the char is used to stores single characters. So that should mean variable calc contains those letters.
The cout is the same as console.log in JavaScript or print in Phyton.
The cin is for input from user. So that should mean that after the cout says “Pilih Alat Mana?\n”, the user can input a letter from calc. And if the user input other letter outside of calc, the computer will print “Tolong Pilih Huruf Lain” because of this code else { cout>>"Tolong Pilih Huruf Lain"; }.
else if(calc = 'F'){
This should mean that if the user input the letter ‘F’ in cin<<calc; , this double a, c; cout<<"Pengakaran\n-----------\n"; cout<<"Masukkan angka : "; cin>>a; c = sqrt((double)a); cout<<"Hasil pemangkatan : "; cout<<(c); } will run.
That is just my understanding. Maybe I have a false understanding of the codes above. I appreciate any help no matter how small. And if you need a screen shoot of the errors just tell me.
Reread that and note the words I’ve highlighted. Do you see the issue here?
Like I said, I haven’t done much C++, but I’ve never seen anything like that. What is that even supposed to mean? What is the type of the variable calc? What does it contain? If you logged it out, what would you expect it to show?
Conceptually, what do you think this is?
The cout is the same as console.log in JavaScript or print in Phyton.
Yes, I know. My issue was with the operator, >>. Are you sure that is the right operator?
The cin is for input from user…
Yes, I know. My issue was with the operator, <<. Are you sure that is the right operator?
else if(calc = 'F'){
This should mean that if the user input the letter ‘F’…
No, it doesn’t mean that. You’re confusing the assignment operator with comparison operators.
Thanks for your help. Yeah I wasn’t paying enough attention to my code. I guess this is just too complex for my skill. I’m gonna make a simplier version. Thanks again for your help. It really helps