Q1_20251109103401.webp
May76

Q1_20251109103401.webp

  • Media owner May76
  • Ngày thêm
5 of 5
Paper No: 3
public String fl(String str);
public String f2(String str);
Write a class named MyFile, which implements the interface IFile. The class MyFile implements
methods fl and 12 in IFile as below:
• f1: Returns the extension of the string which represent a path of file. If the string don't have the
extension of file return "wrong format".

f2: Return the new file name of the string which represent a path of file, with uppercase and add
prefix "New_" at the begin of file name, in otherwise return "wrong format".
The program output might look something like:
Enter file path:
c:\MyFile\data.txt
1. Test fl
2. Test f2
your choice:
1
OUTPUT:
txt
Enter file path:
c:\Myfile\data.txt
1. Test fl
2. Test f2
your choice:
2
OUTPUT:
New DATA.txt
PRO192 PE INSTRUCTIONS
Read the instructions below carefully before start coding.
Students are ONLY allowed to use:

Materials on his/her computer (including JDK, NetBeans...).
Zoom
• For distance learning: Google Meet, Hangout (for Exam Monitoring Purpose).
Follow the steps below to complete PE:
+ 100%
Close
Chưa có bình luận nào.

Thông tin

Category
PRO192
Thêm bởi
May76
Ngày thêm
Lượt xem
939
Lượt bình luận
0
Rating
0.00 star(s) 0 đánh giá

Share this media

Back
Bên trên Bottom