Author Topic: im interested in what u guys code in.  (Read 3286 times)

When I say just started, I mean yesterday. I'm using this to teach myself.

I'm understanding the basics, but it gives you a few practice problems after introducing a new element. I just got through the chapter on loops. The practice problem I'm stuck on is:

I can't figure out return the sum after accepting the input with loops.

i wanna get me some books 2 soon.

but i dont understand what it askin by a running sum of inputs from users?
like
#include <string>
int main() {
string input;
while(true){
cin >> input >> endl;
if(cin == "0"){
system("pause")
return exit_success;}}}

lol maybe i just dumb and dont understand.

i wanna get me some books 2 soon.

but i dont understand what it askin by a running sum of inputs from users?
like
#include <string>
int main() {
string input;
while(true){
cin >> input >> endl;
if(cin == "0"){
system("pause")
return exit_success;}}}

lol maybe i just dumb and dont understand.

It means the user types in a number, and it will spit out that number, then the user enters another number, and it will be that number plus the previous number, and repeat.

For example, I type 5 and it returns 5, then I type 7 and it returns 12, then I type 4 and it returns 16. But if I type 0, the program terminates.

I code in swag motherforgeterssss!

Code: [Select]
#Swag <stankleg>
int snapbacks
If(snapback = yes)
grant tattoos
return exit_style
« Last Edit: July 22, 2013, 02:14:13 PM by KingPimpdaddy »

inputvaleu_(niven)
return: "swag"

I code in swag motherforgeterssss!

Code: [Select]
#Swag <stankleg>
int snapbacks
If(snapback = yes)
grant tattos
return exit_style
You have a type error. It should be

Code: [Select]
#Swag <stankleg>
NUMS snapbacks
If(snapback = yes)
grant tattos
return exit_style

It means the user types in a number, and it will spit out that number, then the user enters another number, and it will be that number plus the previous number, and repeat.

For example, I type 5 and it returns 5, then I type 7 and it returns 12, then I type 4 and it returns 16. But if I type 0, the program terminates.

Wow, easier said than done. I got it correct for the first two inputs, then it messes it up, meaning I need a separate function for this. Too tired to think right now but it's a nice challenge.

why is op talking like a handicap? its not even like less effort was put into his posts, he actually makes more of an effort to sound like he doesnt know basic english.

why is op talking like a handicap? its not even like less effort was put into his posts, he actually makes more of an effort to sound like he doesnt know basic english.

It may look like it takes more effort but it really doesn't.

My self survey says I should resort back to trying to sound smart and getting hated on for trying to be a smart, rather than sounding like a dumb-ass because people get easily mad over that and they hate me even more for sounding like a dumb-ass on purpose.

http://forum.blockland.us/index.php?topic=237598.0

It means the user types in a number, and it will spit out that number, then the user enters another number, and it will be that number plus the previous number, and repeat.

For example, I type 5 and it returns 5, then I type 7 and it returns 12, then I type 4 and it returns 16. But if I type 0, the program terminates.
Here's my psuedo:
Code: [Select]
int a = 0;
int b = 0;
while(true){
 a = input;
 if(a=0){
  terminate;
 }
 print(a+b);
 b = a + b; //need this to remember old val
}

VB.net, Torquescript, C#, Java, HTML

Learning C++ and Python

It means the user types in a number, and it will spit out that number, then the user enters another number, and it will be that number plus the previous number, and repeat.

For example, I type 5 and it returns 5, then I type 7 and it returns 12, then I type 4 and it returns 16. But if I type 0, the program terminates.
Here's my psuedo:
So messy, a loop should be broken by satisfying the while condition.
Code: [Select]
int main (){
int total = 0;
int input = 0;
bool quit = false;

while ( quit == false )
{
cin >> input;
total = total + input;

if ( input == 0 )
quit = true;

cout << total << endl;
}

return 0;
}
« Last Edit: July 22, 2013, 04:58:42 AM by Marcem »

So messy, a loop should be broken by satisfying the while condition.
Code: [Select]
int main (){
int total = 0;
int input = 0;
bool quit = false;

while ( quit == false )
{
cin >> input >> endl;
total = total + input;

if ( input == 0 )
quit = true;

cout << total << endl;
}

return 0;
}
sorry it's like 1 at night and im a c beginner aaa

python, c++, and torquescript mainly

some light HTML and JS, TorqueScript, C# (and Silverlight and some OpenGL), VB.Net, PICAXE Basic, Lua, and enough Java to make a simple minecraft mod and nothing more

Just TorqueScript, Parallax BASIC, a little bit of RBX.lua, and Python; hoping to move on to x86 assembly (and probably assembly for some other CPU architectures), C, and C++.
« Last Edit: July 22, 2013, 10:25:12 AM by Axo-Tak »