|
8 / 5 / 3
Регистрация: 13.02.2013
Сообщений: 294
|
||||||
Калькулятор на JS12.04.2016, 12:29. Показов 1363. Ответов 3
Метки нет (Все метки)
Доброго времени суток, подскажите пожалуйста, начал разбираться с калькулятором, делаю по примеру, подробно разоборав что куда и как, при написании кода(незаконченного)
Кликните здесь для просмотра всего текста
Вот ошибки Кликните здесь для просмотра всего текста
'pole' was used before it was defined. pole = document.calc.disp.value;
4 Expected '===' and instead saw '=='. if (pole == 0) 5 Expected exactly one space between ')' and '{'. { 8 Expected exactly one space between '}' and 'else'. else { 8 Expected 'else' at column 9, not column 5. else { 9 Expected 'document' at column 13, not column 9. document.getElementById("message").inner HTML = "Итого: " + pole; 10 Expected '}' at column 9, not column 5. } 12 Expected exactly one space between ')' and '{'. function raschet(id){//функция вывода чисел на дисплей 12 Missing space between ')' and '{'. function raschet(id){//функция вывода чисел на дисплей 13 Missing 'use strict' statement. pole = document.calc.disp.value; 13 'pole' was used before it was defined. pole = document.calc.disp.value; 14 Missing space between 'pole' and '>'. if (pole>0) 14 Missing space between '>' and '(number)'. if (pole>0) 15 Expected exactly one space between ')' and '{'. { 16 'znach' was used before it was defined. znach = pole.toString()+id.toString(); 16 Missing space between ')' and '+'. znach = pole.toString()+id.toString(); 16 Missing space between '+' and 'id'. znach = pole.toString()+id.toString(); 20 Expected exactly one space between '}' and 'else'. else 20 Expected 'else' at column 9, not column 5. else 21 Expected exactly one space between 'else' and 'document'. document.calc.disp.value = id; 21 Expected '{' and instead saw 'document'. document.calc.disp.value = id; 25 Missing 'use strict' statement. document.calc.disp.value = 0; 29 Expected exactly one space between ')' and '{'. function znak(zn){ 29 Missing space between ')' and '{'. function znak(zn){ 30 Missing 'use strict' statement. rez = Number(document.getElementById("pamyat") .value) 30 'rez' was used before it was defined. rez = Number(document.getElementById("pamyat") .value) 30 Expected ';' and instead saw 'if'. rez = Number(document.getElementById("pamyat") .value) 31 Missing space between 'value' and '=='. if (document.calc.operation.value==0) 31 Missing space between '==' and '(number)'. if (document.calc.operation.value==0) 31 Expected '===' and instead saw '=='. if (document.calc.operation.value==0) 32 Expected exactly one space between ')' and '{'. { 35 Expected exactly one space between '}' and 'else'. else { 35 Expected 'else' at column 9, not column 5. else { 36 Expected 'if' at column 13, not column 9. if (document.getElementById("operation").va lue == "+") { 36 Expected '===' and instead saw '=='. if (document.getElementById("operation").va lue == "+") { 37 Expected 'document' at column 17, not column 13. document.getElementById("pamyat").value = rez + Number(document.calc.disp.value) 37 Expected ';' and instead saw '}'. document.getElementById("pamyat").value = rez + Number(document.calc.disp.value) 38 Expected '}' at column 13, not column 9. } 39 Expected 'if' at column 13, not column 9. if (document.getElementById("operation").va lue == "-") { 39 Expected '===' and instead saw '=='. if (document.getElementById("operation").va lue == "-") { 40 Expected 'document' at column 17, not column 13. document.getElementById("pamyat").value = rez - Number(document.calc.disp.value) 40 Expected ';' and instead saw '}'. document.getElementById("pamyat").value = rez - Number(document.calc.disp.value) 41 Expected '}' at column 13, not column 9. } 42 Expected 'if' at column 13, not column 9. if (document.getElementById("operation").va lue == "/") { 42 Expected '===' and instead saw '=='. if (document.getElementById("operation").va lue == "/") { 43 Expected 'document' at column 17, not column 13. document.getElementById("pamyat").value = rez / Number(document.calc.disp.value) 43 Expected ';' and instead saw '}'. document.getElementById("pamyat").value = rez / Number(document.calc.disp.value) 44 Expected '}' at column 13, not column 9. } 45 Expected 'if' at column 13, not column 9. if (document.getElementById("operation").va lue == "*") { 45 Expected '===' and instead saw '=='. if (document.getElementById("operation").va lue == "*") { 45 Too many errors. (86% scanned). if (document.getElementById("operation").va lue == "*") {
0
|
||||||
| 12.04.2016, 12:29 | |
|
Ответы с готовыми решениями:
3
Как преобразовать обычный калькулятор в калькулятор использующий класс стек? Простой калькулятор и калькулятор с парсингом Калькулятор |
|
2 / 2 / 1
Регистрация: 22.02.2013
Сообщений: 14
|
|
| 12.04.2016, 14:59 | |
|
Можно ссылку на рабочий пример?
0
|
|
|
Superposition
950 / 615 / 256
Регистрация: 27.10.2013
Сообщений: 2,083
|
|
| 12.04.2016, 17:03 | |
|
0
|
|
|
8 / 5 / 3
Регистрация: 13.02.2013
Сообщений: 294
|
|
| 13.04.2016, 07:40 [ТС] | |
|
Да, конечно. Ссылка
Добавлено через 9 минут Padimanskas, подправил, но кол-во ошибок не сильно уменьшилось.
0
|
|
| 13.04.2016, 07:40 | |
|
Помогаю со студенческими работами здесь
4
Калькулятор на Qt Калькулятор Калькулятор Калькулятор Искать еще темы с ответами Или воспользуйтесь поиском по форуму: |
|
Новые блоги и статьи
|
|||
|
http://iceja.net/ сервер решения полиномов
iceja 18.01.2026
Выкатила http:/ / iceja. net/ сервер решения полиномов (находит действительные корни полиномов методом Штурма).
На сайте документация по API, но скажу прямо VPS слабенький и 200 000 полиномов. . .
|
Расчёт переходных процессов в цепи постоянного тока
igorrr37 16.01.2026
/ *
Дана цепь постоянного тока с R, L, C, k(ключ), U, E, J. Программа составляет систему уравнений по 1 и 2 законам
Кирхгофа, решает её и находит:
токи, напряжения и их 1 и 2 производные при t = 0;. . .
|
Восстановить юзерскрипты Greasemonkey из бэкапа браузера
damix 15.01.2026
Если восстановить из бэкапа профиль Firefox после переустановки винды, то список юзерскриптов в Greasemonkey будет пустым.
Но восстановить их можно так.
Для этого понадобится консольная утилита. . .
|
Сукцессия микоризы: основная теория в виде двух уравнений.
anaschu 11.01.2026
https:/ / rutube. ru/ video/ 7a537f578d808e67a3c6fd818a44a5c4/
|
|
WordPad для Windows 11
Jel 10.01.2026
WordPad для Windows 11
— это приложение, которое восстанавливает классический текстовый редактор WordPad в операционной системе Windows 11. После того как Microsoft исключила WordPad из. . .
|
Classic Notepad for Windows 11
Jel 10.01.2026
Old Classic Notepad for Windows 11
Приложение для Windows 11, позволяющее пользователям вернуть классическую версию текстового редактора «Блокнот» из Windows 10. Программа предоставляет более. . .
|
Почему дизайн решает?
Neotwalker 09.01.2026
В современном мире, где конкуренция за внимание потребителя достигла пика, дизайн становится мощным инструментом для успеха бренда. Это не просто красивый внешний вид продукта или сайта — это. . .
|
Модель микоризы: классовый агентный подход 3
anaschu 06.01.2026
aa0a7f55b50dd51c5ec569d2d10c54f6/
O1rJuneU_ls
https:/ / vkvideo. ru/ video-115721503_456239114
|