updating the variable inside for loop

Try this. I think you should recalculate the total money. Because number of shops is 21, is correct. Please recalculate total money; it can never be 210000. public class investmentCalculation { private int income; private int shop; private int firstMoney; private int totalMoney1; private int shopsAdded; public investmentCalculation() { income = 10000; shop = 3; … Read more

Lowercase letters that did not appear in the array, in order [closed]

We, beginners, should help each other. If the function deals with strings then the second parameter of the function is redundant. A straightforward approach without using standard containers as for example std::set can look the following way #include <iostream> void missing( const char s[] ) { const char *letter = “abcdefghijklmnopqrstuvwxyz”; for ( size_t i … Read more