{"id":1745,"date":"2024-12-28T04:00:02","date_gmt":"2024-12-28T04:00:02","guid":{"rendered":"https:\/\/donhit.com\/en\/?p=1745"},"modified":"2025-02-06T01:24:02","modified_gmt":"2025-02-06T01:24:02","slug":"semester-gpa","status":"publish","type":"post","link":"https:\/\/donhit.com\/en\/calculator\/semester-gpa\/","title":{"rendered":"Semester GPA Calculator"},"content":{"rendered":"<p><center> <div class=\"container123\">\r\n        <h2>Semester GPA Calculator<\/h2>\r\n        \r\n        <div id=\"courseList\">\r\n            <!-- Course rows will be added here -->\r\n        <\/div>\r\n\r\n        <div class=\"controls\">\r\n            <button onclick=\"addCourse()\" class=\"tooltip\">\r\n                Add Course\r\n                <span class=\"tooltiptext\">Add another course to calculate<\/span>\r\n            <\/button>\r\n            <button onclick=\"calculateGPA()\" class=\"tooltip\">\r\n                Calculate GPA\r\n                <span class=\"tooltiptext\">Calculate your semester GPA<\/span>\r\n            <\/button>\r\n        <\/div>\r\n\r\n        <div class=\"result\" id=\"result\">\r\n            <h2>Your Semester GPA<\/h2>\r\n            <div class=\"gpa-value\" id=\"gpaValue\">0.00<\/div>\r\n        <\/div>\r\n    <\/div>\r\n\r\n    <script>\r\n        \/\/ Initialize the page with one course row\r\n        window.onload = function() {\r\n            addCourse();\r\n        };\r\n\r\n        function addCourse() {\r\n            const courseList = document.getElementById('courseList');\r\n            const courseRow = document.createElement('div');\r\n            courseRow.className = 'course-row';\r\n            \r\n            courseRow.innerHTML = `\r\n                <input type=\"text\" placeholder=\"Course Name\" class=\"course-name\" required>\r\n                <input type=\"number\" placeholder=\"Credits\" class=\"credits\" min=\"1\" max=\"6\" required>\r\n                <select class=\"grade\" required>\r\n                    <option value=\"\">Select Grade<\/option>\r\n                    <option value=\"4.0\">A (4.0)<\/option>\r\n                    <option value=\"3.7\">A- (3.7)<\/option>\r\n                    <option value=\"3.3\">B+ (3.3)<\/option>\r\n                    <option value=\"3.0\">B (3.0)<\/option>\r\n                    <option value=\"2.7\">B- (2.7)<\/option>\r\n                    <option value=\"2.3\">C+ (2.3)<\/option>\r\n                    <option value=\"2.0\">C (2.0)<\/option>\r\n                    <option value=\"1.7\">C- (1.7)<\/option>\r\n                    <option value=\"1.3\">D+ (1.3)<\/option>\r\n                    <option value=\"1.0\">D (1.0)<\/option>\r\n                    <option value=\"0.0\">F (0.0)<\/option>\r\n                <\/select>\r\n                <button class=\"remove-btn\" onclick=\"removeCourse(this)\">\u00d7<\/button>\r\n            `;\r\n            \r\n            courseList.appendChild(courseRow);\r\n        }\r\n\r\n        function removeCourse(btn) {\r\n            const courseList = document.getElementById('courseList');\r\n            if (courseList.children.length > 1) {\r\n                btn.parentElement.remove();\r\n            }\r\n        }\r\n\r\n        function calculateGPA() {\r\n            const courses = document.getElementsByClassName('course-row');\r\n            let totalCredits = 0;\r\n            let totalPoints = 0;\r\n            let hasError = false;\r\n\r\n            \/\/ Reset previous errors\r\n            document.querySelectorAll('.error').forEach(el => el.classList.remove('error'));\r\n\r\n            \/\/ Validate and calculate\r\n            for (let course of courses) {\r\n                const credits = course.querySelector('.credits');\r\n                const grade = course.querySelector('.grade');\r\n                const courseName = course.querySelector('.course-name');\r\n\r\n                \/\/ Validation\r\n                if (!courseName.value.trim()) {\r\n                    courseName.classList.add('error');\r\n                    hasError = true;\r\n                }\r\n                if (!credits.value || credits.value < 1 || credits.value > 6) {\r\n                    credits.classList.add('error');\r\n                    hasError = true;\r\n                }\r\n                if (!grade.value) {\r\n                    grade.classList.add('error');\r\n                    hasError = true;\r\n                }\r\n\r\n                if (!hasError) {\r\n                    const creditValue = parseFloat(credits.value);\r\n                    const gradeValue = parseFloat(grade.value);\r\n                    \r\n                    totalCredits += creditValue;\r\n                    totalPoints += (creditValue * gradeValue);\r\n                }\r\n            }\r\n\r\n            const resultDiv = document.getElementById('result');\r\n            const gpaValue = document.getElementById('gpaValue');\r\n\r\n            if (hasError) {\r\n                resultDiv.style.display = 'none';\r\n                return;\r\n            }\r\n\r\n            const gpa = totalPoints \/ totalCredits;\r\n            resultDiv.style.display = 'block';\r\n            gpaValue.textContent = gpa.toFixed(2);\r\n\r\n            \/\/ Smooth scroll to result\r\n            resultDiv.scrollIntoView({ behavior: 'smooth' });\r\n        }\r\n    <\/script><\/center><\/p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[184],"tags":[],"class_list":["post-1745","post","type-post","status-publish","format-standard","hentry","category-calculator"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Semester GPA Calculator - DonHit<\/title>\n<meta name=\"description\" content=\"A Semester GPA Calculator is an essential academic performance tool designed to help students track their grades and forecast their academic outcomes efficiently\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/donhit.com\/en\/calculator\/semester-gpa\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Semester GPA Calculator - DonHit\" \/>\n<meta property=\"og:description\" content=\"A Semester GPA Calculator is an essential academic performance tool designed to help students track their grades and forecast their academic outcomes efficiently\" \/>\n<meta property=\"og:url\" content=\"https:\/\/donhit.com\/en\/calculator\/semester-gpa\/\" \/>\n<meta property=\"og:site_name\" content=\"DonHit - World of Tools\" \/>\n<meta property=\"article:published_time\" content=\"2024-12-28T04:00:02+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-02-06T01:24:02+00:00\" \/>\n<meta name=\"author\" content=\"DonHit\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DonHit\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Semester GPA Calculator - DonHit","description":"A Semester GPA Calculator is an essential academic performance tool designed to help students track their grades and forecast their academic outcomes efficiently","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/donhit.com\/en\/calculator\/semester-gpa\/","og_locale":"en_US","og_type":"article","og_title":"Semester GPA Calculator - DonHit","og_description":"A Semester GPA Calculator is an essential academic performance tool designed to help students track their grades and forecast their academic outcomes efficiently","og_url":"https:\/\/donhit.com\/en\/calculator\/semester-gpa\/","og_site_name":"DonHit - World of Tools","article_published_time":"2024-12-28T04:00:02+00:00","article_modified_time":"2025-02-06T01:24:02+00:00","author":"DonHit","twitter_card":"summary_large_image","twitter_misc":{"Written by":"DonHit","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/donhit.com\/en\/calculator\/semester-gpa\/#article","isPartOf":{"@id":"https:\/\/donhit.com\/en\/calculator\/semester-gpa\/"},"author":{"name":"DonHit","@id":"https:\/\/donhit.com\/en\/#\/schema\/person\/0c6ff7dcd8ba4810c56a532f09c33148"},"headline":"Semester GPA Calculator","datePublished":"2024-12-28T04:00:02+00:00","dateModified":"2025-02-06T01:24:02+00:00","mainEntityOfPage":{"@id":"https:\/\/donhit.com\/en\/calculator\/semester-gpa\/"},"wordCount":9,"commentCount":0,"publisher":{"@id":"https:\/\/donhit.com\/en\/#\/schema\/person\/0c6ff7dcd8ba4810c56a532f09c33148"},"articleSection":["Calculator"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/donhit.com\/en\/calculator\/semester-gpa\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/donhit.com\/en\/calculator\/semester-gpa\/","url":"https:\/\/donhit.com\/en\/calculator\/semester-gpa\/","name":"Semester GPA Calculator - DonHit","isPartOf":{"@id":"https:\/\/donhit.com\/en\/#website"},"datePublished":"2024-12-28T04:00:02+00:00","dateModified":"2025-02-06T01:24:02+00:00","description":"A Semester GPA Calculator is an essential academic performance tool designed to help students track their grades and forecast their academic outcomes efficiently","breadcrumb":{"@id":"https:\/\/donhit.com\/en\/calculator\/semester-gpa\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/donhit.com\/en\/calculator\/semester-gpa\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/donhit.com\/en\/calculator\/semester-gpa\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Trang ch\u1ee7","item":"https:\/\/donhit.com\/en\/"},{"@type":"ListItem","position":2,"name":"Calculator","item":"https:\/\/donhit.com\/en\/category\/calculator\/"},{"@type":"ListItem","position":3,"name":"Semester GPA Calculator"}]},{"@type":"WebSite","@id":"https:\/\/donhit.com\/en\/#website","url":"https:\/\/donhit.com\/en\/","name":"DonHit - World of tools","description":"","publisher":{"@id":"https:\/\/donhit.com\/en\/#\/schema\/person\/0c6ff7dcd8ba4810c56a532f09c33148"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/donhit.com\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/donhit.com\/en\/#\/schema\/person\/0c6ff7dcd8ba4810c56a532f09c33148","name":"DonHit","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/donhit.com\/en\/#\/schema\/person\/image\/","url":"https:\/\/donhit.com\/en\/wp-content\/uploads\/2024\/11\/logo-donhit.webp","contentUrl":"https:\/\/donhit.com\/en\/wp-content\/uploads\/2024\/11\/logo-donhit.webp","width":400,"height":267,"caption":"DonHit"},"logo":{"@id":"https:\/\/donhit.com\/en\/#\/schema\/person\/image\/"},"description":"DonHit is a website designed to provide useful tools for everyone. Its primary goal is to support and empower the community. All the tools available on the site are completely free to use.","sameAs":["https:\/\/donhit.com\/en"],"url":"https:\/\/donhit.com\/en\/author\/admin_don\/"}]}},"_links":{"self":[{"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/posts\/1745","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/comments?post=1745"}],"version-history":[{"count":3,"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/posts\/1745\/revisions"}],"predecessor-version":[{"id":2033,"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/posts\/1745\/revisions\/2033"}],"wp:attachment":[{"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/media?parent=1745"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/categories?post=1745"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/tags?post=1745"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}