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.
 
 
 
 
 
 
Abdelilah Khossan 42a8df96a9
docs(java piscine): Add missing imports to exercise runner for Capitalize subject (#2143)
1 year ago
..
README.md docs(java piscine): Add missing imports to exercise runner for Capitalize subject (#2143) 1 year ago
input.txt
result.txt

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.*;
import java.nio.file.Files;
import java.nio.file.Paths;

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