English My first start in c++ (Calculator).

14 replies
Goto Page
To the start Previous 1 Next To the start
Up
script favor
User
Offline Off
I created a small calculator please don't cringe , i will continue :

Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include <iostream>
#include <fstream>
#include <conio.h>
using namespace std;



int main()
{
int n;
int n2;
char op;

string text = "Please enter numbers to begin to calculate";

cout << text;
cin >> n >> op >> n2;

int result;
if(op == '+') {

    result = n + n2;


}else if(op == '-') {

    result = n - n2;

}else if(op == '*') {

    result = n * n2;

}else if(op == '^'){

    result = n ^ n2;

}
  cout << result;
   return result;
}
edited 2×, last 11.03.19 08:15:16 pm
Visit my website : https://bounty-mafia.tk , Discord : https://discord.gg/ntNd6TX, IMG:http://i60.tinypic.com/5kixc8.gif
11.03.19 08:00:20 pm
Up
Assassin moder
User
Offline Off
Nice, you made calculator with tutorials and posted it here for no reason, keep it up and you will be banned soon
11.03.19 08:06:40 pm
Up
script favor
User
Offline Off
@user Assassin moder: This is why it's named off topic , Plot:Twist
Visit my website : https://bounty-mafia.tk , Discord : https://discord.gg/ntNd6TX, IMG:http://i60.tinypic.com/5kixc8.gif
11.03.19 08:31:15 pm
Up
Rainoth
Moderator
Offline Off
You shouldn't post stuff like that if it's not anything impressive. Unless you don't understand how something works in which case maybe you could.

Nobody makes a thread every time they manage to print out "Hello World" in cs2d with lua scripting (or in any other language for that matter). Even if it feels fucking awesome
11.03.19 08:42:23 pm
Up
script favor
User
Offline Off
@user Rainoth: You will get demoted so soon (triggred )
Visit my website : https://bounty-mafia.tk , Discord : https://discord.gg/ntNd6TX, IMG:http://i60.tinypic.com/5kixc8.gif
11.03.19 08:51:17 pm
Up
Rainoth
Moderator
Offline Off
@user script favor: I volunteer to help out so I don't see a problem with that.

I don't know if I should stop this off-topic we're having since this thread is probably going to get closed anyway.
11.03.19 09:34:25 pm
Up
ohaz
User
Offline Off
A few hints that will make coding a lot easier / better in the future:

• Use the indentations. Correctly. Focus on that. It's super important
• Give your variables good names. "n" and "n2" are not good names. "op" is also not a good name.
• Don't return the result, the return value of the main function is the exit code of the application and a return value != 0 is usually considered to be an error.

other than that: congratulations on writing your first lines of code! Continue training!
https://ohaz.engineer - Software Engineering
12.03.19 12:05:10 am
Up
script favor
User
Offline Off
@user ohaz: I'm really quite interested in your software engineering with, I'm currently learning C++ to be a programmer, maybe we can work something out.
Visit my website : https://bounty-mafia.tk , Discord : https://discord.gg/ntNd6TX, IMG:http://i60.tinypic.com/5kixc8.gif
12.03.19 04:10:33 am
Up
Oops321
User
Offline Off
First programming, first is always exciting and want to brag it to people even though that is basic stuff.

Well done and never forget that feeling, continue your programming.
But, ya don't brag every time whenever you program something basic. cheers fella
Lastest upload : file cs2d fix the collecting (0)
12.03.19 04:43:35 am
Up
404_Monk
User
Offline Off
@user Rainoth:
Said by everyone, this forum is nothing but a trash collection, Useless forum.

btw happy learning
I love communication.
12.03.19 01:37:29 pm
Up
script favor
User
Offline Off
@user 404_Monk: True. plot:twist for rainoth.
@user Oops321: Thank you i really appreciated your comment , that encourage me to do more.
Visit my website : https://bounty-mafia.tk , Discord : https://discord.gg/ntNd6TX, IMG:http://i60.tinypic.com/5kixc8.gif
12.03.19 04:08:17 pm
Up
Rainoth
Moderator
Offline Off
@user 404_Monk & @user script favor: Off-topic does not mean "anything useless with no significance" by the way. I'd pass it down if you were asking for help but unfortunately that is not the case here.
I'm not trying to be the bad guy here and ruin your fun. Just have some common sense.
@user 404_Monk: You should consider contributing something meaningful if you think it's "nothing but a trash collection" or alternatively if you don't want to do that, you may leave
12.03.19 05:50:39 pm
Up
404_Monk
User
Offline Off
@user Rainoth:
Well, I am not the one who said this thread is useless, "meaningful" is not a word for individual, not from you. Either way you can ban us all or close this thread, your comments are useless that's what I am saying, in case you don't understand.
I love communication.
12.03.19 06:40:14 pm
Up
Goo
User
Offline Off
This thread is hella spicy, what's with all the negativity?
Y'all need to chill or something.

Anyways this thread isn't useful or useless, it's a good way to motivate people to become programmers but that isn't very likely.

I think this thread should stay as long as people stop going off topic.
12.03.19 07:08:17 pm
Up
Rainoth
Moderator
Offline Off
@user 404_Monk:
I shall explain one last time then.
You said the forum is nothing but a trash collection, a useless forum.
I disagree with that statement but the only thing I can do now is to repeat myself and ask you to either contribute something so that it's no longer useless (to you) or leave, because coming in and saying "this forum is useless" is meaningless. If you critique something, suggest solutions. Whining for the sake of whining isn't helping anyone.
If I interpret this correctly, you saying "'meaningful' is not a word for individual, not from you" means you thing what I do is not meaningful. That's fine, one or two voices isn't a significant part of this community.
So to put it simply for you to understand:
If you post meaningless things, that's wrong (it's obvious why that is so).
If I (or any other person for that matter) comes and calls you out on it and explains what you could do instead (like I did before, for instance), that's not a meaningless thing. If that makes you realize that you have better things to do with your life than complain about the forum, more power to the person who called you out on it.
To keep this reply shorter (since it's already becoming a wall of text), I'm mostly aiming it at what user 404_Monk said instead of both of you.

I think user script favor got enough encouragement to keep practicing programming and enough negative responses to understand not to do this again.
Closed.
To the start Previous 1 Next To the start