You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
zanninso e9ff17d6b6
docs: adding subjects for quest2 of the java piscine (#2002)
1 year ago
..
README.md docs: adding subjects for quest2 of the java piscine (#2002) 1 year ago
input.txt docs: adding subjects for quest2 of the java piscine (#2002) 1 year ago
result.txt docs: adding subjects for quest2 of the java piscine (#2002) 1 year ago

README.md

Capitalize

Instructions

Create a file named Capitalize.java.

Write a function capitalize that reads the text from a file given as the first parameter and writes the result to a file given as the second parameter.

Provided files

You can find the input and its result files to use for the test and to understand more what you have to do.

Expected Functions

import java.io.*;

public class Capitalize {
    public static void capitalize(String[] args) throws IOException {
        // your code here
    }
}

Usage

Here is a possible ExerciseRunner.java to test your function :

import java.io.*;

public class ExerciseRunner {
    public static void main(String[] args) throws IOException {
        Capitalize.capitalize(new String[]{"input", "output"});
        String expectedResult = new String(Files.readAllBytes(Paths.get("result")));
        String userOutput = new String(Files.readAllBytes(Paths.get("output")));
        System.out.println(expectedResult.equals(userOutput));
    }
}

and its output :

$ javac *.java -d build
$ java -cp build ExerciseRunner
true
$

Notions

Command-Line Arguments File String