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]
3 years ago
5

Create a simple JavaScript calculator.

Computers and Technology
1 answer:
Gre4nikov [31]3 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
A new repair technician reports that he or she is having trouble installing the operating system. The problem arises when he or
Ganezh [65]

Answer:

The cause of the problem is he attempted to put system files on a extended partition.

Explanation:

A extended partition is a type of file system used by the linux kernel operating system, usually most of windows OS doesn't recognize this as an operative partition and if it does, the type of files are going to be in conflict with the partition "structure". Usually a ext partition has a small size in relation with a FAT or NTFS partition, that added to the file type would be the main issue for the repair technician. The main objetive to this partition is to emulate a RAM memory and allow the fast interchange of data to the processor.

The other options:   put system files on a primary partition, partition the hard drive into one large section or partition the hard drive into four smaller sections SHOULD NOT BE A PROBLEM to make a normal operative system install.

8 0
3 years ago
Read 2 more answers
Why can a "group by" or "order by" clause be expensive to process? What is the difference between a where and having clause?
Zielflug [23.3K]

Answer and Explanation:

Group by clause bunches every one of the information coming back from the question in the predetermined gatherings.  

Order by clause will arrange the information either in rising  or in dropping order depending on the section data or column data.  

It is certainly a lengthy from execution perspective.  

Envision that the quantity of columns returned by the question are millions and gathering and arranging information from this parcel takes bigger execution time.  

The procedure is a lot of equivalent to on the off chance that you are approached to arrange the precisely coordinating names in a populace measurements, it requires colossal measure of handling time to make sense of the precisely coordinating names and after that arranging them as needs be.

The distinction between where and having clause:

'Where' and having clause in SQL are utilized to indicate separating conditions.  

There is a little contrast between these two clause and is given as under:  

WHERE clause is utilized while getting data (lines or rows) from the table, and the information which clears the condition will only be considered into  the result set.

HAVING clause is later utilized to channel a data summary or gathered data.  

On the off chance that the two clauses show up in SQL question, where clause will execute at first and afterward having clause is executed on the groups that returns the group clause.

8 0
4 years ago
when applying styles to a document, which features of the style can be modified in the themes grouping?
Debora [2.8K]

colors

fonts

effects

Those 3 would be the answers :) Good Luck!

8 0
3 years ago
Read 2 more answers
Value or power of a network grows exponentially as a function of the number of network members. this is known as ________ law.
mel-nik [20]
Value or power of a network grows exponentially as a function of the number of network members. this is known as Metcalfe's law. According to this law <span>the value (the power) of a </span>telecommunications network<span> is </span>proportional to the square of the number of connected users of the system (network members). Metcalfe's Law <span>characterizes many of the </span>network effects<span> of communication technologies and networks such as the </span>Internet<span>, </span>social networking<span> and the </span>World Wide Web<span>.</span> 
6 0
3 years ago
Introduction or background of corporal punishment in schools
tensa zangetsu [6.8K]

Answer:

Corporal punishment is a discipline method in which a supervising adult, such as a teacher, deliberately inflicts pain upon a child in response to a child's unacceptable behavior or inappropriate language. The goals of this type of punishment are usually to halt the offense immediately, prevent it from happening again, and set an example for others.

3 0
3 years ago
Other questions:
  • How many times is "Alert" displayed in the following loop? for (int k =0; k&lt;= 100; k++) cout &lt;&lt; "Alert"; O 101 0 1 oo О
    7·1 answer
  • Why should you stay out of the open space to the right of a semi-tractor-trailer?
    7·2 answers
  • If someone receives a shock, or a piece of equipment is throwing sparks or arcing you should try to pull them away from the sour
    7·1 answer
  • Which of the following is where you can save, select a template, change document properties, and close or exit excel?
    8·1 answer
  • Which of the following correctly pairs a financing option with its description?
    14·2 answers
  • How does knowing the player type you are impact your game designing?
    6·1 answer
  • A student that earns a well qualified score on an ap exam would receive a ___
    13·1 answer
  • 7.3 A hydraulic lift has a mechanical advantage of 6. If the load weighs 780 N, calculate
    13·1 answer
  • How do cybercriminals use JavaScript maliciously?
    11·1 answer
  • Say true or false. a)ICT in education is used as teaching learning aid
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!