RE: SLC21 Week1 - Learn more about variable types. Subroutines. Practice problems.

You are viewing a single comment's thread from:

SLC21 Week1 - Learn more about variable types. Subroutines. Practice problems.

in slc21w1sergeyk •  20 days ago 
Task Comment Grade
1) Come up with your own example similar to `float f=7/2;` that illustrates the loss (distortion) of value during division. Show how to fix it. Explain why this happens and how you fixed it. `float a=5.0; int b=2;` so it cannot be solved. Of course, when you write your own code, you can do that. But if the variables `a` and `b` came from outside, and you cannot change it - what then? 0.4/1
2) Choose a data type independently and illustrate the limitations of its range This use of c++ will frighten those beginners learning programming))) - I am talking about static_cast)) 1/1
3) Find your own example of `0.1!=0.1` it should have been explained using your own example, i.e. find your values ​​for suma (which is quite easy) and you should have demonstrated that 0.1+0.2!=0.3, and your program says that they are equal 0.3/1
4) sum of the digits OR sum of sum OR specified digit in a number one task of choice could be completed 1/1
5) find the largest of two(3,4..) numbers (if) it was not worth going all the way to seven)) you should have stopped as soon as it became clear that with the increase in the number you have to invent something else 0.8/1
6) find the largest of two(3,4..) numbers ( ? : ) here, too, it was not worth going all the way to seven)) but in this code, unlike the previous one, there is a logical error - it will not always give the correct result. You will find in the next class where I will explain it. 0.3/1
7) find the largest of two(3,4..) numbers (func()) using the function everything is done correctly 1/1
8) print_div(number), sum_div(number), perfect numbers all these functions can be made to run much faster - think how 2.4/3
Total: the images presented are of very low quality, it is difficult for me to understand what is written(( 7.2/10
Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!