-
November 24th, 2009, 04:13 AM
#16
Re: Bar Charts in C++?
okay well maybe the programming world is not for me then im just a student trying to pass the class that my teacher did not teach because i asked 5/25 students in the class and the teacher did not teach this material.
-
November 24th, 2009, 04:18 AM
#17
Re: Bar Charts in C++?
Your teacher taught you about arithmetic operations, for loops, reading from standard input and printing text to standard output (the console window, in this case), right? That is enough to solve this problem, assuming that you apply what was taught.
-
November 24th, 2009, 06:29 AM
#18
Re: Bar Charts in C++?
Would you prefer the solution on a silver plater like this
Code:
#include <iostream>
#include <string>
int main()
{
std::string ll1l;
for(int ll(0), lll(4000),l1(0), ll1(5), l1l(100);
ll++ != ll1 && (std::cout << "Sales amount: ", std::cin >>l1);
std::cout << ll1l.append((l1 < 0 ||l1 > lll ?
(std::cout << "Try again: ", std::cin >>l1, --ll) :l1)/ l1l, '*')
<< "\n" , ll1l.clear());
}
or the way these members had been trying to guide you in the right direction?
It's your choice.
And BTW, follow this example at your own risk
Last edited by potatoCode; November 24th, 2009 at 06:56 AM.
Reason: made some adjustment
-
November 24th, 2009, 07:13 AM
#19
Re: Bar Charts in C++?
Originally Posted by potatoCode
Would you prefer the solution on a silver plater like this
Code:
#include <iostream>
#include <string>
int main()
{
std::string ll1l;
for(int ll(0), lll(4000),l1(0), ll1(5), l1l(100);
ll++ != ll1 && (std::cout << "Sales amount: ", std::cin >>l1);
std::cout << ll1l.append((l1 < 0 ||l1 > lll ?
(std::cout << "Try again: ", std::cin >>l1, --ll) :l1)/ l1l, '*')
<< "\n" , ll1l.clear());
}
or the way these members had been trying to guide you in the right direction?
It's your choice.
And BTW, follow this example at your own risk
Lol. Nice use of the comma operator. You don't see that one everyday.
-
November 24th, 2009, 08:39 AM
#20
Re: Bar Charts in C++?
PotatoCode, you made my day! Looks like Paul McKenzie has been cloned.
- Guido
-
November 24th, 2009, 11:16 AM
#21
Re: Bar Charts in C++?
Originally Posted by potatoCode
Would you prefer the solution on a silver plater like this
Code:
#include <iostream>
#include <string>
int main()
{
std::string ll1l;
for(int ll(0), lll(4000),l1(0), ll1(5), l1l(100);
ll++ != ll1 && (std::cout << "Sales amount: ", std::cin >>l1);
std::cout << ll1l.append((l1 < 0 ||l1 > lll ?
(std::cout << "Try again: ", std::cin >>l1, --ll) :l1)/ l1l, '*')
<< "\n" , ll1l.clear());
}
or the way these members had been trying to guide you in the right direction?
It's your choice.
Yes, the old "give them the obfuscated answer version" trick. I've done that a few times ...
Regards,
Paul McKenzie
-
November 24th, 2009, 03:10 PM
#22
Re: Bar Charts in C++?
@monarch_dodra:
Haha thanks. I hope I didn't break the forum rules by doing his homework
@GNiewerth:
Glad you had a good time reading it.
And I had a feeling it was done before many times
@Sabensohn70:
I'm sorry for turning this into something that I thought funny.
You can payback on my future post and I won't say a word.
And I think it's good that you consider yourself a beginner.
For the question you asked about using loop
Conditional Statement
A decent site that I think suitable for new learners like yourself.
C++ Basic Tutorial
A general reference site to get little deeper
Reference site (www.cplusplus.com)
And for the terms that are used in programming world that are not familiar to you
C++ Glossary
There are more,
but these are good sites for the beginners to get start on their independant study
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|