Moved solution1 file for 'resource cleanup' to 'DataFiles' directory
This commit is contained in:
parent
4096e37e84
commit
29e1e4fb1a
|
@ -5,4 +5,3 @@
|
|||
/**/out
|
||||
simpleLogFile.txt
|
||||
DataFiles/*
|
||||
Soln1.txt
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
Swing low, sweet chariot
|
||||
Coming for to carry me home
|
|
@ -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()
|
||||
|
|
|
@ -4,7 +4,7 @@ files:
|
|||
visible: true
|
||||
placeholders:
|
||||
- offset: 200
|
||||
length: 178
|
||||
length: 195
|
||||
placeholder_text: TODO()
|
||||
- name: test/Tests.kt
|
||||
visible: false
|
||||
|
|
|
@ -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".
|
||||
|
|
Loading…
Reference in New Issue