[SOLVED] CS220 Lab#9 -High Level Language

30 $

File Name: CS220_Lab#9_-High_Level_Language.zip
File Size: 301.44 KB

SKU: [Solved] CS220 Lab#9 -High Level Language Category: Tag:

Or Upload Your Assignment Here:


CS220_Lab09

Name: Date:

The Jack Programming Language

Standard Class Library

  1. Translate the following Java code into its equivalent Jack code.
Jack Code
Jack Code
  1. Write the Jack code that produces the following transaction with the user.Note: the green text indicates input from the user.
Jack Code
  1. Write the Jack code that produces the following transaction with the user.Note: the green text indicates input from the user.
Jack Code
  1. Translate the entire Main class (written in Java) into its Jack equivalent.
Jack Code
  1. Convert the following Java class (Fraction.java) into its Jack equivalent (two files/classes named Fraction.jack and Main.jack).
Jack Code
  1. Write a Jack program that will display a square (30 pixels x 30 pixels), starting in the top-left (x=0, y=0) of the screen, then moving around the edge of the screen clockwise (e.g. along the top edge, then right edge, bottom edge, left edge) until it gets back to the origin.

The square should move by itself, with a short wait between each movement.

Jack Code

Summative Questions:

  1. When we execute a Jack program, the first subroutine that starts running is:main()
  2. Can a subroutine in one Jack class access field variables of another Jack class?

No, unless you create getter methods.

  1. Which Jack classes should have a method for disposing objects?

All Jack classes should provide this.

  1. What does the keyword “this” implicitly refer to? (Select all that apply)
  2. In constructors: the current object
  3. In functions: the current object
  4. In methods: the current object
  5. In Main.main: the current object
  1. Which of the following are true about Jack classes? (Select all that apply)
  2. A Jack class must have a constructor
  3. A Jack class can contain either methods, or functions, but not both
  4. Each Jack class must be stored in a separate file
  5. Each Jack class must have a subroutine named “main”

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[SOLVED] CS220 Lab#9 -High Level Language
30 $