1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
777dan777 [17]
2 years ago
5

Create a simple JavaScript calculator.

Computers and Technology
1 answer:
Gre4nikov [31]2 years ago
3 0

Answer: edit out anything you dont need

<!DOCTYPE html>  

<html lang = "en">  

<head>  

<title> JavaScript Calculator </title>  

 

<style>  

h1 {  

   text-align: center;  

   padding: 23px;  

   background-color: skyblue;  

   color: white;  

   }  

 

#clear{  

width: 270px;  

border: 3px solid gray;  

   border-radius: 3px;  

   padding: 20px;  

   background-color: red;  

}  

 

.formstyle  

{  

width: 300px;  

height: 530px;  

margin: auto;  

border: 3px solid skyblue;  

border-radius: 5px;  

padding: 20px;  

}  

 

 

 

input  

{  

width: 20px;  

background-color: green;  

color: white;  

border: 3px solid gray;  

   border-radius: 5px;  

   padding: 26px;  

   margin: 5px;  

   font-size: 15px;  

}  

 

 

#calc{  

width: 250px;  

border: 5px solid black;  

   border-radius: 3px;  

   padding: 20px;  

   margin: auto;  

}  

 

</style>  

 

</head>  

<body>  

<h1> Calculator Program in JavaScript </h1>  

<div class= "formstyle">  

<form name = "form1">  

     

   <!-- This input box shows the button pressed by the user in calculator. -->  

 <input id = "calc" type ="text" name = "answer"> <br> <br>  

 <!-- Display the calculator button on the screen. -->  

 <!-- onclick() function display the number prsses by the user. -->  

 <input type = "button" value = "1" onclick = "form1.answer.value += '1' ">  

 <input type = "button" value = "2" onclick = "form1.answer.value += '2' ">  

 <input type = "button" value = "3" onclick = "form1.answer.value += '3' ">  

  <input type = "button" value = "+" onclick = "form1.answer.value += '+' ">  

 <br> <br>  

   

 <input type = "button" value = "4" onclick = "form1.answer.value += '4' ">  

 <input type = "button" value = "5" onclick = "form1.answer.value += '5' ">  

 <input type = "button" value = "6" onclick = "form1.answer.value += '6' ">  

 <input type = "button" value = "-" onclick = "form1.answer.value += '-' ">  

 <br> <br>  

   

 <input type = "button" value = "7" onclick = "form1.answer.value += '7' ">  

 <input type = "button" value = "8" onclick = "form1.answer.value += '8' ">  

 <input type = "button" value = "9" onclick = "form1.answer.value += '9' ">  

 <input type = "button" value = "*" onclick = "form1.answer.value += '*' ">  

 <br> <br>  

   

   

 <input type = "button" value = "/" onclick = "form1.answer.value += '/' ">  

 <input type = "button" value = "0" onclick = "form1.answer.value += '0' ">  

   <input type = "button" value = "." onclick = "form1.answer.value += '.' ">  

   <!-- When we click on the '=' button, the onclick() shows the sum results on the calculator screen. -->  

 <input type = "button" value = "=" onclick = "form1.answer.value = eval(form1.answer.value) ">  

 <br>  

 <!-- Display the Cancel button and erase all data entered by the user. -->  

 <input type = "button" value = "Clear All" onclick = "form1.answer.value = ' ' " id= "clear" >  

 <br>  

   

</form>  

</div>  

</body>  

</html>  

Explanation:

You might be interested in
Which option correctly describes a DBMS application? A. software used to manage databases B. software used to organize files and
ahrayia [7]
The answer is A.
It's a software used to manage databases


DBMS stands for DataBase Management System
4 0
3 years ago
Read 2 more answers
Which is true about TCP and UDP? Choose two answers.
vichka [17]

Answer:

TCP is a connection-oriented protocol

UDP does not acknowledge a receipt of data

Explanation:

TCP (Transmission Control Protocol) is a protocol to transfer data, this is one of the most important protocols on the entire internet, this method was implemented from the beginning of the network.

UDP (User Datagram Protocol) this is a protocol faster than TCP because this method doesn't establish a connection to sent data, in this case, always sent data, but TCP is more secure than UDP, and for that UDP is used to transfer music or videos, and TCP websites and database.

UDP doesn't need acknowledgment is done by UDP, is only concerned with speed.

7 0
3 years ago
Weber believed that there is an inevitable destructive quality to which one of the four types of action?
weqwewe [10]

Answer:

instrumental-rational                                        

Explanation:

  • A sociologist Max Weber interpreted the effects of Industrial Revolution on social actions. He described the four types of social actions:

                     Traditional Social Action

                      Affective/Affectional Social Action

                     Value Rational Social Action

                  Instrumental-Rational  Social Action

  • Instrumental-rational means to pursue most efficient means to achieve a specific goal.
  • The goals of the actions are also used as a way of achieving certain objectives.
  • So instrumental rational means doing anything it takes to reach a certain goal that does not take into account the consequences of the actions taken to achieve this goal.  
  • For example an organization's goal is to make maximize profit so it will use most effective and economical means to achieve this goal. For example by decreasing workers not considering the affects on the workers of this action.
  • Another example is of a person who wants to gain money. He might rob others or sell drugs etc to get money. A student whose goal is to pass an exam in order to get a degree will give his time to study and might cheat in exam to pass the test.
  • In short any actions can be taken which leads to the achievement of  a certain goal.
  • According to Weber instrumental rationality is destructive because rather than pursuing means and making decisions by taking moral values into consideration, the basic focus is to achieve a goal and make decisions using efficiency not considering moral values.
8 0
3 years ago
Write a 20 charecter poem! for points! :)
umka21 [38]
The sky was blue
Glistening clouds in the air
For the little boy had no clue
His mother sat him down on the warm chair

There’s some great news
Hitler took over
And they killed off the Jews
The little boy just wanted to show mom his 4 leaf clover
7 0
2 years ago
Read 2 more answers
In C++ we can print message for the user in Arabic?<br><br> A. True<br> B. False
Lynna [10]

Answer:

A

Explanation:

8 0
3 years ago
Other questions:
  • Create a class named Person that holds the following fields: two String objects for the person’s first and last name and a Local
    5·2 answers
  • Cleaning the keyboard is the most important part of keeping your computer running at peak performance.
    5·2 answers
  • A __________ network is good for connecting computers over boundaries.
    6·2 answers
  • A file named data.txt contains an unknown number of lines, each consisting of a single integer. Write some code that creates two
    14·2 answers
  • Match each vocabulary word to its definition.
    11·2 answers
  • Design and implement an application that reads a sequence of up to 25 pairs of names and postal (ZIP) codes for individuals. Sto
    9·1 answer
  • Which type of error occurred in the following lines of code?
    13·1 answer
  • What is a field on a table
    13·1 answer
  • What bonnie is this? From five night at freddys
    9·1 answer
  • Write a program to calculate sum of first ten natural numbers​
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!