Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Among other things, the purpose of this assignment is to assess the student's ability to write a program dealing with methods, variables, types, and operators.
Among other things, the purpose of this assignment is to assess the student's ability to write a program dealing with methods, variables, types, and operators. PROGRAM SPECIFICATIONS Beginning with the files that you have downloaded named Proj02.java and Proj02Skeleton.txt, create a new file named Proj02Runner.java to meet the specifications given below. Note that you must not modify the code in the file named Proj02.java. You may rename and modify the code in the file named Proj02Skeleton.txt to produce the required output if you choose to do so. If you take that approach, rename the file Proj02Runner.java and see the additional instructions below. Be sure to display your name in the output where indicated. When you place both files in the same folder, compile them both, and run the file named Proj02.java, the program must display the text shown below on the command line screen. The numeric output values are based on a random number generator and will differ from one run to the next. However, in all cases, the first two numbers must match and must be one less than the third number. 128 I certify that this program is my own work and is not the work of others. I agree not to share my solution with others. Replace this line with your name 128 |129EEEE= Additional Instructions=EEEE The program structure required by this assignment consists of two class files that work together to produce the required output. The file named Proj02Skeleton.txt is provided to help you create that structure. You may find the following steps useful in helping you to understand the structure and to write a correct solution for the assignment. 1. Copy the files named Proj02.java and Proj02Skeleton.txt into an empty folder. 2. Change the name of Proj02Skeleton.txt to Proj02Runner.java 3. Study the code in the file named Proj02 very carefully. Make certain that you understand and can explain the behavior of the last three statements in that code. (You don't need to understand the code that generates the random number at this point as long as you understand the comments. ) If there is something that you don't understand in that code, please let me know. 4. Study the code in the file named Proj02Runner very carefully. Make certain that you understand and can explain the behavior of every statement in that code. If there is something that you don't understand in that code, please let me know. 5. Think about how the code in the file named Proj02Runner fits or meshes with (or should fit and mesh with) the code in the file named Proj02, taking into account that the code in the file named Proj02 will be executed first. The code in the file named Proj02Runner will be executed under control of the code in the file named Proj02. 6. Try to compile the file named Proj02.java. You will get the following error indicating that the two sets of code do not fit or mesh perfectly. (Note that the line number may differ from that shown below.) Proj02Runner . java: 14: error: incompatible types: possible lossy conversion from int to byte byte myVar = valIn; 1 error 7. Modify the code in the file named Proj02Runner to eliminate that error when you compile the file named Proj02.java. When you are successful in eliminating that error, you should have created the files named Proj02.class and Proj02Runner.class in that same folder with no compiler errors. 8. Run the file named Proj02.class and observe the output. 9. Read the above specifications VERY CAREFULLY and compare the required output with the actual output. 10. Make any other modifications that may be needed to the file named Proj02Runner.java to cause your output to meet those specifications. Pay particular attention to the required numeric values. 11. Study the structure and the relationship between the two files and make certain that you understand it. Most of your assignments in this course will be based on this general structure
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started