Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Q1: Exercise on Byte Code 3 marks Jasmin is an app written in Java that allows you to assemble Java byte code. It runs with

Q1: Exercise on Byte Code 3 marks Jasmin is an app written in Java that allows you to assemble Java byte code. It runs with the Java Virtual Machine (java) like any other Java program, but all the code is collected into a jar file. You must give the -jar option to Java to let the Java Virtual Machine know the app is compressed. Krakatau is a Python program that allows you to both disassemble a class file and to assemble byte code into a Java class file. A. Temporarily rename the Jasmin .jar file to the .zip extension. Explore the contents of the directory. Count and report the total number of .class files and the name of the largest .class file and 2nd largest file. Locate and name the file that is in text form which gives information about the authors. Find out who the program was created by and what the version code and the version number is. B. Compile and run the hello world byte code sample provided with Krakatau and with Jasmin (see Lecture 2). Use xxd to determine the difference between the output of the two assemblers on your command terminal. C. Disassemble the original Java hello world program into the byte code from the .class file using JavaP. Modify the code so that it can be compiled with the Jasmin assembler Compile the code with Jasmin and run it to ensure it works correctly. Disassemble the .class file produced by Jasmin with Krakatau. Then modify this code so that it can be assembled back (without errors) using Jasmin. Disassemble the Frac class file using Krakatau. In the assembly file, modify the String member with the message about the Frac class to make it private. Submit answers of Q1 A in a PDF file called your_name_1A.pdf. Upload all the java and class files for Part B and Part C. Include the screenshots of the outputs from your shell. Outputs from your IDE won't be marked. Q2: Exercise on Implementing a class Marks 2 Modify the Frac class as follows A. Add a constructor that takes 2 integer arguments, a numerator and denominator B. Add a constructor that takes a floating-point number and converts it into the appropriate rational number C. Implement a member function that converts the fraction to a floatingpoint number D. Implement member functions which implement the basic arithmetic operators for any two rational numbers of your choice. Upload one JAVA file (Mod_Frac.java) with its class file that demonstrate each of the modifications made above. Include the screenshots of all the outputs from your shell in a PDF file called your_name_1A_Q2.pdf. Output from your IDE won't be marked. Q3: Exercise on Code Integration Marks 1. form your personal GitHub account, if you do not already have one. form a repository called FK_converter. Put your JAVA source code that converts the Fahrenheit degree temperature to Kelvin scale in your repository. Add your compiled class file, as well as any help files into your repository. Submit the screen shot of your A. Github home page with this repository. B. Repository that shows a listing of all the files. C. Output from your cmd line that shows the user prompt Fahrenheit input and the correct converted temperature in Kelvin. Save this work on a new PDF called your_name_1A_Q3.pdf and upload. Note: This problem was given as homework in Lecture 2. Make sure that your PDF file submissions are in the correct format provided for each question

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial Accounting Tools for Business Decision Making

Authors: Paul D. Kimmel, Jerry J. Weygandt, Donald E. Kieso, Barbara Trenholm, Wayne Irvine

6th Canadian edition

1118644948, 978-1118805084, 1118805089, 978-1118644942

More Books

Students also viewed these Programming questions

Question

69. In the match problem, say that (i, j),i Answered: 1 week ago

Answered: 1 week ago

Question

Given find the value of k. es 1 e kx dx = 1 4'

Answered: 1 week ago