- 1

Why does the button doesn't work correctly?

Explanation: This code is to calculate what mark will you get in an exam (Selectividad) by putting the marks that you are going to have (approximately) 1. Put the marks of each subject and click ENVIA 2. Click CALCULA to calculate the marks How are calculated? The first mark is already calculated in the variable "notaBat", with this one I don't have any problem. The second mark is calculated by multiplying the first mark ("notaBat")*0,6 and adding the average of the 5 first marks you put (the ones below "FASE GENERAL")*0,4 The third mark is calculated by adding the two highest marks you put below "FASE ESPECÍFICA"*0,2 I think that it doesn't work because of a problem with the operations with variables. Can someone help me?? https://code.sololearn.com/WkFdIbvCKxd3/?ref=app https://code.sololearn.com/WkFdIbvCKxd3/?ref=app

21st Feb 2020, 6:13 PM
Miquel
1 Odpowiedź
0
You need to use parseFloat when you read a number as string and you want to use it in arithmetic operations. Here is your code with my corrections. https://code.sololearn.com/WzulM0hI2z04/?ref=app
22nd Feb 2020, 5:55 PM
Gabriel Ilie
Gabriel Ilie - avatar