FileName reads one line containing a file name (it may contain spaces and always contains a dot) and prints facts about it, using only String methods — no if:
length, lastIndexOf, substring, toLowerCase, contains, equals, startsWith, trim, replace.
The tidy name is the base name without spaces around it, in lower case, with every space replaced by _, followed by the extension in lower case. For the input
Lab Report final.PDF
the program prints
Length: 20
Position of the last dot: 16
Base name: Lab Report final
Extension: pdf
Contains a space: true
Is a PDF: true
Starts with Lab: true
Tidy name: lab_report_final.pdf