Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Application Programming IST 256 Application Programming for Information Systems Xiaozhong Liu https://xliu12.mysite.syr.edu/

Similar presentations


Presentation on theme: "Introduction to Application Programming IST 256 Application Programming for Information Systems Xiaozhong Liu https://xliu12.mysite.syr.edu/"— Presentation transcript:

1 Introduction to Application Programming IST 256 Application Programming for Information Systems Xiaozhong Liu https://xliu12.mysite.syr.edu/

2 Design a class for course, including the following fields: Course name, course number (ID), instructor name

3 Design a class for a student including the following fields (you can re-use the object designed last question): Name, Number of credits, and the courses already taken Note, make sure these fields are protected. Users can access these fields by using get and set methods

4 For last question, design a method in student class to decide if this student can graduate or not, following the following criteria: 1.This student already took more than 60 credits 2.This student already took course 500 (course ID)

5 If there are a list of students defined as following: Student [ ] students = new Student [1000]; Print all the student names who can graduate

6 Read a name (or partial name) from jTextField1, and search in student array. Print all the target students names and credits in a jLabel1.

7 Find the largest number in an array: double [ ] numbers = new double [50];

8 Write the result of the following code: public double compute (double num, double rate) { double result = num; if (num > 5) { result = num * rate; } return result; } public static void main(String[] args) { int num = 10; num = compute (num, 0.1); System.out.println(num);}

9 Write the code to read the age of user from jTextField1. If the user age larger than 20, print “beer” in jLabel 1, else print “coke”. When user’s input is not an integer, print “you need to type a number” in jLabel1.

10 Given the following text data saved in “house.txt” [City],[Price],[Number of rooms],[House Size (sq ft)] Syracuse, 250000, 5, 3120 Indianapolis, 510000, 3, 2500 Syracuse, 300000, 6, 3000 Design a class for the data described above Also, design a method in this class “getPricePerFt” to calculate the price per square feet.

11 In a form, write the code for two buttons: Button1. read the data into an array of houses. Button2. print the average price of houses in a specific city in jLabel1 (read the name of the city from jTextField1) (read the name of the city from jTextField1)


Download ppt "Introduction to Application Programming IST 256 Application Programming for Information Systems Xiaozhong Liu https://xliu12.mysite.syr.edu/"

Similar presentations


Ads by Google