Question
can anyone help me? with my hwk h06 dont know what im doing wrong? the pdf instruction are down below starting at pg 15 http://faculty.orangecoastcollege.edu/sgilbert/books/f17/Ch04-MoreStringsAndLoops.pdf
can anyone help me? with my hwk h06 dont know what im doing wrong? the pdf instruction are down below starting at pg 15
http://faculty.orangecoastcollege.edu/sgilbert/books/f17/Ch04-MoreStringsAndLoops.pdf
or
https://drive.google.com/file/d/0BzDKOi5LNlDhb2JVaUZZVDFwV0E/view?usp=sharing
-------------------------------------------------------------------------
int run()
{
/*
Describe the inputs: enter a string
outputs: the sum of the string.
and calculations here.
*/
// 1. Title and heading
cout
cout
// 2. Input section
cout
string str;
getline(cin, str);
// 3. Processing section
int sum = 0;
int num = 0;
// Your code goes here
//before the loop
for (size_t i = 0, len = str.size(); i
{
//inside the loop
if(str.at(i) >= '0' && str.at(i)
{
int counter = str[i] - '0';
num = num * 10 + counter - num;
sum += num;
}
else
{
num = 0;
}
}
// 4. Output section
cout
return 0;
}
TESTING H06--soctavio + Input of aa11b33->44 X Input of we69a9es61449: expected [533] but found [497] +Input of a7rg65h8duwchdnb15->158 Input of yl39x->39 + Input of 7 11-18 +Input of d36->36 X Input of ut80k770: expected [850] but found [787] X Input of a1234bb11: expected [1245] but found [1047] +Input of 5hocolale->7 + Input of t5k2z2nov016-15 X Input of ws569o85oqwrp75om1: expected [730] but found [685] +Input of 9y4h4->17 +Input of 4p->4 X Input of 71f1mlz4247wb: expected [4319] but found [3581] +Input of a->0 H06: soctavio : ALL TESTS-PASS 10/ 15 (67%). MTUWNTM4NDE2Nzpzb2N0YXZpbzpIMDY6Nj YuNj cl ~/workspace/cs150/hw/h06/
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started