Page 1 of 1

Java Create a class named Problem1Einstein. In Einstein’s main(…) method, create a file named relativity.txt. The create

Posted: Wed Jul 06, 2022 10:15 am
by answerhappygod
Java
Create a class named Problem1Einstein. In Einstein’s main(…) method, create a file named relativity.txt. The created file should contain the text E=mc^2. The file will also report the ranks from a standard deck of cards in ascending order. The file’s content should be identical to the following:
E=mc^2
2
3
4
5
6
7
8
9
10
J
Q
K
You can hardcode the print statements as shown, no sorting will be necessary. Obviously, there is no relationship between Einstein and card decks – this is a file IO problem! The indentation shown above is simply for readability, each line should begin in column 1 in your generated file.