Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Complete the code given below to have as successfully compiled code. You cannot erase anything. You will just add missing parts! DO NOT FORGET that

Complete the code given below to have as successfully compiled code. You cannot erase anything. You will just add missing parts! DO NOT FORGET that your design will be part of the evaluation.

public class Question1 {

public static final int UNKNOWN = 0;

public static final int LINUX = 1;

public static final int WINDOWS = 2;

private DialogBox dlg;

private int operating_system;

public Question1(int os_type) {

operating_system = os_type;

}

public void prepareWindow() throws UnknownOSType {

if (operating_system == WINDOWS ) {

dlg = new WindowsDialogBox();

} else if (operating_system == LINUX ) {

dlg = new LinuxDialogBox();

} else

throw new UnknownOSType("Unknown OS Type");

dlg.showDialog();

}

}

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

Microsoft Visual Basic 2017 For Windows Web And Database Applications

Authors: Corinne Hoisington

1st Edition

1337102113, 978-1337102117

More Books

Students also viewed these Databases questions

Question

What are the main differences between rigid and flexible pavements?

Answered: 1 week ago

Question

What is the purpose of a retaining wall, and how is it designed?

Answered: 1 week ago

Question

How do you determine the load-bearing capacity of a soil?

Answered: 1 week ago

Question

what is Edward Lemieux effect / Anomeric effect ?

Answered: 1 week ago