{"id":102,"date":"2025-11-14T14:11:45","date_gmt":"2025-11-14T14:11:45","guid":{"rendered":"https:\/\/sites.wp.odu.edu\/carterhendrick-eportfolio\/?p=102"},"modified":"2025-11-14T14:11:59","modified_gmt":"2025-11-14T14:11:59","slug":"student-test-grade-program","status":"publish","type":"post","link":"https:\/\/sites.wp.odu.edu\/carterhendrick-eportfolio\/2025\/11\/14\/student-test-grade-program\/","title":{"rendered":"Student Test Grade Program"},"content":{"rendered":"\n<p>\/*<br>IT205 Intro to Object Oriented Programming<br>Programmer: Carter Hendrick<br>Date: October 24, 2025<br>Pledge: This program is entirely written by me (Carter Hendrick) without help from anyone except starter program<br>Starter program for Module2 program assignment.<br>You may modify this program for your submission<\/p>\n\n\n\n<p>notes:<br>syntax of a static method (method definition)<br>accessModifier static returntype methodName(formal parameter list){body}<\/p>\n\n\n\n<p>syntax of formal paramter list: datatype par1,datatype para2,\u2026.<\/p>\n\n\n\n<p>method call is always methodName(arguments)<\/p>\n\n\n\n<p>syntax for arguments is var1, var2,\u2026<\/p>\n\n\n\n<p>important: cannot have a method definition within other method definitions<br>*\/<br>package module2_assignment_carterhendrick;<br>import java.util.Scanner;<\/p>\n\n\n\n<p>public class Module2 {<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>public static void main(String&#091;] args) {\n    \/\/ write program here here\n    \/\/calling header method here\n    headerMethod();\n\n    \/\/declare variables here\n    String firstName;\n    String LastName;\n    String letterGrade = null;\n    String Exit = null;\n    double score1;\n    double score2;\n    double score3;\n    double TotalScore;\n    double scoreAverage;\n\n    Scanner input = new Scanner(System.in);\n\n    System.out.print(\"Press Enter or type exit to quit: \");\n    Exit = input.nextLine();\n\n    \/\/start while loop here\n  while (!\"exit\".equalsIgnoreCase(Exit)){\n\n    \/\/call the getNameMethod\n    firstName = getfirstNameMethod();\n    LastName = getlastNameMethod();\n\n    \/\/call the scores method 3 times\n    score1 = gettestscoremethod();\n    score2 = gettestscoremethod();\n    score3 = gettestscoremethod();\n\n    \/\/call the total method\n    TotalScore = getTotalTestScoreMethod(score1, score2, score3);\n\n    \/\/call the average method\n    scoreAverage = getTestAverageMethod(TotalScore);\n\n    \/\/call the lettergrade method\n    letterGrade = getLetterGradeMethod(scoreAverage, letterGrade);\n\n    \/\/call the output method\n    outputMethod(firstName, LastName, score1, score2, score3, TotalScore, scoreAverage, letterGrade);\n\n    \/\/ask and read if they want another student\n\n    System.out.printf(\"%-15s%15s%n\", \"Full Name\", firstName + \" \" + LastName);\/\/goes into the output method\n\n     System.out.print(\"Press Enter or type exit to quit: \");\n    Exit = input.nextLine();\n\n  }\/\/end of while loop\n\n}\/\/end of main\n\n\/\/******************************************\n\/\/void method without parameters\n\npublic static void headerMethod(){\n    System.out.println(\"**********************************************\");\n    System.out.println(\"* IT205 Intro to Object Oriented Programming *\");\n    System.out.println(\"* Programmer: Carter Hendrick                *\");\n    System.out.println(\"* Date: October 24, 2025                     *\");\n    System.out.println(\"**********************************************\");\n\n\n}\/\/end of headerMethod\n\n\/\/**********************************************************************\n\/\/value returning method without parameters\n\/\/prompt, read, and return full name\n\npublic static String getfirstNameMethod(){\n    \/\/declare variables\n    Scanner input = new Scanner(System.in);\n    String someName;\n\n    \/\/prompt and read full name\n    System.out.print(\"Enter your first name: \");\n    someName = input.nextLine();\n\n    \/\/return the name\n    return someName;\n\n\n}\/\/end getfirstnamemethod\n \/\/**********************************************************************\n\/\/value returning method without parameters\n\/\/prompt, read, and return full name\n\npublic static String getlastNameMethod(){\n    \/\/declare variables\n    Scanner input = new Scanner(System.in);\n    String someName;\n\n    \/\/prompt and read full name\n    System.out.print(\"Enter your last name: \");\n    someName = input.nextLine();\n\n    \/\/return the name\n    return someName;\n\n\n}\/\/end getlastnamemethod\n\/\/*****************************************************************\n\/\/method to prompt and read a score -call this method 3 times from main\npublic static double gettestscoremethod(){\n\n    \/\/declare variables\n    Scanner input = new Scanner(System.in);\n    double Score;\n\n    \/\/prompt and read test score\nSystem.out.printf(\"%s\",\"Enter the students test score: \");\n    Score = input.nextDouble(); \/\/input first test score\n\n    return Score;<\/code><\/pre>\n\n\n\n<p>}<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/method to calculate the total value returning with 3 parameters\npublic static double getTotalTestScoreMethod(double score1, double score2, double score3){\n\n    \/\/Declare Variables\n    double TotalScore;\n\n    TotalScore = score1 + score2 + score3;\n\n    return TotalScore;\n}\n\n\/\/method to calculate the average value returning with 1 parameters\npublic static double getTestAverageMethod(double TotalScore){\n\n    double scoreAverage;\n\n    scoreAverage = TotalScore\/3;\n\n    return scoreAverage;\n}\n\/\/method to calculate the letter grade value returning with 1 parameters\npublic static String getLetterGradeMethod(double scoreAverage, String letterGrade) {\n\n     if (scoreAverage &gt;= 90) \/\/If statement for assigning letter grade to test score\n            { \n                letterGrade = \"A\" ;\n            } else if (scoreAverage &gt;= 80){\n                letterGrade = \"B\";\n            } else if (scoreAverage &gt;= 70) {\n                letterGrade = \"C\";\n            } else {\n                letterGrade = \"F\";\n            }\n     return letterGrade;\n}\n\n\/\/output method for formatted results void method with name, total, average, and letter grade parameters\npublic static void outputMethod(String firstName, String LastName,double score1, double score2, double score3, double TotalScore, double scoreAverage, String letterGrade){\n           System.out.printf(\"%s%n%s%n%s%n%s%n%s%n%s%n%s%n%s%n%s%n%s%n\", \/\/Display the students name and their average test score\n            \"The students first name is: \" + firstName, \n            \"The Students last name is: \" + LastName, \n            \"The students test scores are: \", score1, score2, score3,\n            \"The students total score number is: \", TotalScore,\n                     \"Their average test score is: \" + scoreAverage,\n                     \"The students Letter grade is: \" + letterGrade); \n}<\/code><\/pre>\n\n\n\n<p>}\/\/end of module2<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\/*IT205 Intro to Object Oriented ProgrammingProgrammer: Carter HendrickDate: October 24, 2025Pledge: This program is entirely written by me (Carter Hendrick) without help from anyone except starter programStarter program for Module2 program assignment.You may modify this program for your submission notes:syntax of a static method (method definition)accessModifier static returntype methodName(formal parameter list){body} syntax of formal paramter &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"https:\/\/sites.wp.odu.edu\/carterhendrick-eportfolio\/2025\/11\/14\/student-test-grade-program\/\">Continue reading<\/a><\/p>\n","protected":false},"author":25850,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","wds_primary_category":1},"categories":[9],"tags":[],"_links":{"self":[{"href":"https:\/\/sites.wp.odu.edu\/carterhendrick-eportfolio\/wp-json\/wp\/v2\/posts\/102"}],"collection":[{"href":"https:\/\/sites.wp.odu.edu\/carterhendrick-eportfolio\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sites.wp.odu.edu\/carterhendrick-eportfolio\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sites.wp.odu.edu\/carterhendrick-eportfolio\/wp-json\/wp\/v2\/users\/25850"}],"replies":[{"embeddable":true,"href":"https:\/\/sites.wp.odu.edu\/carterhendrick-eportfolio\/wp-json\/wp\/v2\/comments?post=102"}],"version-history":[{"count":3,"href":"https:\/\/sites.wp.odu.edu\/carterhendrick-eportfolio\/wp-json\/wp\/v2\/posts\/102\/revisions"}],"predecessor-version":[{"id":105,"href":"https:\/\/sites.wp.odu.edu\/carterhendrick-eportfolio\/wp-json\/wp\/v2\/posts\/102\/revisions\/105"}],"wp:attachment":[{"href":"https:\/\/sites.wp.odu.edu\/carterhendrick-eportfolio\/wp-json\/wp\/v2\/media?parent=102"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sites.wp.odu.edu\/carterhendrick-eportfolio\/wp-json\/wp\/v2\/categories?post=102"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sites.wp.odu.edu\/carterhendrick-eportfolio\/wp-json\/wp\/v2\/tags?post=102"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}