Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a program in IJVM Assembly Language, as expected by the mic1 IJVM Assemble

ID: 2266518 • Letter: W

Question

Write a program in IJVM Assembly Language, as expected by the mic1 IJVM Assembler, for a microwave controller. Your program will take a single digit input from the user and display the cooking time. It will run continuously and each time the user presses a numeric key between 0 and 9 it will output the corresponding ‘cook time’ in seconds. More specifically, it will display a hex value following the text ‘COOK TIME: ’ in the output window of the simulator. The times are in increments of 20 seconds (0 means 0 seconds, 1: 20 seconds, 2: 40 seconds etc.) Your program should include and make use of a method called mult that takes a single parameter and returns 20 times the value of the parameter. Write a program in IJVM Assembly Language, as expected by the mic1 IJVM Assembler, for a microwave controller. Your program will take a single digit input from the user and display the cooking time. It will run continuously and each time the user presses a numeric key between 0 and 9 it will output the corresponding ‘cook time’ in seconds. More specifically, it will display a hex value following the text ‘COOK TIME: ’ in the output window of the simulator. The times are in increments of 20 seconds (0 means 0 seconds, 1: 20 seconds, 2: 40 seconds etc.) Your program should include and make use of a method called mult that takes a single parameter and returns 20 times the value of the parameter.

Explanation / Answer

import java.awt.BorderLayout;
import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTextField;


public class Microwave extends JFrame {

public Microwave() {
JPanel p1 = new JPanel(new GridLayout(4, 3));

for (int i = 1; i <= 9; i++) {
p1.add(new JButton(" " + i));
}

p1.add(new JButton(" " + 0));
p1.add(new JButton("Start"));
p1.add(new JButton("Stop"));

JPanel p2 = new JPanel(new BorderLayout());
p2.add(new JTextField("Time to be displayed here"), BorderLayout.NORTH);
p2.add(p1, BorderLayout.CENTER);

add(new JButton("Food to be placed here"), BorderLayout.CENTER);
add(p2, BorderLayout.EAST);
}


public static void main(String[] args) {
Microwave mic = new Microwave();
mic.setTitle("The Front View of a Microwave Oven");
mic.pack();
mic.setResizable(false);
mic.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
mic.setLocationRelativeTo(null);
mic.setVisible(true);
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote