Skip to content

[MCW-01] | Mykyta Kalachuk | Necessary fixes to complete module control work task#5

Open
new-user888 wants to merge 1 commit intocomsys-kpi-ua:mainfrom
new-user888:MCW-01
Open

[MCW-01] | Mykyta Kalachuk | Necessary fixes to complete module control work task#5
new-user888 wants to merge 1 commit intocomsys-kpi-ua:mainfrom
new-user888:MCW-01

Conversation

@new-user888
Copy link
Copy Markdown

@new-user888 new-user888 commented Dec 17, 2025

Task

Variant Assignment

Variant: 9 (for student Mykyta Kalachuk)

Variant Calculations

  • C3 = 9 % 3 = 0 → Doubly-linked list
  • C5 = 9 % 5 = 4 → Hexadecimal (base-16) primary system
  • C7 = 9 % 13 = 9 → Convert to Binary (base-2) secondary system
  • Additional Operation (variant 9): Multiply list by constant = 9

What to do

Core Implementation

Node Structure

  • Inner class: Node
  • Fields:
    • byte data - stores the digit value
    • Node next - pointer to next node
    • Node prev - pointer to previous node
  • Type: Doubly-linked, linear (not circular)

Class Fields

  • Node head - first node in the list
  • Node tail - last node in the list
  • int size - number of elements
  • int radix - current number system (16 or 2)
Updated Makefile (To make "Make" be working on windows host)
SRC_MAIN := src/main/java
SRC_TEST := src/test/java
RES_TEST := src/test/resources

OUT_DIR := out
OUT_MAIN := $(OUT_DIR)/main
OUT_TEST := $(OUT_DIR)/test

LIB_DIR := lib
JUNIT := $(LIB_DIR)/junit-platform-console-standalone-6.0.1.jar

CLASSPATH_MAIN := $(OUT_MAIN):$(JUNIT)


.PHONY: all clean test compile compile-main compile-test help deps

help:
	@echo ""
	@echo "Available targets:"
	@echo "  help            Show this help message"
	@echo "  deps            Download dependencies (JUnit)"
	@echo "  compile         Compile main and test sources"
	@echo "  compile-main    Compile only main sources"
	@echo "  compile-test    Compile only test sources (depends on compile-main)"
	@echo "  test            Run JUnit tests"
	@echo "  clean           Remove build output"
	@echo ""


all: compile


compile: deps compile-main compile-test


compile-main:
	@echo "== Compiling main sources =="
	mkdir -p $(OUT_MAIN)
	javac -cp $(JUNIT) -d $(OUT_MAIN) $$(find $(SRC_MAIN) -name "*.java")


compile-test: compile-main
	@echo "== Compiling test sources =="
	mkdir -p $(OUT_TEST)
	javac -cp $(CLASSPATH_MAIN) -d $(OUT_TEST) $$(find $(SRC_TEST) -name "*.java")

	@echo "== Copying test resources =="
	@if [ -d $(RES_TEST) ]; then cp -r $(RES_TEST)/* $(OUT_TEST)/ 2>/dev/null || true; fi


test: compile
	@echo "== Running JUnit tests =="
	java -jar $(JUNIT) \
		execute \
	     --classpath "$(OUT_MAIN):$(OUT_TEST)" \
	     --scan-classpath

clean:
	rm -rf $(OUT_DIR)


deps: $(JUNIT)

$(JUNIT): | $(LIB_DIR)
	wget -q https://repo1.maven.org/maven2/org/junit/platform/junit-platform-console-standalone/6.0.1/junit-platform-console-standalone-6.0.1.jar \
	     -O $(JUNIT)
	@echo "Downloaded JUnit Platform Console 6.0.1"

$(LIB_DIR):
	mkdir -p $(LIB_DIR)
make test results
PS C:\Users\PC-USER\Desktop\java\mykyta\test-assignment> make test
"== Compiling main sources =="
"== Compiling test sources =="
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
"== Copying test resources =="
"== Running JUnit tests =="
java -jar lib/junit-platform-console-standalone-6.0.1.jar execute --classpath "out/main;out/test" --scan-classpath

Thanks for using JUnit! Support its development at https://junit.org/sponsoring

дек. 17, 2025 8:59:58 PM org.junit.platform.launcher.core.DiscoveryIssueNotifier logIssues
INFO: TestEngine with ID 'junit-vintage' encountered a non-critical issue during test discovery:

(1) [INFO] The JUnit Vintage engine is deprecated and should only be used temporarily while migrating tests to JUnit Jupiter or another testing framework with native JUnit Platform support..
+-- JUnit Platform Suite [OK]
+-- JUnit Jupiter [OK]
'-- JUnit Vintage [OK]
  +-- ScaleOfNotationChangeTest [OK]
  | +-- testToOctal [A] got: <false>, expected: is <true>      
  | +-- testToBinary [OK]
  | +-- testToHex [A] got: <false>, expected: is <true>        
  | +-- testToDecimal [OK]
  | '-- testToTernary [A] got: <false>, expected: is <true>    
  +-- AdditionalOperationTest [OK]
  | +-- testAND [A] got: <false>, expected: is <true>
  | +-- testAdd [A] got: <false>, expected: is <true>
  | +-- testDiv [A] got: <false>, expected: is <true>
  | +-- testMod [A] got: <false>, expected: is <true>
  | +-- testOR [A] got: <false>, expected: is <true>
  | +-- testMultiply [OK]
  | '-- testRemove [A] got: <false>, expected: is <true>       
  +-- FileListTest [OK]
  | +-- testWriteLongList [OK]
  | +-- testToString [OK]
  | +-- testEmptyFile [OK]
  | +-- testIncorrectFileName [OK]
  | +-- testFileExists [OK]
  | +-- testWriteSingleDigit [OK]
  | '-- testReadSingleDigit [OK]
  '-- StringListTest [OK]
    +-- testToString [OK]
    +-- testInvalidStringInput [OK]
    '-- testSingleDigit [OK]

Test run finished after 165 ms
[         7 containers found      ]
[         0 containers skipped    ]
[         7 containers started    ]
[         0 containers aborted    ]
[         7 containers successful ]
[         0 containers failed     ]
[        22 tests found           ]
[         0 tests skipped         ]
[        22 tests started         ]
[        9 tests aborted         ]
[        13 tests successful      ]
[         0 tests failed          ]

PS C:\Users\PC-USER\Desktop\java\mykyta\test-assignment> 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant