gpt-3.5-turbo-0613· openai
Suzhen/CodeChat
create the HTML code to calculate IELTS score based on this site code…
- User
create the HTML code to calculate IELTS score based on this site code https://manaimmigration.com/tools/clb-score-calculator/
- Assistant
Sure! Here is an example of HTML code to create a basic IELTS score calculator based on the design of the website you mentioned:
<!DOCTYPE html> <html> <head> <title>IELTS Score Calculator</title> <style> body { font-family: Arial, sans-serif; } .container { max-width: 400px; margin: 0 auto; } h1 { text-align: center; } label { display: block; margin-bottom: 10px; } input[type="number"] { width: 100%; padding: 5px; font-size: 16px; } button { padding: 10px; font-size: 16px; } .result { margin-top: 20px; padding: 10px; border: 1px solid #ccc; background-color: #f9f9f9; } </style> <script> function calculateScore() { var listening = parseFloat(document.getElementById("listening").value); var reading = parseFloat(document.getElementById("reading").value); var writing = parseFloat(document.getElementById("writing").value); var speaking = parseFloat(document.getElementById("speaking").value); var totalScore = listening + reading + writing + speaking; var bandScore = 0; if (totalScore < 4) { bandScore = 0; } else if (totalScore >= 4 && totalScore <= 4.5) { bandScore = 4; } else if (totalScore >= 5 && totalScore <= 5.5) { bandScore = 5; } else if (totalScore >= 6 && totalScore <= 6.5) { bandScore = 6; } else if (totalScore >= 7 && totalScore <= 7.5) { bandScore = 7; } else if (totalScore >= 8 && totalScore <= 8.5) { bandScore = 8; } else if (totalScore >= 9) { bandScore = 9; } document.getElementById("result").innerHTML = "Your IELTS Band Score: " + bandScore; } </script> </head> <body> <div class="container"> <h1>IELTS Score Calculator</h1> <form> <label for="listening">Listening score:</label> <input type="number" id="listening" step="0.5" min="0" max="9" required> <label for="reading">Reading score:</label> <input type="number" id="reading" step="0.5" min="0" max="9" required> <label for="writing">Writing score:</label> <input type="number" id="writing" step="0.5" min="0" max="9" required> <label for="speaking">Speaking score:</label> <input type="number" id="speaking" step="0.5" min="0" max="9" required> <button type="button" onclick="calculateScore()">Calculate</button> </form> <div class="result" id="result"></div> </div> </body> </html>This code includes a basic form with four input fields for listening, reading, writing, and speaking scores. The
calculateScorefunction calculates the total score and determines the band score based on the given scores. The result is then displayed in the result div.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.