当前位置:天才代写 > JAVA代写,java代考-JAVA作业代写免费Moss检测 > CS代写之JAVA GUI可视窗口Homework class

CS代写之JAVA GUI可视窗口Homework class

2018-07-11 08:00 星期三 所属: JAVA代写,java代考-JAVA作业代写免费Moss检测 浏览:1152

Chapters 8 and 6 Homework

WRITING PART

1. Consider the following definition of class MyClass

class MyClass
{
    private String A;
    private char B;
    private int C;
    private double D;
}

a. Create a default constructor assigning “”, ‘ ‘, 0, and 0.0 to the class variables. Hints: Read “default constructor” in your textbook.

b. Create the second constructor that has two parameters assigned to A and B.

c. Create the third constructor that has four parameters assigned to A, B, C, and D.

d. Create get methods for the class variables.

e. Create set methods for the class variables.

f. Create an object named X. In object X, initialize A to “Table” and B to ‘T’. Use the most appropriate constructor to create this object.

g. Create the second object named Y. In object Y, initialize A to “Chair”, B to ‘k’, C to 100, and D to 5.99. Use the most appropriate constructor to create this object.

h. Create the third object named Z. In object Z, initialize A to “”, B to ‘ ‘, C to 0, and D to 0.0. Use the most appropriate constructor to create this object.

i. Display the value of A in object X.

j. Display the value of C in object Z.

k. Assign ‘?’ as the new value of B in object Y.

l. Display the value of B in object Y.

m. Assign 7 as the new value of C in object X.

n. Assign 3.12 as the new value of D in object Z.

o. Display the value of C in object X.

p. Display the value of D in object Z.

2. Consider the following definition of class MyClass:

class MyClass
{
    private int X;
    private int Y;
    public MyClass ()
    {
        X = 100;
        Y = 200;
    }
    public MyClass (int A)
    {
        X = A;
    }
    public MyClass (int A , int Β)
    {
        X = A;
        Y = B;
    }
    public void A ()
    {
        System.out.println (X);
    }
    public void B ()
    {
        System.out.println (Y);
    }
    public int C ()
    {
        Y = Y + 10;
        return Y;
    }
    public int D ()
    {
        return X++;
    }
}

What is the output of the following code?

public class XYZ {
    public static void main(String[] args) {
      MyClass K = new MyClass ();   
MyClass L = new MyClass (10);  
      MyClass M = new MyClass (2 , 4);   
K.C();
L.D();
            M.C();
K.A();
K.B();
L.A();
L.B();
M.A();
M.B();
K.D();
L.C();
            M.D();
K.A();
K.B();
L.A();
L.B();
M.A();
M.B();
}
}

3. Consider the following definition of class a:

class a
{
private int x;
private int y;
public a () {
x = 10;
y = 20;
}
public a (int k , int l) {
x = k;
y = l;
}
public void m () {
System.out.println (y);
}
public int n () {
return x;
}
}

What is the output of the following code?

public class abc {
    public static void main(String[] args) {
a g = new a();
a h = new a(222 , 444);
g.m();
h.m();
System.out.println(g.n () + 200);
System.out.println(h.n () + 100);
}
}

PROGRAMMING PART

4. Develop a GUI application that allows the user to enter two numbers, select “Addition, Subtraction”, either “Multiplication”, or “Division”, and display the sum, the difference, the product, or the ratio of those two numbers. Use two text fields to allow the user to enter the numbers. Use radio buttons to allow the user to enter one of the four operations.

5. Develop application #4 using four buttons (+ button, – button, x button, / button) instead of radio buttons.

6. Develop a GUI application that stores student data (student ID, first name, last name, address, year, major) in a 2D array and allows the user to search for student data by student ID, first name, or last name.

Algorithm: (1) Create a 2D array storing student data by using the array below. Note: The array includes multiple records that have the same first name and/or last name. (2) Use a text field to allow the user to enter student ID, first name, or last name.  (3) Read each student ID, first name, and last name from the array and compare it to the user input. If they match, display the data for that student on a text area. Note: Allow the application to display data of several students having the same first name or last name.

Use this array:

{"01","Sam","Doe","12 Main St.", "Sophomore", "Finance"}, {"02","Kim","Doe","12 Market St.", "Junior", "Business Administration"},{"03","Debby","Summer","120 Main St.", "Senior", "Business Administration"},{"04","Bill","Winter","102 Rose St.", "Sophomore", "Accounting"},{"05","John","Kettinger","12 Pulaski St.", "Sophomore", "Computer Sciences"},{"06","Jill","Pearson","1224 Andrew St.", "Freshman", "MIS"},{"07","Ann","Williams","5 Church St.", "Senior", "MIS"},{"08","Anita","Newell","9 Main St.", "Freshman", "Marketing"},{"09","Anita","Goodyear","88 Akron St.", "Junior", "Nursing"},{"10","Mark","Summer","128 Wilmington St.", "Senior", "Accounting"},{"11","Helen","Newell","12 First St.", "Sophomore", "Finance"}, {"12","Alice","Lee","12 Patriot St.", "Junior", "Business Administration"},{"13","John","Summer","44 Market St.", "Senior", "Business Administration"},{"14","Bill","Adler","102 Hill St.", "Sophomore", "Accounting"},{"15","John","Pearson","12 Pulaski St.", "Junior", "Computer Sciences"},{"16","Ryan","Gibbs","1224 Hunter St.", "Sophomore", "MIS"},{"17","Pete","Williams","12 Church St.", "Senior", "MIS"},{"18","Susan","Newell","9 Rosemary St.", "Freshman", "Marketing"},{"19","Anita","McArthur","721 Akron St.", "Sophomore", "Nursing"},{"20","Dick","Summer","77 Corporate St.", "Senior", "Accounting"}

 

代写CS&Finance|建模|代码|系统|报告|考试

编程类:C++,JAVA ,数据库,WEB,Linux,Nodejs,JSP,Html,Prolog,Python,Haskell,hadoop算法,系统 机器学习

金融类统计,计量,数据科学,风险投资,金融工程,R语言,Python语言,Matlab,建立模型,数据分析,数据处理

服务类:Lab/Assignment/Project/Course/Qzui/Midterm/Final/Exam/Test帮助代写代考辅导

E-mail:850190831@qq.com   微信:BadGeniuscs  工作时间:无休息工作日-早上8点到凌晨3点


如果您用的手机请先保存二维码到手机里面,识别图中二维码。如果用电脑,直接掏出手机果断扫描。

qr.png

 

    关键字:

天才代写-代写联系方式