Skip to content

armgit / dspy

Public Imported from GitHub
0

DSPy: The framework for programming—not prompting—language models

Python

fix(dspy): PR feedback : fixing typos and dataset loading from external source

williambrach7999668b79dd
diff --git a/examples/multi-input-output/beginner-multi-input-output.ipynb b/examples/multi-input-output/beginner-multi-input-output.ipynb
index bec090bf2..dbd18845c 100644
--- a/examples/multi-input-output/beginner-multi-input-output.ipynb
+++ b/examples/multi-input-output/beginner-multi-input-output.ipynb
@@ -24,7 +24,7 @@
"- Multiple inputs and outputs\n",
"- Double validation techniques\n",
"\n",
- "I strongly recommend to read the [DSPy Cheatsheet](https://dspy-docs.vercel.app/docs/cheatsheet) it will help you with quick start.\n",
+ "I strongly recommend reading the [DSPy Cheatsheet](https://dspy-docs.vercel.app/docs/cheatsheet) it will help you with quick start.\n",
"\n",
"## How to Start?\n",
"\n",
@@ -48,7 +48,7 @@
" - We are working with a dataset from the publication: [Source Code Plagiarism Detection in Academia with Information Retrieval: Dataset and the Observation](https://github.com/oscarkarnalim/sourcecodeplagiarismdataset/blob/master/IR-Plag-Dataset.zip)\n",
" - We selected a subset and manually labeled the dataset with our output labels. This dataset should be used for training and testing, while the rest of the original dataset should be used for evaluation.\n",
" - Dataset: [train.csv](/data/train.tsv) (65 samples)\n",
- " - When you don't hae labeled dataset, it is good idea to try hand-labeling a few examples to get a sense of the task. It will help you to understand the task better and also increse the quality of program.\n",
+ " - When you don't have labeled dataset, it is good idea to try hand-labeling a few examples to get a sense of the task. It will help you to understand the task better and also increase the quality of program.\n",
"\n",
"5. **Define your metric**\n",
" - We are dealing with a **classification problem**, so we will use accuracy as our main metric. \n",
@@ -72,7 +72,7 @@
},
{
"cell_type": "code",
- "execution_count": 24,
+ "execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
@@ -124,7 +124,7 @@
},
{
"cell_type": "code",
- "execution_count": 25,
+ "execution_count": 5,
"metadata": {},
"outputs": [
{
@@ -148,6 +148,8 @@
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
+ " <th>L</th>\n",
+ " <th>case</th>\n",
" <th>sample_1</th>\n",
" <th>sample_2</th>\n",
" <th>plagiarized</th>\n",
@@ -157,6 +159,8 @@
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
+ " <td>0</td>\n",
+ " <td>1</td>\n",
" <td>public class T1 { public static void main(Str...</td>\n",
" <td>/* * To change this license header, choose Li...</td>\n",
" <td>False</td>\n",
@@ -164,6 +168,8 @@
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
+ " <td>0</td>\n",
+ " <td>1</td>\n",
" <td>public class T1 { public static void main(Str...</td>\n",
" <td>/** * * @author 65FBEF05E01FAC390CB3FA073FB3...</td>\n",
" <td>False</td>\n",
@@ -171,6 +177,8 @@
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
+ " <td>0</td>\n",
+ " <td>1</td>\n",
" <td>public class T1 { public static void main(Str...</td>\n",
" <td>/** * * @author CB6AB3315634A1E4D11B091BA48B...</td>\n",
" <td>False</td>\n",
@@ -178,6 +186,8 @@
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
+ " <td>1</td>\n",
+ " <td>1</td>\n",
" <td>public class T1 { public static void main(Str...</td>\n",
" <td>* * To change this license header, choose Lice...</td>\n",
" <td>True</td>\n",
@@ -185,6 +195,8 @@
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
+ " <td>2</td>\n",
+ " <td>1</td>\n",
" <td>public class T1 { public static void main(Str...</td>\n",
" <td>/* * To change this license header, choose Li...</td>\n",
" <td>True</td>\n",
@@ -195,12 +207,12 @@
"</div>"
],
"text/plain": [
- " sample_1 \\\n",
- "0 public class T1 { public static void main(Str... \n",
- "1 public class T1 { public static void main(Str... \n",
- "2 public class T1 { public static void main(Str... \n",
- "3 public class T1 { public static void main(Str... \n",
- "4 public class T1 { public static void main(Str... \n",
+ " L case sample_1 \\\n",
+ "0 0 1 public class T1 { public static void main(Str... \n",
+ "1 0 1 public class T1 { public static void main(Str... \n",
+ "2 0 1 public class T1 { public static void main(Str... \n",
+ "3 1 1 public class T1 { public static void main(Str... \n",
+ "4 2 1 public class T1 { public static void main(Str... \n",
"\n",
" sample_2 plagiarized \\\n",
"0 /* * To change this license header, choose Li... False \n",
@@ -217,13 +229,13 @@
"4 The two code samples contain identical main me... "
]
},
- "execution_count": 25,
+ "execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
- "df = pd.read_csv(\"train.csv\", sep=\"\\t\")\n",
+ "df = pd.read_csv(\"https://raw.githubusercontent.com/williambrach/LLM-plagiarism-check/main/data/train.tsv\", sep=\"\\t\")\n",
"df.head()"
]
},
@@ -362,7 +374,7 @@
"source": [
"class PlagiarismSignature(dspy.Signature):\n",
" # Clarify something about the nature of the task (expressed below as a docstring)! \n",
- " \"\"\"Detect if two code samples are plagiarized. In plagiarized field answer only : Yes if the code samples are plagiarized, No otherwise. In explenation field add the reason why the code samples are/ are not plagiarized.\"\"\"\n",
+ " \"\"\"Detect if two code samples are plagiarized. In plagiarized field answer only : Yes if the code samples are plagiarized, No otherwise. In explanation field add the reason why the code samples are/ are not plagiarized.\"\"\"\n",
"\n",
" # Supply hints on the nature of an input field, expressed as a desc keyword argument for dspy.InputField.\n",
" code_sample_1 = dspy.InputField(desc=\"The first code sample to compare\")\n",
diff --git a/examples/multi-input-output/train.csv b/examples/multi-input-output/train.csv
deleted file mode 100644
index dc293ea15..000000000
--- a/examples/multi-input-output/train.csv
+++ /dev/null
@@ -1,64 +0,0 @@
-sample_1 sample_2 plagiarized reason
-"public class T1 { public static void main(String[] args) { System.out.println(""Welcome to Java""); System.out.println(""Welcome to Java""); System.out.println(""Welcome to Java""); System.out.println(""Welcome to Java""); System.out.println(""Welcome to Java""); } }" "/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ /** * * @author CB6AB3315634A1E4D11B091BA48B60BA 7E51EEA5FA101ED4DADE9AD3A7A072BB 2F809B10D1ABEDBF2EC288F851B3EBBB */ public class T01 { public static void main(String[] args){ for(int i = 0; i < 5; i++){ System.out.println(""Welcome To Java""); } } }" False The two code samples, while producing similar output, employ distinctly different programming approaches - one using repetitive print statements and the other utilizing a more efficient for loop. This fundamental difference in implementation, along with variations in code structure and comments, suggests that these are independently written solutions to a common beginner programming task rather than instances of plagiarism.
-"public class T1 { public static void main(String[] args) { System.out.println(""Welcome to Java""); System.out.println(""Welcome to Java""); System.out.println(""Welcome to Java""); System.out.println(""Welcome to Java""); System.out.println(""Welcome to Java""); } }" "/** * * @author 65FBEF05E01FAC390CB3FA073FB3E8CF (452BF208BF901322968557227B8F6EFE010) */ public class T01 { public static void main(String[] args) { for (int i = 0; i < 5; i++) { System.out.println(""Welcome To Java""); } } }" False The code samples demonstrate different approaches to achieving the same simple task, with one using repetitive print statements and the other employing a more efficient loop structure. While the core functionality is identical, the implementation differences and the presence of unique elements like the author comment in the second sample suggest these are likely independent solutions to a common beginner programming exercise rather than a case of direct plagiarism.
-"public class T1 { public static void main(String[] args) { System.out.println(""Welcome to Java""); System.out.println(""Welcome to Java""); System.out.println(""Welcome to Java""); System.out.println(""Welcome to Java""); System.out.println(""Welcome to Java""); } }" "/** * * @author CB6AB3315634A1E4D11B091BA48B60BA */ public class Nomor1_2451041557A22145B3701B0184109CAB013 { /** * @param args the command line arguments */ public static void main(String[] args) { for(int i=0;i<5;i++) { System .out.println(""Welcome To Java""); } } }" False The two code samples produce the same output but utilize different programming approaches, with Sample 1 using repetitive print statements and Sample 2 employing a more efficient loop structure. While the core idea is similar, the implementation details, coding style, and level of programming sophistication differ significantly between the two samples, suggesting independent development rather than plagiarism.
-"public class T1 { public static void main(String[] args) { System.out.println(""Welcome to Java""); System.out.println(""Welcome to Java""); System.out.println(""Welcome to Java""); System.out.println(""Welcome to Java""); System.out.println(""Welcome to Java""); } }" "* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ /** * * @author 19984DCAEA13176BBB694F62BA6B5B35 */ public class L1 { public static void main(String[] args) { System.out.println(""""Welcome to Java""""); System.out.println(""""Welcome to Java""""); System.out.println(""""Welcome to Java""""); System.out.println(""""Welcome to Java""""); System.out.println(""""Welcome to Java""""); } }" True "The two code samples are nearly identical in their core functionality, with both containing the exact same main method that prints ""Welcome to Java"" five times using identical System.out.println statements. The only significant differences are the class names and the presence of auto-generated comments in the second sample, which are superficial changes that do not alter the underlying logic or purpose of the code, strongly indicating that one sample was copied from the other with minimal alterations. "
-"public class T1 { public static void main(String[] args) { System.out.println(""Welcome to Java""); System.out.println(""Welcome to Java""); System.out.println(""Welcome to Java""); System.out.println(""Welcome to Java""); System.out.println(""Welcome to Java""); } }" "/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ /** * * @author 19984DCAEA13176BBB694F62BA6B5B35 */ public class L2 { public static void main(String[] args) { System.out.println(""Welcome to Java""); System.out.println(""Welcome to Java""); System.out.println(""Welcome to Java""); System.out.println(""Welcome to Java""); System.out.println(""Welcome to Java""); } }" True The two code samples contain identical main methods with the exact same five print statements, which is highly unlikely to occur by chance. The only differences are superficial (class names, comments, and formatting), while the core functionality remains identical, strongly indicating that one code sample was copied from the other or both were copied from a common source.
-"public class T1 { public static void main(String[] args) { System.out.println(""Welcome to Java""); System.out.println(""Welcome to Java""); System.out.println(""Welcome to Java""); System.out.println(""Welcome to Java""); System.out.println(""Welcome to Java""); } }" "public class L3 { public static void main(String[] args) { System.out.println(""Welcome to Java""); System.out.println(""Welcome to Java""); System.out.println(""Welcome to Java""); System.out.println(""Welcome to Java""); System.out.println(""Welcome to Java""); } }" True The code samples are identical except for the class names, exhibiting the same structure, content, and even the unusual repetition of print statements. Such a high degree of similarity, especially in a simple program that could be written in many different ways, is extremely unlikely to occur by chance and strongly indicates that one sample was copied from the other with only minimal alteration.
-"public class T1 { public static void main(String[] args) { System.out.println(""Welcome to Java""); System.out.println(""Welcome to Java""); System.out.println(""Welcome to Java""); System.out.println(""Welcome to Java""); System.out.println(""Welcome to Java""); } }" "public class L4 { public static void print() { System.out.println(""Welcome to Java""); System.out.println(""Welcome to Java""); System.out.println(""Welcome to Java""); System.out.println(""Welcome to Java""); System.out.println(""Welcome to Java""); } public static void main(String[] args) { print(); } }" True The code samples show significant similarities in their output and inefficient approach of repeating the same print statement five times without using a loop, which raises suspicion of potential plagiarism. However, the differences in class structure and method implementation suggest that if copying occurred, it wasn't a direct copy-paste, and more context would be needed to conclusively determine plagiarism.
-"public class T1 { public static void main(String[] args) { System.out.println(""Welcome to Java""); System.out.println(""Welcome to Java""); System.out.println(""Welcome to Java""); System.out.println(""Welcome to Java""); System.out.println(""Welcome to Java""); } }" "public class L5 { public static void print() { for (int i = 0; i < 5; i++) { System.out.print(""Welcome to Java\n""); } } public static void main(String[] args) { print(); } }" True "The code samples exhibit plagiarism due to their identical output and core functionality, despite differences in implementation. The verbatim use of the specific phrase ""Welcome to Java"" in both samples, combined with the same overall goal and language, strongly suggests that one solution was derived from the other, even if attempts were made to disguise this through minor structural changes."
-"public class T1 { public static void main(String[] args) { System.out.println(""Welcome to Java""); System.out.println(""Welcome to Java""); System.out.println(""Welcome to Java""); System.out.println(""Welcome to Java""); System.out.println(""Welcome to Java""); } }" "public class L6 { public static void print() { for (int i = 5; i > 0; i--) { System.out.print(""""Welcome to Java\n""""); } } public static void main(String[] args) { print(); } }" True These code samples can be considered plagiarism because they produce identical, specific output and solve the same unusual task, with the second sample appearing to be an attempt to disguise copied code through minimal modifications. Despite superficial differences in implementation (using a loop and separate method in Sample 2), the core functionality and purpose remain the same, indicating a lack of originality that would likely be considered plagiarism in academic or professional contexts.
-"import java.util.Scanner; public class T2 { public static void main(String[] args) { Scanner input = new Scanner(System.in); // Enter radius of the cylinder System.out.print(""Enter the radius and length of a cylinder: ""); double radius = input.nextDouble(); double length = input.nextDouble(); double area = radius * radius * 3.14159; double volume = area * length; System.out.println(""The area is "" + area); System.out.println(""The volume of the cylinder is "" + volume); } }" "import java.util.Scanner; /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ /** * * @author CB6AB3315634A1E4D11B091BA48B60BA 7E51EEA5FA101ED4DADE9AD3A7A072BB 2F809B10D1ABEDBF2EC288F851B3EBBB */ public class T02 { public static void main(String[] args){ Scanner sc = new Scanner(System.in); System.out.print(""Enter the radius and length of a cylinder: ""); double radius = sc.nextDouble(); double length = sc.nextDouble(); double area = radius * radius * 3.14159; double volume = area * length; System.out.println(""The area is "" + (float)area); System.out.printf(""The volume is %.1f"", volume); System.out.println(); } }" False While the two programs are very similar in structure and functionality, they appear to be standard solutions to a common programming exercise for calculating cylinder measurements, which explains their resemblance without necessarily indicating plagiarism. Small differences in implementation details, variable naming, and output formatting suggest these could be independent solutions to the same problem rather than direct copies.
-"import java.util.Scanner; public class T2 { public static void main(String[] args) { Scanner input = new Scanner(System.in); // Enter radius of the cylinder System.out.print(""Enter the radius and length of a cylinder: ""); double radius = input.nextDouble(); double length = input.nextDouble(); double area = radius * radius * 3.14159; double volume = area * length; System.out.println(""The area is "" + area); System.out.println(""The volume of the cylinder is "" + volume); } }" "import java.util.Scanner; /** * * @author 65FBEF05E01FAC390CB3FA073FB3E8CF (452BF208BF901322968557227B8F6EFE010) */ public class T02 { public static void main(String[] args) { Scanner s = new Scanner(System.in); System.out.print(""Enter the radius and length of a cylinder: ""); float r = s.nextFloat(); float l = s.nextFloat(); System.out.println(""The area is "" + r * r * 3.14159); System.out.println(""The volume is "" + (r * r * 3.14159) * l); } }" False The code samples show significant structural and conceptual similarities, including identical problem-solving approaches and nearly verbatim output statements, which suggest a common source or assignment. However, the differences in variable naming, data types, calculation methods, and overall code style indicate that these are likely independent implementations of the same problem rather than direct copying, making it difficult to definitively classify this as plagiarism without more context.
-"import java.util.Scanner; public class T2 { public static void main(String[] args) { Scanner input = new Scanner(System.in); // Enter radius of the cylinder System.out.print(""Enter the radius and length of a cylinder: ""); double radius = input.nextDouble(); double length = input.nextDouble(); double area = radius * radius * 3.14159; double volume = area * length; System.out.println(""The area is "" + area); System.out.println(""The volume of the cylinder is "" + volume); } }" "import java.util.Scanner; /** * * @author CB6AB3315634A1E4D11B091BA48B60BA */ public class Nomor2_2451041557A22145B3701B0184109CAB013 { /** * @param args the command line arguments */ public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.print(""Enter the radius and length of a cylinder : ""); double radius = sc.nextDouble(); double length = sc.nextDouble(); double area = (radius * radius) * 3.14159; double volume = area * length; System.out.println(""The area is : "" + area); System.out.println(""The volume is : "" + volume); } }" False These code samples do not demonstrate plagiarism because they are solving a common, simple programming problem that naturally leads to similar implementations. While they share basic structure and formulas, there are distinct differences in naming, formatting, and specific implementation details that indicate independent work.
-"import java.util.Scanner; public class T2 { public static void main(String[] args) { Scanner input = new Scanner(System.in); // Enter radius of the cylinder System.out.print(""Enter the radius and length of a cylinder: ""); double radius = input.nextDouble(); double length = input.nextDouble(); double area = radius * radius * 3.14159; double volume = area * length; System.out.println(""The area is "" + area); System.out.println(""The volume of the cylinder is "" + volume); } }" "import java.util.Scanner; public class L1 { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print(""""Enter the radius and length of a cylinder: """"); double radius = input.nextDouble(); double length = input.nextDouble(); double area = radius * radius * 3.14159; double volume = area * length; System.out.println(""""The area is """" + area + """", """"); System.out.print(""""The volume of the cylinder is """" + volume); } }" True The two code samples are nearly identical in structure, logic, and even comments, with only minor differences in class names and output formatting. This level of similarity, including matching variable names and the specific order of operations, strongly indicates that one sample was copied from the other or both were derived from a common source, rather than being independently developed solutions to the same problem.
-"import java.util.Scanner; public class T2 { public static void main(String[] args) { Scanner input = new Scanner(System.in); // Enter radius of the cylinder System.out.print(""Enter the radius and length of a cylinder: ""); double radius = input.nextDouble(); double length = input.nextDouble(); double area = radius * radius * 3.14159; double volume = area * length; System.out.println(""The area is "" + area); System.out.println(""The volume of the cylinder is "" + volume); } }" "import java.util.*; public class L2 { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print(""Enter the radius and length of a cylinder: ""); double jari2 = input.nextDouble(); double panjang = input.nextDouble(); double luas = jari2 * jari2 * 3.14159; double total = luas * panjang; System.out.println(""The area is "" + luas); System.out.println(""The volume of the cylinder is "" + total); } }" True The two code samples have identical overall structure, logic, calculations, and output strings, which is too similar to be coincidental. While there are superficial differences like some variable names and comments, the core implementation is essentially the same, strongly suggesting that one was copied from the other with only minor modifications.
-"import java.util.Scanner; public class T2 { public static void main(String[] args) { Scanner input = new Scanner(System.in); // Enter radius of the cylinder System.out.print(""Enter the radius and length of a cylinder: ""); double radius = input.nextDouble(); double length = input.nextDouble(); double area = radius * radius * 3.14159; double volume = area * length; System.out.println(""The area is "" + area); System.out.println(""The volume of the cylinder is "" + volume); } }" "import java.util.*; public class L3 { public static void main(String[] args) { Scanner input = new Scanner(System.in); double jari2 = 0; double panjang = 0; System.out.print(""Enter the radius and length of a cylinder: ""); jari2 = input.nextDouble(); panjang = input.nextDouble(); double luas = jari2 * jari2 * 3.14159; double total = luas * panjang; System.out.print(""The area is "" + luas + "" , ""); System.out.println(""The volume of the cylinder is "" + total); } }" True The code samples exhibit nearly identical structure, logic, and even specific wording in key areas such as user prompts and output statements, which is unlikely to occur independently. Despite minor differences in variable names and formatting, the overall similarity in implementation, including the use of the same mathematical constant (3.14159) and calculation methods, strongly suggests that one code sample was derived from the other or both were derived from a common source.
-"import java.util.Scanner; public class T2 { public static void main(String[] args) { Scanner input = new Scanner(System.in); // Enter radius of the cylinder System.out.print(""Enter the radius and length of a cylinder: ""); double radius = input.nextDouble(); double length = input.nextDouble(); double area = radius * radius * 3.14159; double volume = area * length; System.out.println(""The area is "" + area); System.out.println(""The volume of the cylinder is "" + volume); } }" "import java.util.*; public class L4 { public static double hitLuas(double jari2) { return jari2 * jari2 * 3.14159; } public static double total(double luas, double panjang) { return luas * panjang; } public static void main(String[] args) { Scanner input = new Scanner(System.in); double jari2 = 0; double panjang = 0; System.out.print(""Enter the radius and length of a cylinder: ""); jari2 = input.nextDouble(); panjang = input.nextDouble(); double luas = hitLuas(jari2); double total = total(luas,panjang); System.out.print(""The area is "" + luas + "" , ""); System.out.println(""The volume of the cylinder is "" + total); } }" True The code samples show significant similarities in their overall structure, purpose, and specific details like the input prompt and pi value, strongly suggesting they are not independently created. However, there are also notable differences in implementation, such as the use of methods in the second sample, which indicates some level of individual work or modification rather than direct copying.
-"import java.util.Scanner; public class T2 { public static void main(String[] args) { Scanner input = new Scanner(System.in); // Enter radius of the cylinder System.out.print(""Enter the radius and length of a cylinder: ""); double radius = input.nextDouble(); double length = input.nextDouble(); double area = radius * radius * 3.14159; double volume = area * length; System.out.println(""The area is "" + area); System.out.println(""The volume of the cylinder is "" + volume); } }" "import java.util.*; public class L5 { public static double hitLuas(double jari2) { return jari2 * jari2 * 3.14159; } public static double total(double luas, double panjang) { return luas * panjang; } public static void main(String[] args) { Scanner input = new Scanner(System.in); double jari2, panjang; double luas, total; System.out.print(""Enter the radius and length of a cylinder: ""); jari2 = input.nextDouble(); panjang = input.nextDouble(); luas = hitLuas(jari2); total = total(luas, panjang); System.out.print(""The area is "" + luas + "" , ""); System.out.println(""The volume of the cylinder is "" + total); } }" True The two code samples share identical core logic, user prompts, and a specific pi approximation, which is highly unlikely to occur independently. While the second sample attempts to disguise potential copying through restructuring and variable renaming, these superficial changes do not mask the underlying similarities that strongly suggest derivation from the first code sample.
-"import java.util.Scanner; public class T2 { public static void main(String[] args) { Scanner input = new Scanner(System.in); // Enter radius of the cylinder System.out.print(""Enter the radius and length of a cylinder: ""); double radius = input.nextDouble(); double length = input.nextDouble(); double area = radius * radius * 3.14159; double volume = area * length; System.out.println(""The area is "" + area); System.out.println(""The volume of the cylinder is "" + volume); } }" "import java.util.*; public class L6 { public static double hitLuas(double jari2) { return jari2 * jari2 * 3.14159; } public static double total(double luas, double panjang) { return luas * panjang; } public static void main(String[] args) { Scanner input = new Scanner(System.in); double jari2, panjang; double luas, total; jari2 = 0; panjang = 0; System.out.print(""Enter the radius and length of a cylinder: ""); for (int i = 0; i < 1; i++) { jari2 = input.nextDouble(); panjang = input.nextDouble(); } luas = hitLuas(jari2); total = total(luas, panjang); System.out.print(""The area is "" + luas + "" , ""); System.out.println(""The volume of the cylinder is "" + total); } }" True The two code samples share significant similarities in structure, core logic, and specific elements like the input prompt and pi value, which are unlikely to occur by chance in independently developed programs. While there are some differences in implementation details, these appear to be superficial changes that don't fundamentally alter the underlying approach, suggesting that one code sample may have been derived from the other with attempts to disguise the similarity.
-"import java.util.Scanner; public class T3 { public static void main(String[] args) { Scanner input = new Scanner(System.in); // Prompt the user to enter weight in pounds System.out.print(""Enter weight in pounds: ""); double weight = input.nextDouble(); // Prompt the user to enter height System.out.print(""Enter feet: ""); double feet = input.nextDouble(); System.out.print(""Enter inches: ""); double inches = input.nextDouble(); double height = feet * 12 + inches; // Compute BMI double bmi = weight * 0.45359237 / ((height * 0.0254) * (height * 0.0254)); // Display result System.out.println(""BMI is "" + bmi); if (bmi < 18.5) System.out.println(""Underweight""); else if (bmi < 25) System.out.println(""Normal""); else if (bmi < 30) System.out.println(""Overweight""); else System.out.println(""Obese""); } }" "import java.util.Scanner; /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ /** * * @author CB6AB3315634A1E4D11B091BA48B60BA 7E51EEA5FA101ED4DADE9AD3A7A072BB 2F809B10D1ABEDBF2EC288F851B3EBBB */ public class T03 { public static void main(String[] args){ Scanner sc = new Scanner(System.in); System.out.print(""Enter weight in pounds: ""); int weight = sc.nextInt(); System.out.print(""Enter feet: ""); int feet = sc.nextInt(); System.out.print(""Enter inches: ""); int inches = sc.nextInt(); int height = feet * 12 + inches; double bmi = weight * 0.45359237 / ((height * 0.0254) * (height * 0.0254)); System.out.println(""BMI is "" + bmi); if(bmi < 18.5){ System.out.println(""Underweight""); }else if(bmi >= 18.5 && bmi < 25){ System.out.println(""Normal""); }else if(bmi >= 35){ System.out.println(""Obese""); } } }" False These code samples are not plagiarized because they represent standard solutions to a common beginner programming exercise (BMI calculator), which naturally leads to similarities in structure, calculations, and variable names. The differences in implementation details, such as variable types, input methods, and BMI classification thresholds, along with unique elements like the encoded header comment in the second sample, indicate these are independently written programs following similar assignment requirements.
-"import java.util.Scanner; public class T3 { public static void main(String[] args) { Scanner input = new Scanner(System.in); // Prompt the user to enter weight in pounds System.out.print(""Enter weight in pounds: ""); double weight = input.nextDouble(); // Prompt the user to enter height System.out.print(""Enter feet: ""); double feet = input.nextDouble(); System.out.print(""Enter inches: ""); double inches = input.nextDouble(); double height = feet * 12 + inches; // Compute BMI double bmi = weight * 0.45359237 / ((height * 0.0254) * (height * 0.0254)); // Display result System.out.println(""BMI is "" + bmi); if (bmi < 18.5) System.out.println(""Underweight""); else if (bmi < 25) System.out.println(""Normal""); else if (bmi < 30) System.out.println(""Overweight""); else System.out.println(""Obese""); } }" "import java.util.Scanner; /** * * @author 65FBEF05E01FAC390CB3FA073FB3E8CF (452BF208BF901322968557227B8F6EFE010) */ public class T03 { public static void main(String[] args) { Scanner s = new Scanner(System.in); System.out.print(""Enter weight in pounds: ""); float w=s.nextFloat(); System.out.print(""Enter feet: ""); float f=s.nextFloat(); System.out.print(""Enter inches: ""); float i=s.nextFloat(); float h=f*12+i; float bmi = (float) ((w*0.45359237)/((h*0.0254)*(h*0.0254))); System.out.println(""BMI is ""+bmi); if(bmi<18.5){ System.out.println(""Underweight""); } else if (bmi>=18.5 && bmi<25){ System.out.println(""Normal""); } else if (bmi>=25 && bmi<35){ System.out.println(""Overweight""); } else if (bmi>=35) { System.out.println(""Obese""); } } }" False The two code samples, while solving the same problem and sharing some similarities due to the nature of the task, have enough distinct differences in implementation details, variable naming, and coding style to be considered separate, original works rather than instances of plagiarism.
-"import java.util.Scanner; public class T3 { public static void main(String[] args) { Scanner input = new Scanner(System.in); // Prompt the user to enter weight in pounds System.out.print(""Enter weight in pounds: ""); double weight = input.nextDouble(); // Prompt the user to enter height System.out.print(""Enter feet: ""); double feet = input.nextDouble(); System.out.print(""Enter inches: ""); double inches = input.nextDouble(); double height = feet * 12 + inches; // Compute BMI double bmi = weight * 0.45359237 / ((height * 0.0254) * (height * 0.0254)); // Display result System.out.println(""BMI is "" + bmi); if (bmi < 18.5) System.out.println(""Underweight""); else if (bmi < 25) System.out.println(""Normal""); else if (bmi < 30) System.out.println(""Overweight""); else System.out.println(""Obese""); } }" "import java.util.Scanner; /** * * @author CB6AB3315634A1E4D11B091BA48B60BA */ public class Nomor3_2451041557A22145B3701B0184109CAB013 { /** * @param args the command line arguments / public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.print(""Enter weight in pounds: ""); int weight = sc.nextInt(); System.out.print(""Enter feet: ""); int feet = sc.nextInt(); System.out.print(""Enter inch: ""); int inches = sc.nextInt(); int height = feet12 + inches; double bmi = weight0.45359237/((height0.0254)(height0.0254)); System.out.println(""BMI is "" + bmi); if(bmi<18.5){ System.out.println(""underweight""); } else if(bmi>=18.5 && bmi<25){ System.out.println(""Normal""); } else if(bmi>=25 && bmi<35){ System.out.println(""overweight""); } else if(bmi >35){ System.out.println(""obese""); } } }" False The two code samples, while solving the same problem of BMI calculation, show distinct implementation styles and coding practices. Key differences include variable type choices, input handling methods, code structure, and BMI category thresholds, indicating they were likely developed independently by different programmers approaching the same task.
-"import java.util.Scanner; public class T3 { public static void main(String[] args) { Scanner input = new Scanner(System.in); // Prompt the user to enter weight in pounds System.out.print(""Enter weight in pounds: ""); double weight = input.nextDouble(); // Prompt the user to enter height System.out.print(""Enter feet: ""); double feet = input.nextDouble(); System.out.print(""Enter inches: ""); double inches = input.nextDouble(); double height = feet * 12 + inches; // Compute BMI double bmi = weight * 0.45359237 / ((height * 0.0254) * (height * 0.0254)); // Display result System.out.println(""BMI is "" + bmi); if (bmi < 18.5) System.out.println(""Underweight""); else if (bmi < 25) System.out.println(""Normal""); else if (bmi < 30) System.out.println(""Overweight""); else System.out.println(""Obese""); } }" "import java.util.Scanner; public class L1 { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print(""Enter weight in pounds: ""); double weight = input.nextDouble(); System.out.print(""Enter feet: ""); double feet = input.nextDouble(); System.out.print(""Enter inches: ""); double inches = input.nextDouble(); double height = feet * 12 + inches; double bmi = weight * 0.45359237 / ((height * 0.0254) * (height * 0.0254)); System.out.println(""BMI is "" + bmi); if (bmi < 18.5) { System.out.println(""Underweight""); } else if (bmi < 25) { System.out.println(""Normal""); } else if (bmi < 30) { System.out.println(""Overweight""); } else { System.out.println(""Obese""); } } }" True The two code samples are nearly identical in structure, logic, variable names, and even specific constants used, with only minor differences in formatting and class names. This level of similarity is extremely unlikely to occur independently and strongly indicates that one sample was copied from the other or both were derived from a common source.
-"import java.util.Scanner; public class T3 { public static void main(String[] args) { Scanner input = new Scanner(System.in); // Prompt the user to enter weight in pounds System.out.print(""Enter weight in pounds: ""); double weight = input.nextDouble(); // Prompt the user to enter height System.out.print(""Enter feet: ""); double feet = input.nextDouble(); System.out.print(""Enter inches: ""); double inches = input.nextDouble(); double height = feet * 12 + inches; // Compute BMI double bmi = weight * 0.45359237 / ((height * 0.0254) * (height * 0.0254)); // Display result System.out.println(""BMI is "" + bmi); if (bmi < 18.5) System.out.println(""Underweight""); else if (bmi < 25) System.out.println(""Normal""); else if (bmi < 30) System.out.println(""Overweight""); else System.out.println(""Obese""); } }" "import java.util.*; public class L2 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.print(""Enter weight in pounds: ""); double berat = sc.nextDouble(); System.out.print(""Enter feet: ""); double feet = sc.nextDouble(); System.out.print(""Enter inches: ""); double inci = sc.nextDouble(); double tinggi = feet * 12 + inci; double bmi = berat * 0.45359237 / ((tinggi * 0.0254) * (tinggi * 0.0254)); System.out.println(""BMI is "" + bmi); if (bmi < 18.5) { System.out.println(""Underweight""); } else if (bmi < 25) { System.out.println(""Normal""); } else if (bmi < 30) { System.out.println(""Overweight""); } else { System.out.println(""Obese""); } } }" True The two code samples exhibit nearly identical structure, logic, and functionality for calculating BMI, including the same input prompts, conversion factors, calculations, and output categories. While there are minor differences in variable names and formatting, these superficial changes do not alter the fact that the core implementation is essentially the same in both samples, strongly indicating plagiarism.
-"import java.util.Scanner; public class T3 { public static void main(String[] args) { Scanner input = new Scanner(System.in); // Prompt the user to enter weight in pounds System.out.print(""Enter weight in pounds: ""); double weight = input.nextDouble(); // Prompt the user to enter height System.out.print(""Enter feet: ""); double feet = input.nextDouble(); System.out.print(""Enter inches: ""); double inches = input.nextDouble(); double height = feet * 12 + inches; // Compute BMI double bmi = weight * 0.45359237 / ((height * 0.0254) * (height * 0.0254)); // Display result System.out.println(""BMI is "" + bmi); if (bmi < 18.5) System.out.println(""Underweight""); else if (bmi < 25) System.out.println(""Normal""); else if (bmi < 30) System.out.println(""Overweight""); else System.out.println(""Obese""); } }" "import java.util.*; public class L3 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); double berat = 0; double inci = 0; double tinggi = 0 ; double bmi = 0; double feet = 0; System.out.print(""Enter weight in pounds: ""); berat = sc.nextDouble(); System.out.print(""Enter feet: ""); feet = sc.nextDouble(); System.out.print(""Enter inches: ""); inci = sc.nextDouble(); tinggi = feet * 12 + inci; bmi = berat * 0.45359237 / ((tinggi * 0.0254) * (tinggi * 0.0254)); System.out.println(""BMI is "" + bmi); if (bmi < 18.5) { System.out.println(""Underweight""); } else if (bmi < 25) { System.out.println(""Normal""); } else if (bmi < 30) { System.out.println(""Overweight""); } else { System.out.println(""Obese""); } } }" True The two code samples exhibit striking similarities in structure, logic, and even specific implementation details like the BMI calculation formula and classification thresholds, suggesting that one was likely derived from the other or both from a common source. While there are minor differences in variable names and formatting, the overall approach, user prompts, and output messages are nearly identical, indicating a high probability of code plagiarism rather than independent development.
-"import java.util.Scanner; public class T3 { public static void main(String[] args) { Scanner input = new Scanner(System.in); // Prompt the user to enter weight in pounds System.out.print(""Enter weight in pounds: ""); double weight = input.nextDouble(); // Prompt the user to enter height System.out.print(""Enter feet: ""); double feet = input.nextDouble(); System.out.print(""Enter inches: ""); double inches = input.nextDouble(); double height = feet * 12 + inches; // Compute BMI double bmi = weight * 0.45359237 / ((height * 0.0254) * (height * 0.0254)); // Display result System.out.println(""BMI is "" + bmi); if (bmi < 18.5) System.out.println(""Underweight""); else if (bmi < 25) System.out.println(""Normal""); else if (bmi < 30) System.out.println(""Overweight""); else System.out.println(""Obese""); } }" "import java.util.*; public class L4 { public static double hitBmi(double berat, double tinggi) { return berat * 0.45359237 / ((tinggi * 0.0254) * (tinggi * 0.0254)); } public static void main(String[] args) { Scanner sc = new Scanner(System.in); double berat = 0; double inci = 0; double tinggi = 0 ; double feet = 0; System.out.print(""Enter weight in pounds: ""); berat = sc.nextDouble(); System.out.print(""Enter feet: ""); feet = sc.nextDouble(); System.out.print(""Enter inches: ""); inci = sc.nextDouble(); tinggi = feet * 12 + inci; System.out.println(""BMI is "" + hitBmi(berat,tinggi)); if (hitBmi(berat,tinggi) < 18.5) { System.out.println(""Underweight""); } else if (hitBmi(berat,tinggi) < 25) { System.out.println(""Normal""); } else if (hitBmi(berat,tinggi) < 30) { System.out.println(""Overweight""); } else { System.out.println(""Obese""); } } }" True The two code samples exhibit striking similarities in overall structure, logic flow, and specific implementation details, including identical user prompts, BMI calculation formula, and categorization thresholds. While minor differences exist in variable naming and method organization, the extent of matching elements, particularly in the user interface and core algorithm, strongly suggests that one code sample was derived from the other or both were based on a common source.
-"import java.util.Scanner; public class T3 { public static void main(String[] args) { Scanner input = new Scanner(System.in); // Prompt the user to enter weight in pounds System.out.print(""Enter weight in pounds: ""); double weight = input.nextDouble(); // Prompt the user to enter height System.out.print(""Enter feet: ""); double feet = input.nextDouble(); System.out.print(""Enter inches: ""); double inches = input.nextDouble(); double height = feet * 12 + inches; // Compute BMI double bmi = weight * 0.45359237 / ((height * 0.0254) * (height * 0.0254)); // Display result System.out.println(""BMI is "" + bmi); if (bmi < 18.5) System.out.println(""Underweight""); else if (bmi < 25) System.out.println(""Normal""); else if (bmi < 30) System.out.println(""Overweight""); else System.out.println(""Obese""); } }" "import java.util.*; public class L5 { public static double hitBmi(double berat, double tinggi) { return berat * 0.45359237 / ((tinggi * 0.0254) * (tinggi * 0.0254)); } public static void main(String[] args) { Scanner sc = new Scanner(System.in); double berat, inci, tinggi, feet = 0; System.out.print(""Enter weight in pounds: ""); berat = sc.nextDouble(); System.out.print(""Enter feet: ""); feet = sc.nextDouble(); System.out.print(""Enter inches: ""); inci = sc.nextDouble(); tinggi = feet * 12 + inci; System.out.println(""BMI is "" + hitBmi(berat, tinggi)); if (hitBmi(berat, tinggi) < 18.5) { System.out.println(""Underweight""); } else if (hitBmi(berat, tinggi) < 25) { System.out.println(""Normal""); } else if (hitBmi(berat, tinggi) < 30) { System.out.println(""Overweight""); } else { System.out.println(""Obese""); } } }" True The two code samples exhibit significant structural and logical similarities, including identical BMI calculation formulas, input methods, and classification thresholds, which are unlikely to occur independently. However, there are also notable differences in variable naming, code organization, and styling, suggesting that if one code was derived from the other, it was modified rather than directly copied.
-"import java.util.Scanner; public class T3 { public static void main(String[] args) { Scanner input = new Scanner(System.in); // Prompt the user to enter weight in pounds System.out.print(""Enter weight in pounds: ""); double weight = input.nextDouble(); // Prompt the user to enter height System.out.print(""Enter feet: ""); double feet = input.nextDouble(); System.out.print(""Enter inches: ""); double inches = input.nextDouble(); double height = feet * 12 + inches; // Compute BMI double bmi = weight * 0.45359237 / ((height * 0.0254) * (height * 0.0254)); // Display result System.out.println(""BMI is "" + bmi); if (bmi < 18.5) System.out.println(""Underweight""); else if (bmi < 25) System.out.println(""Normal""); else if (bmi < 30) System.out.println(""Overweight""); else System.out.println(""Obese""); } }" "import java.util.*; public class L6 { public static double hitBmi(double berat, double tinggi) { return berat * 0.45359237 / ((tinggi * 0.0254) * (tinggi * 0.0254)); } public static void main(String[] args) { Scanner sc = new Scanner(System.in); double berat, inci, tinggi, feet = 0; System.out.print(""Enter weight in pounds: ""); berat = sc.nextDouble(); System.out.print(""Enter feet: ""); feet = sc.nextDouble(); System.out.print(""Enter inches: ""); inci = sc.nextDouble(); tinggi = feet * 12 + inci; System.out.println(""BMI is "" + hitBmi(berat, tinggi)); if (hitBmi(berat, tinggi) < 25 && hitBmi(berat, tinggi) > 18.5) { System.out.println(""Normal""); } else if (hitBmi(berat, tinggi) < 30 && hitBmi(berat, tinggi) > 25) { System.out.println(""Overweight""); } else if (hitBmi(berat, tinggi) > 30) { System.out.println(""Obese""); } else { System.out.println(""Underweight""); } } }" True The two code samples share significant structural similarities, including identical input prompts, BMI calculation formulas, and output formats, which strongly suggest that one was derived from the other. However, the second sample shows evidence of modification, such as translated variable names and a reorganized code structure with a separate function for BMI calculation, indicating it's not a direct copy but rather a closely inspired adaptation.
-"public class T4 { public static void main(String[] args) { System.out.println(""Miles\t\tKilometers""); System.out.println(""-------------------------------""); // Use while loop int miles = 1; while (miles <= 10) { System.out.println(miles + ""\t\t"" + miles * 1.609); miles++; } } }" "/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ /** * * @author CB6AB3315634A1E4D11B091BA48B60BA 7E51EEA5FA101ED4DADE9AD3A7A072BB 2F809B10D1ABEDBF2EC288F851B3EBBB */ public class T04 { public static void main(String[] args){ System.out.println(""Miles\tKilometers""); for(int i = 1; i <= 10; i++){ System.out.printf(i + ""\t%.3f"", (i * 1.609)); System.out.println(); } } }" False The code samples share the same basic purpose and output format, which is expected given they solve the same problem of converting miles to kilometers. However, they differ significantly in implementation details such as loop structure, variable usage, output formatting, and overall code organization, suggesting they are likely independent solutions rather than a case of direct plagiarism.
-"public class T4 { public static void main(String[] args) { System.out.println(""Miles\t\tKilometers""); System.out.println(""-------------------------------""); // Use while loop int miles = 1; while (miles <= 10) { System.out.println(miles + ""\t\t"" + miles * 1.609); miles++; } } }" "/** * * @author 65FBEF05E01FAC390CB3FA073FB3E8CF (452BF208BF901322968557227B8F6EFE010) */ public class T04 { public static void main(String[] args) { System.out.println(""Miles Kilometers""); for (int i = 1; i <= 10; i++) { if (i == 10) { System.out.println(i + "" "" + i * 1609); } else { System.out.println(i + "" "" + i * 1609); } } } }" False The code samples share a common purpose of converting miles to kilometers, which is likely due to a shared assignment rather than plagiarism. However, the significant differences in implementation details, such as loop structure, variable usage, formatting, and even errors in calculation, strongly suggest these are independently developed solutions.
-"public class T4 { public static void main(String[] args) { System.out.println(""Miles\t\tKilometers""); System.out.println(""-------------------------------""); // Use while loop int miles = 1; while (miles <= 10) { System.out.println(miles + ""\t\t"" + miles * 1.609); miles++; } } }" "/** * * @author CB6AB3315634A1E4D11B091BA48B60BA */ public class Nomor4_2451041557A22145B3701B0184109CAB013 { /** * @param args the command line arguments */ public static void main(String[] args) { System.out.println(""Miles \t Kilometers""); for(int i = 1 ; i<=10;i++){ System.out.println(i+"" \t ""+i*1.069); } } }" False The two code samples share a common overall structure and purpose, which is expected given they're solving the same problem of converting miles to kilometers in a tabular format. However, they differ significantly in implementation details such as loop structure, variable naming, formatting choices, and even the conversion factor used, suggesting independent development rather than direct copying.
-"public class T4 { public static void main(String[] args) { System.out.println(""Miles\t\tKilometers""); System.out.println(""-------------------------------""); // Use while loop int miles = 1; while (miles <= 10) { System.out.println(miles + ""\t\t"" + miles * 1.609); miles++; } } }" "public class L1 { public static void main(String[] args) { System.out.println(""Miles\t\tKilometers""); System.out.println(""-------------------------------""); int miles = 1; while (miles <= 10) { System.out.println(miles + ""\t\t"" + miles * 1.609); miles++; } } }" True The two code samples are nearly identical in structure, logic, and implementation, with only superficial differences in class names and formatting. The matching content includes specific details like variable names, loop structure, and even the exact conversion factor (1.609), which is highly unlikely to occur independently and strongly indicates direct copying.
-"public class T4 { public static void main(String[] args) { System.out.println(""Miles\t\tKilometers""); System.out.println(""-------------------------------""); // Use while loop int miles = 1; while (miles <= 10) { System.out.println(miles + ""\t\t"" + miles * 1.609); miles++; } } }" "public class L2 { public static void main(String[] args) { System.out.println(""Miles\t\tKilometers""); System.out.println(""-------------------------------""); int mil = 1; while (mil <= 10) { System.out.println(mil + ""\t\t"" + mil * 1.609); mil++; } } }" True The code samples exhibit nearly identical structure, logic, and implementation details, including the same output formatting, loop structure, and calculation method. The only significant differences are superficial changes such as class names and variable names, which appear to be minimal alterations to an otherwise copied piece of code.
-"public class T4 { public static void main(String[] args) { System.out.println(""Miles\t\tKilometers""); System.out.println(""-------------------------------""); // Use while loop int miles = 1; while (miles <= 10) { System.out.println(miles + ""\t\t"" + miles * 1.609); miles++; } } }" "public class L3 { public static void main(String[] args) { int mil = 0 ; System.out.println(""Miles\t\tKilometers""); System.out.println(""-------------------------------""); mil = 1; while (mil <= 10) { System.out.println(mil + ""\t\t"" + mil * 1.609); mil++; } } }" True The two code samples exhibit nearly identical structure, logic, and output, with only superficial differences in class names, variable names, and formatting. Such a high degree of similarity, especially in the core implementation and specific details like the conversion factor used, strongly suggests that one sample was derived from the other with only minor alterations, which is indicative of plagiarism.
-"public class T4 { public static void main(String[] args) { System.out.println(""Miles\t\tKilometers""); System.out.println(""-------------------------------""); // Use while loop int miles = 1; while (miles <= 10) { System.out.println(miles + ""\t\t"" + miles * 1.609); miles++; } } }" "public class L4 { public static void print(int mil) { while (mil <= 10) { System.out.println(mil + ""\t\t"" + mil * 1.609); mil++; } } public static void main(String[] args) { int mil = 1 ; System.out.println(""Miles\t\tKilometers""); System.out.println(""-------------------------------""); print(mil); } }" True The two code samples are indeed plagiarized versions of each other because they share the exact same core logic, conversion factor, and output format, with only superficial changes in variable names, method structure, and formatting. The second sample appears to be an attempt to obfuscate the plagiarism by reorganizing the code and changing minor details, but the underlying algorithm and implementation remain fundamentally identical to the first sample.
-"public class T4 { public static void main(String[] args) { System.out.println(""Miles\t\tKilometers""); System.out.println(""-------------------------------""); // Use while loop int miles = 1; while (miles <= 10) { System.out.println(miles + ""\t\t"" + miles * 1.609); miles++; } } }" "public class L5 { public static void print(int mil) { for ( int i = 0 ; i < 10 ; i ++){ System.out.println(mil + ""\t\t"" + mil * 1.609); mil++; } } public static void main(String[] args) { int mil = 1 ; System.out.println(""Miles\t\tKilometers""); System.out.println(""-------------------------------""); print(mil); } }" True These code samples exhibit plagiarism due to their identical output formatting, conversion logic, and specific choices like the range of miles (1-10) and exact conversion factor (1.609). While there are surface-level differences in loop structure and method organization, the core implementation and output are too similar to be coincidental, strongly suggesting that one was derived from the other.
-"public class T4 { public static void main(String[] args) { System.out.println(""Miles\t\tKilometers""); System.out.println(""-------------------------------""); // Use while loop int miles = 1; while (miles <= 10) { System.out.println(miles + ""\t\t"" + miles * 1.609); miles++; } } }" "public class L6 { public static void print(int mil) { for ( int i = 10 ; i > 0 ; i --){ System.out.println(mil + ""\t\t"" + mil * 1.609); mil++; } } public static void main(String[] args) { int mil = 1 ; System.out.println(""Miles\t\tKilometers""); System.out.println(""-------------------------------""); print(mil); } }" True The two code samples are indeed plagiarized, primarily because they share identical core logic, output formatting, and conversion factors, with only superficial differences in loop structure and method organization. The second sample appears to be an attempt to disguise the plagiarism by rearranging code elements and changing variable names, but the fundamental algorithm and output remain the same, indicating that the code was likely copied and then slightly modified.
-"public class T5 { public static void main(String[] args) { System.out.print(""Enter an integer: ""); java.util.Scanner input = new java.util.Scanner(System.in); int number = input.nextInt(); reverse(number); } public static void reverse(int number) { while (number != 0) { int remainder = number % 10; System.out.print(remainder); number = number / 10; } System.out.println(); } }" "import java.util.Scanner; /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ /** * * @author CB6AB3315634A1E4D11B091BA48B60BA 7E51EEA5FA101ED4DADE9AD3A7A072BB 2F809B10D1ABEDBF2EC288F851B3EBBB */ public class T05 { public static void main(String[] args){ Scanner sc = new Scanner(System.in); System.out.print(""Enter an integer: ""); int number = sc.nextInt(); reverse(number); } public static void reverse(int number){ while(number > 0){ System.out.print(number % 10); number /= 10; } System.out.println(); } }" False These code samples represent independent implementations of a common, straightforward programming exercise. While they share the same basic algorithm due to the simplicity of the task, the differences in implementation details, coding style, and structure indicate they were likely developed separately by different programmers.
-"public class T5 { public static void main(String[] args) { System.out.print(""Enter an integer: ""); java.util.Scanner input = new java.util.Scanner(System.in); int number = input.nextInt(); reverse(number); } public static void reverse(int number) { while (number != 0) { int remainder = number % 10; System.out.print(remainder); number = number / 10; } System.out.println(); } }" "import java.util.Scanner; /** * * @author 65FBEF05E01FAC390CB3FA073FB3E8CF (452BF208BF901322968557227B8F6EFE010) */ public class T05 { public static void main(String[] args) { Scanner s = new Scanner(System.in); System.out.print(""Enter a integer: ""); int a = s.nextInt(); reverse(a); } public static void reverse(int number) { String temp=String.valueOf(number); for(int i=temp.length();i>0;i--){ System.out.print(temp.charAt(i-1)); } } }" False The two code samples have different implementations for the reverse method, with Sample 1 using modulo arithmetic and Sample 2 using string manipulation, indicating distinct approaches to solving the problem. Additionally, the coding styles, variable names, and overall structure differ sufficiently to suggest these are independent solutions rather than a case of direct copying.
-"public class T5 { public static void main(String[] args) { System.out.print(""Enter an integer: ""); java.util.Scanner input = new java.util.Scanner(System.in); int number = input.nextInt(); reverse(number); } public static void reverse(int number) { while (number != 0) { int remainder = number % 10; System.out.print(remainder); number = number / 10; } System.out.println(); } }" "import java.util.Scanner; /** * * @author CB6AB3315634A1E4D11B091BA48B60BA */ public class Nomor5_2451041557A22145B3701B0184109CAB013 { /** * @param args the command line arguments */ public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.print(""Enter an integer : ""); int number = sc.nextInt(); reverse(number); } public static void reverse(int number){ String strNumber = Integer.toString(number); String temp = """"; for(int i = strNumber.length(); i>0;i--){ temp +=i; } int tempNumber = Integer.parseInt(temp); System.out.println((tempNumber)); } }" False The core logic for reversing the number is fundamentally different between the two samples: the first uses a mathematical approach with modulo and division operations, while the second converts the number to a string and reverses it using string manipulation. Additionally, the implementation details, such as the loop structure and variable handling, are distinct enough to suggest independent development rather than copying.
-"public class T5 { public static void main(String[] args) { System.out.print(""Enter an integer: ""); java.util.Scanner input = new java.util.Scanner(System.in); int number = input.nextInt(); reverse(number); } public static void reverse(int number) { while (number != 0) { int remainder = number % 10; System.out.print(remainder); number = number / 10; } System.out.println(); } }" "public class L1 { public static void main(String[] args) { System.out.print(""Enter an integer: ""); java.util.Scanner input = new java.util.Scanner(System.in); int number = input.nextInt(); reverse(number); } public static void reverse(int number) { while (number != 0) { int remainder = number % 10; System.out.print(remainder); number = number / 10; } System.out.println(); } }" True The code samples are identical in structure, logic, variable names, and even formatting, with only the class names differing (T5 vs L1). Such a high degree of similarity, including identical implementation details and coding style, is extremely unlikely to occur independently and strongly indicates that one code sample was copied from the other or both were copied from a common source.
-"public class T5 { public static void main(String[] args) { System.out.print(""Enter an integer: ""); java.util.Scanner input = new java.util.Scanner(System.in); int number = input.nextInt(); reverse(number); } public static void reverse(int number) { while (number != 0) { int remainder = number % 10; System.out.print(remainder); number = number / 10; } System.out.println(); } }" "public class L2 { public static void main(String[] args) { System.out.print(""Enter an integer: ""); java.util.Scanner input = new java.util.Scanner(System.in); int nomor = input.nextInt(); balik(nomor); } public static void balik(int nomor) { while (nomor != 0) { int sisa = nomor % 10; System.out.print(sisa); nomor = nomor / 10; } System.out.println(); } }" True The two code samples are nearly identical in structure, logic, and implementation, with only superficial differences in naming conventions for classes, methods, and variables. This level of similarity, where even the algorithm and coding style are exactly the same, strongly indicates that one code sample was copied from the other with minimal alterations to disguise the plagiarism.
-"public class T5 { public static void main(String[] args) { System.out.print(""Enter an integer: ""); java.util.Scanner input = new java.util.Scanner(System.in); int number = input.nextInt(); reverse(number); } public static void reverse(int number) { while (number != 0) { int remainder = number % 10; System.out.print(remainder); number = number / 10; } System.out.println(); } }" "public class L3 { public static void main(String[] args) { int nomor = 0; System.out.print(""Enter an integer: ""); java.util.Scanner input = new java.util.Scanner(System.in); nomor = input.nextInt(); balik(nomor); } public static void balik(int nomor) { int sisa = 0 ; while (nomor != 0) { sisa = nomor % 10; System.out.print(sisa); nomor = nomor / 10; } System.out.println(); } }" True The two code samples exhibit nearly identical structure, logic, and algorithm for reversing an integer, with only superficial differences in naming conventions and minor implementation details. These similarities, combined with what appear to be deliberate attempts to disguise the code through minimal changes, strongly suggest that the second sample is derived from the first, indicating plagiarism.
-"public class T5 { public static void main(String[] args) { System.out.print(""Enter an integer: ""); java.util.Scanner input = new java.util.Scanner(System.in); int number = input.nextInt(); reverse(number); } public static void reverse(int number) { while (number != 0) { int remainder = number % 10; System.out.print(remainder); number = number / 10; } System.out.println(); } }" "public class L4 { public static void main(String[] args) { int nomor = 0; System.out.print(""Enter an integer: ""); java.util.Scanner input = new java.util.Scanner(System.in); nomor = input.nextInt(); int sisa = 0 ; while (nomor != 0) { sisa = nomor % 10; System.out.print(sisa); nomor = nomor / 10; } System.out.println(); } }" True The two code samples exhibit nearly identical logic, structure, and functionality for reversing an integer, including the same approach to input, digit extraction, and output. Despite minor differences in variable names and method organization, the core algorithm and even some verbatim code segments are so similar that it strongly suggests one sample was derived from the other or both from a common source, indicating likely plagiarism.
-"public class T5 { public static void main(String[] args) { System.out.print(""Enter an integer: ""); java.util.Scanner input = new java.util.Scanner(System.in); int number = input.nextInt(); reverse(number); } public static void reverse(int number) { while (number != 0) { int remainder = number % 10; System.out.print(remainder); number = number / 10; } System.out.println(); } }" "public class L5 { public static void main(String[] args) { int nomor, sisa = 0; System.out.print(""Enter an integer: ""); java.util.Scanner input = new java.util.Scanner(System.in); nomor = input.nextInt(); while (nomor!=0) { sisa = nomor % 10; System.out.print(sisa); nomor = nomor / 10; } System.out.println(); } }" True The two code samples share identical core logic for reversing a number, including the same algorithm structure and even identical lines of code for user input. While there are minor differences in variable names and method organization, the overwhelming similarities in implementation and problem-solving approach strongly indicate that one sample was derived from the other or both came from a common source.
-"public class T5 { public static void main(String[] args) { System.out.print(""Enter an integer: ""); java.util.Scanner input = new java.util.Scanner(System.in); int number = input.nextInt(); reverse(number); } public static void reverse(int number) { while (number != 0) { int remainder = number % 10; System.out.print(remainder); number = number / 10; } System.out.println(); } }" "public class L6_fix { public static void main(String[] args) { int nomor, sisa = 0; System.out.print(""Enter an integer: ""); java.util.Scanner input = new java.util.Scanner(System.in); nomor = input.nextInt(); while (nomor!=0) { if (nomor!=0){ sisa = nomor % 10; System.out.print(sisa); nomor = nomor / 10;} } System.out.println(); } }" True "The code samples exhibit plagiarism due to their identical input prompts, use of the full ""java.util.Scanner"" class name, and fundamentally identical logic for reversing integers using modulo and division operations. While superficial changes were made in variable names and method structure, the core implementation remains essentially the same, suggesting that the second sample (L6_fix) is a modified version of the first (T5) with attempts to disguise the copying."
-"public class T6 { public static void main(String[] args) { java.util.Scanner input = new java.util.Scanner(System.in); int[] num = new int[10]; for (int i = 0; i < 10; i++) { // Read a number System.out.print(""Read a number: ""); num[i] = input.nextInt(); } // Display the array for (int i = 9; i >= 0; i--) { System.out.println(num[i]); } } }" "import java.util.Scanner; /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ /** * * @author CB6AB3315634A1E4D11B091BA48B60BA 7E51EEA5FA101ED4DADE9AD3A7A072BB 2F809B10D1ABEDBF2EC288F851B3EBBB */ public class T06 { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int[] input = new int[10]; for(int i = 0; i < input.length; i++){ System.out.print(""Read a number: ""); input[i] = sc.nextInt(); } for(int i = 9; i >= 0; i--){ System.out.println(input[i]); } } }" False Upon closer examination, these code samples are not instances of plagiarism, but rather independent solutions to a common programming problem. The similarities can be attributed to standard Java syntax, typical beginner coding patterns, and likely shared problem specifications, while the differences in implementation details and structure indicate distinct authorship.
-"public class T6 { public static void main(String[] args) { java.util.Scanner input = new java.util.Scanner(System.in); int[] num = new int[10]; for (int i = 0; i < 10; i++) { // Read a number System.out.print(""Read a number: ""); num[i] = input.nextInt(); } // Display the array for (int i = 9; i >= 0; i--) { System.out.println(num[i]); } } }" "import java.util.Scanner; /** * * @author 65FBEF05E01FAC390CB3FA073FB3E8CF (452BF208BF901322968557227B8F6EFE010) */ public class T06 { public static void main(String[] args) { Scanner s = new Scanner(System.in); int[] a=new int[10]; for(int i=0;i<10;i++){ System.out.print(""Read a number: ""); a[i]=s.nextInt(); } for(int i=9;i>=0;i--){ System.out.println(a[i]); } } }" False Basic programming exercises often lead to similar solutions, especially when dealing with fundamental concepts like array manipulation and input/output operations in Java. The similarities between these two code samples are more likely due to the nature of the problem and the constraints of the Java language, rather than plagiarism, as both implement a common beginner's task of reading and reversing a fixed number of inputs using standard programming constructs.
-"public class T6 { public static void main(String[] args) { java.util.Scanner input = new java.util.Scanner(System.in); int[] num = new int[10]; for (int i = 0; i < 10; i++) { // Read a number System.out.print(""Read a number: ""); num[i] = input.nextInt(); } // Display the array for (int i = 9; i >= 0; i--) { System.out.println(num[i]); } } }" "import java.util.Scanner; /** * * @author CB6AB3315634A1E4D11B091BA48B60BA */ public class Nomor6_2451041557A22145B3701B0184109CAB013 { /** * @param args the command line arguments */ public static void main(String[] args) { Scanner sc = new Scanner(System.in); int Array[] = new int[10]; for(int i = 0 ; i<10;i++){ System.out.print(""Read a number: ""); Array[i] = sc.nextInt(); } for(int i = 9 ; i >= 0 ; i--){ System.out.println(Array[i]); } } }" False These code samples are not plagiarism because they're solutions to a common beginner programming problem with limited implementation options in Java. The similarities stem from standard Java conventions and the problem's constraints, not from copying. Despite structural parallels, differences in class names, variable naming, and code style indicate independent development by different individuals solving the same basic task.
-"public class T6 { public static void main(String[] args) { java.util.Scanner input = new java.util.Scanner(System.in); int[] num = new int[10]; for (int i = 0; i < 10; i++) { // Read a number System.out.print(""Read a number: ""); num[i] = input.nextInt(); } // Display the array for (int i = 9; i >= 0; i--) { System.out.println(num[i]); } } }" "public class L1 { public static void main(String[] args) { java.util.Scanner input = new java.util.Scanner(System.in); int[] num = new int[10]; for (int i = 0; i < 10; i++) { System.out.print(""Read a number: ""); num[i] = input.nextInt(); } for (int i = 9; i >= 0; i--) { System.out.println(num[i]); } } }" True The code samples are nearly identical in structure, logic, and functionality, with only trivial differences in class names and formatting. Such a high degree of similarity, especially in variable names, loop structures, and even the specific input prompt wording, is extremely unlikely to occur independently and strongly indicates that one code sample was directly copied from the other with minimal alterations.
-"public class T6 { public static void main(String[] args) { java.util.Scanner input = new java.util.Scanner(System.in); int[] num = new int[10]; for (int i = 0; i < 10; i++) { // Read a number System.out.print(""Read a number: ""); num[i] = input.nextInt(); } // Display the array for (int i = 9; i >= 0; i--) { System.out.println(num[i]); } } }" "public class L2_6 { public static void main(String[] args) { java.util.Scanner sc = new java.util.Scanner(System.in); int[] angka = new int[10]; for (int i = 0; i < 10; i++) { System.out.print(""Read a number: ""); angka[i] = sc.nextInt(); } for (int i = 9; i >= 0; i--) { System.out.println(angka[i]); } } }" True The code samples exhibit nearly identical structure, logic, and implementation, including the same array size, input method, loop structures, and even the same input prompt. While variable and class names differ slightly, these minor changes are insufficient to disguise the overwhelming similarities in the core functionality and coding approach, strongly suggesting that one sample was derived from the other or both from a common source.
-"public class T6 { public static void main(String[] args) { java.util.Scanner input = new java.util.Scanner(System.in); int[] num = new int[10]; for (int i = 0; i < 10; i++) { // Read a number System.out.print(""Read a number: ""); num[i] = input.nextInt(); } // Display the array for (int i = 9; i >= 0; i--) { System.out.println(num[i]); } } }" "import java.util.*; public class L3 { public static void main(String[] args) { int[] angka = new int[10]; Scanner sc = new java.util.Scanner(System.in); for (int i = 0; i < 10; i++) { System.out.print(""Read a number: ""); angka[i] = sc.nextInt(); } for (int i = 9; i >= 0; i--) { System.out.println(angka[i]); } } }" True The two code samples exhibit identical logic, structure, and functionality, with only superficial differences in variable names and minor formatting. The level of similarity in the implementation details, including the exact loop structures and output logic, strongly suggests that one code sample was derived from the other with minimal alterations, rather than being independently developed.
-"public class T6 { public static void main(String[] args) { java.util.Scanner input = new java.util.Scanner(System.in); int[] num = new int[10]; for (int i = 0; i < 10; i++) { // Read a number System.out.print(""Read a number: ""); num[i] = input.nextInt(); } // Display the array for (int i = 9; i >= 0; i--) { System.out.println(num[i]); } } }" "import java.util.*; public class L4 { public static void print (int [] arr) { for (int i = 9; i >= 0; i--) { System.out.println(arr[i]); } } public static void main(String[] args) { int[] angka = new int[10]; Scanner sc = new java.util.Scanner(System.in); for (int i = 0; i < 10; i++) { System.out.print(""Read a number: ""); angka[i] = sc.nextInt(); } print(angka); } }" True The two code samples share identical core logic, including the exact same user prompt and reverse array printing mechanism, which is unlikely to occur independently. While there are minor differences in structure and naming, these appear to be surface-level changes that don't alter the fundamental approach, suggesting one solution was likely derived from or heavily influenced by the other.
-"public class T6 { public static void main(String[] args) { java.util.Scanner input = new java.util.Scanner(System.in); int[] num = new int[10]; for (int i = 0; i < 10; i++) { // Read a number System.out.print(""Read a number: ""); num[i] = input.nextInt(); } // Display the array for (int i = 9; i >= 0; i--) { System.out.println(num[i]); } } }" "import java.util.*; public class L5 { public static void print(int[] arr) { int i = 9; while (i >= 0) { System.out.println(arr[i]); i--; } } public static void main(String[] args) { int[] angka = new int[10]; Scanner sc = new java.util.Scanner(System.in); int i = 0; while (i != 10) { System.out.print(""Read a number: ""); angka[i] = sc.nextInt(); i++; } print(angka); } }" True "These code samples exhibit clear signs of plagiarism due to their identical core logic, specific implementation choices, and the use of the exact same unique input prompt ""Read a number: "". While there are superficial differences in loop structures and method organization, these appear to be attempts to disguise the copying rather than indications of independent work."
-"public class T6 { public static void main(String[] args) { java.util.Scanner input = new java.util.Scanner(System.in); int[] num = new int[10]; for (int i = 0; i < 10; i++) { // Read a number System.out.print(""Read a number: ""); num[i] = input.nextInt(); } // Display the array for (int i = 9; i >= 0; i--) { System.out.println(num[i]); } } }" "import java.util.*; public class L6 { public static void print(int[] arr) { int i = 9; int j = 0; while (j < 10) { System.out.println(arr[i]); i--; j++; } } public static void main(String[] args) { int[] angka = new int[10]; Scanner sc = new java.util.Scanner(System.in); int i = 0; while (i != 10) { System.out.print(""Read a number: ""); angka[i] = sc.nextInt(); i++; } print(angka); } }" True The two code samples exhibit clear signs of plagiarism due to their nearly identical structure, logic, and even specific text elements like the input prompt. While Sample 2 attempts to disguise the copying through superficial changes such as different loop types and method organization, the core solution remains fundamentally the same, indicating that one was derived from the other or both from a common source.
-"import java.util.Scanner; public class T7 { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print(""Enter a 4 by 4 matrix row by row: ""); double[][] m = new double[4][4]; for (int i = 0; i < 4; i++) for (int j = 0; j < 4; j++) m[i][j] = input.nextDouble(); System.out.print(""Sum of the elements in the major diagonal is "" + sumMajorDiagonal(m)); } public static double sumMajorDiagonal(double[][] m) { double sum = 0; for (int i = 0; i < m.length; i++) sum += m[i][i]; return sum; } }" "import java.util.Scanner; /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ /** * * @author CB6AB3315634A1E4D11B091BA48B60BA 7E51EEA5FA101ED4DADE9AD3A7A072BB 2F809B10D1ABEDBF2EC288F851B3EBBB */ public class T07 { public static void main(String[] args){ Scanner sc = new Scanner(System.in); double[][] m = new double[4][4]; System.out.println(""Enter a 4-by-4 matrix row by row: ""); for(int i = 0; i < m.length; i++){ for(int j = 0; j < m[0].length; j++){ m[i][j] = sc.nextDouble(); } } System.out.println(""Sum of the elements in the major diagonal is "" + sumMajorDiagonal(m)); } public static double sumMajorDiagonal(double[][] m){ double sum = 0; for(int i = 0; i < m.length; i++){ sum += m[i][i]; } return sum; } }" False While the code samples share similarities due to addressing the same problem (summing the major diagonal of a 4x4 matrix), they exhibit differences in implementation details, coding style, and variable naming conventions that suggest independent development rather than direct plagiarism.
-"import java.util.Scanner; public class T7 { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print(""Enter a 4 by 4 matrix row by row: ""); double[][] m = new double[4][4]; for (int i = 0; i < 4; i++) for (int j = 0; j < 4; j++) m[i][j] = input.nextDouble(); System.out.print(""Sum of the elements in the major diagonal is "" + sumMajorDiagonal(m)); } public static double sumMajorDiagonal(double[][] m) { double sum = 0; for (int i = 0; i < m.length; i++) sum += m[i][i]; return sum; } }" "import java.util.Scanner; /** * * @author 65FBEF05E01FAC390CB3FA073FB3E8CF (452BF208BF901322968557227B8F6EFE010) */ public class T07 { public static void main(String[] args) { Scanner s = new Scanner(System.in); System.out.println(""Enter a 4-by-4 matrix row by row:""); double[][] m=new double[4][4]; for(int i=0;i<4;i++){ for(int j=0;j<4;j++){ m[i][j]=s.nextDouble(); } } System.out.println(""Sum of the elements in the major diagonal is ""+sumMajorDiagonal(m)); } public static double sumMajorDiagonal(double[][] m){ double temp=0; for(int i=0;i<4;i++){ for(int j=0;j<4;j++){ if(i==j){ temp=temp+m[i][j]; } } } return temp; } }" False The code samples show significant differences in implementation details, particularly in the sumMajorDiagonal method, and in coding style, suggesting independent problem-solving approaches rather than direct copying. While there are similarities in overall structure and problem statement, these are largely expected given the specific nature of the programming task and the constraints of the Java language.
-"import java.util.Scanner; public class T7 { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print(""Enter a 4 by 4 matrix row by row: ""); double[][] m = new double[4][4]; for (int i = 0; i < 4; i++) for (int j = 0; j < 4; j++) m[i][j] = input.nextDouble(); System.out.print(""Sum of the elements in the major diagonal is "" + sumMajorDiagonal(m)); } public static double sumMajorDiagonal(double[][] m) { double sum = 0; for (int i = 0; i < m.length; i++) sum += m[i][i]; return sum; } }" "import java.util.Scanner; /** * * @author ASUS */ public class Nomor7_2451041557A22145B3701B0184109CAB013 { /** * @param args the command line arguments */ public static void main(String[] args) { Scanner sc = new Scanner(System.in); int [][] matrix = new int [4][4]; int sum =0; System.out.println(""Enter a 4-by-4 matrix row by row: ""); for(int i =0 ;i<4;i++){ for(int j=0;j<4;j++){ matrix[i][j]= sc.nextInt(); if(i==j){ sum += matrix[i][j]; } } } System.out.println(""Sum of the elements in the major diagonal is ""+sum); } }" False These code samples are not plagiarism because they use distinctly different implementations to solve the same problem, including separate methods vs. inline calculation, different data types, and unique looping structures. While they share the common goal of summing a matrix's diagonal, the differences in coding style, variable names, and overall structure indicate they are independent solutions to a standard programming exercise.
-"import java.util.Scanner; public class T7 { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print(""Enter a 4 by 4 matrix row by row: ""); double[][] m = new double[4][4]; for (int i = 0; i < 4; i++) for (int j = 0; j < 4; j++) m[i][j] = input.nextDouble(); System.out.print(""Sum of the elements in the major diagonal is "" + sumMajorDiagonal(m)); } public static double sumMajorDiagonal(double[][] m) { double sum = 0; for (int i = 0; i < m.length; i++) sum += m[i][i]; return sum; } }" "import java.util.*; public class L1 { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print(""Enter a 4 by 4 matrix row by row: ""); double[][] m = new double[4][4]; for (int i = 0; i < 4; i++) { for (int j = 0; j < 4; j++) { m[i][j] = input.nextDouble(); } } System.out.print(""Sum of the elements in the major diagonal is "" + sumMajorDiagonal(m)); } public static double sumMajorDiagonal(double[][] m) { double sum = 0; for (int i = 0; i < m.length; i++) { sum += m[i][i]; } return sum; } }" True The two code samples have nearly identical structure, logic, and even verbatim text in comments and output statements, with only minor differences in formatting and class names. This level of similarity is highly unlikely to occur independently and strongly indicates that one sample was copied from the other with minimal changes, or both were derived from a common source.
-"import java.util.Scanner; public class T7 { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print(""Enter a 4 by 4 matrix row by row: ""); double[][] m = new double[4][4]; for (int i = 0; i < 4; i++) for (int j = 0; j < 4; j++) m[i][j] = input.nextDouble(); System.out.print(""Sum of the elements in the major diagonal is "" + sumMajorDiagonal(m)); } public static double sumMajorDiagonal(double[][] m) { double sum = 0; for (int i = 0; i < m.length; i++) sum += m[i][i]; return sum; } }" "import java.util.*; public class L2 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.print(""Enter a 4 by 4 matrix row by row: ""); double[][] m = new double[4][4]; for (int i = 0; i < 4; i++) { for (int j = 0; j < 4; j++) { m[i][j] = sc.nextDouble(); } } System.out.print(""Sum of the elements in the major diagonal is "" + jumlahDiagonal(m)); } public static double jumlahDiagonal(double[][] m) { double sum = 0; for (int i = 0; i < m.length; i++) { sum += m[i][i]; } return sum; } }" True These code samples exhibit plagiarism due to their nearly identical structure, logic, and implementation, including matching user prompts, matrix handling, and diagonal sum calculation methods. The minimal differences, such as variable names and formatting, appear to be superficial attempts to disguise the copying, rather than evidence of independent problem-solving approaches.
-"import java.util.Scanner; public class T7 { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print(""Enter a 4 by 4 matrix row by row: ""); double[][] m = new double[4][4]; for (int i = 0; i < 4; i++) for (int j = 0; j < 4; j++) m[i][j] = input.nextDouble(); System.out.print(""Sum of the elements in the major diagonal is "" + sumMajorDiagonal(m)); } public static double sumMajorDiagonal(double[][] m) { double sum = 0; for (int i = 0; i < m.length; i++) sum += m[i][i]; return sum; } }" "import java.util.*; public class L3 { public static double jumlahDiagonal(double[][] m) { double sum = 0; for (int i = 0; i < m.length; i++) { sum += m[i][i]; } return sum; } public static void main(String[] args) { Scanner sc = new Scanner(System.in); double[][] m = new double[4][4]; System.out.print(""Enter a 4 by 4 matrix row by row: ""); for (int i = 0; i < 4; i++) { for (int j = 0; j < 4; j++) { m[i][j] = sc.nextDouble(); } } System.out.print(""Sum of the elements in the major diagonal is "" + jumlahDiagonal(m)); } }" True The two code samples exhibit nearly identical structure, logic, and implementation for solving the same problem, with only minor differences in variable names and method naming. The high degree of similarity in both the overall approach and specific code details, including the exact same matrix size and input prompts, strongly suggests that one sample was derived from the other with only superficial modifications.
-"import java.util.Scanner; public class T7 { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print(""Enter a 4 by 4 matrix row by row: ""); double[][] m = new double[4][4]; for (int i = 0; i < 4; i++) for (int j = 0; j < 4; j++) m[i][j] = input.nextDouble(); System.out.print(""Sum of the elements in the major diagonal is "" + sumMajorDiagonal(m)); } public static double sumMajorDiagonal(double[][] m) { double sum = 0; for (int i = 0; i < m.length; i++) sum += m[i][i]; return sum; } }" "import java.util.*; public class L4 { public static double jumlahDiagonal(double[][] m) { double sum = 0; for (int i = 0; i < m.length; i++) { sum += m[i][i]; } return sum; } public static void print(double[][] m) { System.out.print(""Sum of the elements in the major diagonal is "" + jumlahDiagonal(m)); } public static void main(String[] args) { Scanner sc = new Scanner(System.in); double[][] m = new double[4][4]; System.out.println(""Enter a 4 by 4 matrix row by row: ""); for (int i = 0; i < 4; i++) { for (int j = 0; j < 4; j++) { m[i][j] = sc.nextDouble(); } } print(m); } }" True The two code samples exhibit nearly identical logic, structure, and even wording in output messages, which is highly unlikely to occur independently. While there are minor differences in naming and code organization, the core implementation - especially the method for summing the diagonal elements - is almost exactly the same, strongly suggesting that one sample was derived from the other or both were derived from a common source.
-"import java.util.Scanner; public class T7 { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print(""Enter a 4 by 4 matrix row by row: ""); double[][] m = new double[4][4]; for (int i = 0; i < 4; i++) for (int j = 0; j < 4; j++) m[i][j] = input.nextDouble(); System.out.print(""Sum of the elements in the major diagonal is "" + sumMajorDiagonal(m)); } public static double sumMajorDiagonal(double[][] m) { double sum = 0; for (int i = 0; i < m.length; i++) sum += m[i][i]; return sum; } }" "import java.util.*; public class L5 { public static double jumlahDiagonal(double[][] m) { double sum = 0; int hit = 0; while (hit != m.length) { sum += m[hit][hit]; hit++; } return sum; } public static void print(double[][] m) { System.out.print(""Sum of the elements in the major diagonal is "" + jumlahDiagonal(m)); } public static void main(String[] args) { Scanner sc = new Scanner(System.in); double[][] m = new double[4][4]; System.out.println(""Enter a 4 by 4 matrix row by row: ""); for (int i = 0; i < 4; i++) { for (int j = 0; j < 4; j++) { m[i][j] = sc.nextDouble(); } } print(m); } }" True These code samples represent clear plagiarism despite superficial attempts to disguise it. The core algorithm, problem-solving approach, and even specific output formatting are identical, revealing that one sample was directly copied from the other. The minor changes made, such as renaming variables and altering loop structures, are typical tactics used to mask plagiarism but do not change the fundamental similarity of the code.
-"import java.util.Scanner; public class T7 { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print(""Enter a 4 by 4 matrix row by row: ""); double[][] m = new double[4][4]; for (int i = 0; i < 4; i++) for (int j = 0; j < 4; j++) m[i][j] = input.nextDouble(); System.out.print(""Sum of the elements in the major diagonal is "" + sumMajorDiagonal(m)); } public static double sumMajorDiagonal(double[][] m) { double sum = 0; for (int i = 0; i < m.length; i++) sum += m[i][i]; return sum; } }" "import java.util.*; public class L6 { public static double jumlahDiagonal(double[][] m) { double sum = 0; int hit = m.length-1; while (hit >= 0) { sum += m[hit][hit]; hit--; } return sum; } public static void print(double[][] m) { System.out.print(""Sum of the elements in the major diagonal is "" + jumlahDiagonal(m)); } public static void main(String[] args) { Scanner sc = new Scanner(System.in); double[][] m = new double[4][4]; System.out.println(""Enter a 4 by 4 matrix row by row: ""); for (int i = 3; i >= 0 ; i--) { for (int j = 3; j >= 0; j--) { m[i][j] = sc.nextDouble(); } } print(m); } }" True These code samples show clear signs of plagiarism despite superficial differences. The overall structure, problem approach, and key phrases (like input and output messages) are nearly identical, indicating the second sample was likely derived from the first. The changes made, such as different method names and loop directions, appear to be attempts to disguise the plagiarism rather than evidence of independent implementation.