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

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

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

Post 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.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply