1
1
Fork 0

Moved solution1 file for 'resource cleanup' to 'DataFiles' directory

This commit is contained in:
Svetlana Isakova 2020-10-20 12:57:44 +02:00
parent 4096e37e84
commit 29e1e4fb1a
6 changed files with 8 additions and 12 deletions

1
.gitignore vendored
View File

@ -5,4 +5,3 @@
/**/out
simpleLogFile.txt
DataFiles/*
Soln1.txt

View File

@ -1,2 +0,0 @@
Swing low, sweet chariot
Coming for to carry me home

View File

@ -8,7 +8,7 @@ Coming for to carry me home
""".trim()
fun writeAndRead() {
val f = File("Soln1.txt")
val f = File("DataFiles/CleanupSoln1.txt")
if(f.exists())
f.delete()
f.createNewFile()

View File

@ -4,7 +4,7 @@ files:
visible: true
placeholders:
- offset: 200
length: 178
length: 195
placeholder_text: TODO()
- name: test/Tests.kt
visible: false

View File

@ -2,11 +2,12 @@
The starter code defines a `String` called `text`. Define a `writeAndRead()`
function that uses `java.io.File`. Create a `File` object initialized to
`"Soln1.txt"`. Delete the file if it exists. Then create it, and add `text` to
the file (IntelliJ IDEA will give you hints to help choose the member functions
to call for `File`). Use `useLines()` to read the file and display it with
`println()`, then use `forEachLine()` to read the file and display it with
`println()`. The starter code in `main()` tests `writeAndRead()`.
`"DataFiles/CleanupSoln1.txt"`. Delete the file if it exists. Then create it,
and add `text` to the file (IntelliJ IDEA will give you hints to help choose
the member functions to call for `File`). Use `useLines()` to read the file and
display it with `println()`, then use `forEachLine()` to read the file and
display it with `println()`. The starter code in `main()` tests
`writeAndRead()`.
<sub> This task doesn't contain automatic tests,
so it's always marked as "Correct" when you run "Check".

View File

@ -1,2 +0,0 @@
Swing low, sweet chariot
Coming for to carry me home