0
Need help guys!
need help, I need c++ code and flowchart for my computer programming subj. Create a flowchart that prompts a user for a number and prints the number after adding 10 to it. The flowchart will repeat this process until the user enters 0 (zero). Be sure to handle the case where the user enters 0 the first time. Code the resulting flowchart. I hope you guys help me. Early thank you!
8 Antworten
+ 6
Hi Shyna, and welcome to SoloLearn! As you may have noticed, this platform is for learning to code on your own, but with the added community support feature for when you get stuck while writing your codes. This is not a platform to get free homework answers without any effort. So to receive an answer, you should make an attempt at writing your code, then, post your code along with a question in regards to whatever difficulty or road block you may be facing in your code. Asking for someone to complete your homework for you without any effort on your part is the equivalent of cheating, and won't benefit you at all in your coding career or later classes. So please do give it a try, and if you get stuck at some point, then feel free to ask a question regarding that. Please have a quick look through the guidelines, and happy coding!
https://www.sololearn.com/discuss/1316935/?ref=app
+ 4
Thanks Anthony Quick for tagging.
Let me give you tools for drawing flowchart first :
For drawing flowchart with JavaScript, we can use mermaid.js
https://code.sololearn.com/WNukd09b2Lrd/?ref=app
Alternatively, you can sign up at online tool such as Smartdraw
https://www.smartdraw.com/flowchart/flowchart-programming.htm
Third way is to download free software such as Dia on your computer
http://dia-installer.de/
+ 2
Gordon maybe you could have a look here?
+ 2
Allen Rodriguez
#include <iostream>
using namespace std;
int main()
{
int inp=0;
do{
cout << "Enter number, 0 to quit.\n";
cin >> inp;
cout<<(inp+10);
cout<<"\n";
}
while(inp!=0);
return 0;
}
+ 1
Thank you for the remind sir and sorry for the same time. It's just I cannot understand the problem itself. I just know that I need to make a loop one.
Maybe you can explain to me what the problem means. Then I'll try to make a program po :)
+ 1
#include <iostream>
using namespace std;
int main()
{
int a,b,c=0,ch=0;
while(ch==0){
cin >> a;
if(a==0 && c>0){
ch+=1;
}else{
b = a + 10;
cout<<b;
cout<<"\n";
c+=1;
}
}
return 0;
}
is this right?
0
Louis
I used your code but when I input 0 in the first time, the terminal will stop. The instruction said that when the user input 0 in the first time it will not stop but in the second time it will.
But then, thank you for your help. God blesss!
0
1. For flow of a program, it must have a start and an end. (round-bordered, as in flowchart)
In flowchart, use rectangle for process, use rhombus for logic gate. This is shape usage:
https://wcs.smartdraw.com/flowchart/img/basic-symbols.jpg?bn=1510011154
2. And because you need to repeat, you need to form a closed loop in your flow.
Here is a while loop flowchart:
https://beginnersbook.com/wp-content/uploads/2017/09/while_loop_C.jpg
3. and because you just added that the process must for at least one time. Use do-while loop as Louis demonstrates,
Generic do-while flowchart :
https://secureservercdn.net/160.153.138.219/b79.d22.myftpupload.com/wp-content/uploads/2017/09/do-while-loop-flowchart.png
4. For input output, use parallelogram.
Specific do-while loop flowchart example :
https://www.tenouk.com/clabworksheet/labworksheet7_files/cdowhileflowchart113.png