+ 2
Hotel Prices problem does not resolve
https://code.sololearn.com/cnBd3MgpHAMj/?ref=app The sample solution as visualized by me does not indicate solved status. Could someone point out why ?
8 ответов
+ 6
Sanjay Kamath ,
the code is not complete.
> this is the task description:
You are given an array that represents house prices.
Calculate and output the percentage of houses that are within one standard deviation from the mean.
To calculate the percentage, divide the number of houses that satisfy the condition by the total number of houses, and multiply the result by 100.
> the current code just calculates and uses the mean, but not the standard deviation for getting the final result.
read the task description carefully.
+ 5
Sanjay Kamath ,
no - i can not give you the solition, since i am sure you can do it by yourself.
read my comments in the attached file:
https://code.sololearn.com/c9bZ6GwcX49G/?ref=app
+ 4
Sanjay Kamath ,
the calculated values for *mean* and *standard deviation* are ok. but the rest of the code is not doing the required steps to get the final result.
*AND* - the formatting of the code and the variable names are slightly horrable. we should use meaningful variable names.
let me try to describe the steps we need to do for solving the task.
(1) we need to calculate the mean that is required in a later step [done]
(2) we need to calclate the standard deviation [done]
(3) now we have to get 2 values that are a *kind of span* starting from the mean value.
lower bound use: mean - standard deviation.
upper bound use: mean + standard deviation.
(4) now we have to find the number of all house prices that are inside the *span* defined in (3)
(5) finally we have to calculate the percentage of these houses from step (4) compared to
the total numer of houses.
+ 1
What's the task?
Can you add it?
+ 1
https://code.sololearn.com/cL321f3JuG66/?ref=app
Still not solved.
+ 1
Lothar https://code.sololearn.com/cQ24Otzouppb/?ref=app
Format is OK but answer is not correct.....
Any guesses?
+ 1
Sanjay Kamath you have an array "li" but for what?
0
Can you please give me the solution? Viz answer for reverse engineering