Tổng hợp 4 đề thi JSP mà mình sưu tầm đc. Trong đó có đề Assignment2.pdf là thấy thi mấy lần.
Source: JSP.zip
Tổng hợp 4 đề thi JSP mà mình sưu tầm đc. Trong đó có đề Assignment2.pdf là thấy thi mấy lần.
Source: JSP.zip
Chú ý:
– Đặt tên file của Câu 1 là: DigitalClock.java
– Đặt tên file của Câu 2 là: Calculator.java
Question 1: [15]
Tạo một ứng dụng có chức năng giống như một đồng hồ báo thức đơn giản.
Yêu cầu:
– Định dạng ngày tháng phải hiển thị đúng như trong hình minh họa, thời gian của đồng hồ phải nhảy theo đúng thời gian thực.
– Khi người dùng click vào nút Exit, chương trình sẽ hiển thị thông báo hỏi người dùng có thật sự muốn tắt chương trình hay không?
Yêu cầu:
– Người dùng có thể nhập ngày tháng năm ( định dạng mm/dd/yyyy), thời gian (ví dụ 09:20:40 AM) và lời nhắn.
– Khi click vào nút Cancel, chương trình sẽ tắt form Set Alarm và trở về form chính.
– Khi click vào nút Set Alarm, chương trình sẽ ghi nhớ toàn bộ những gì người dùng đã nhập và tắt form này. Khi đến mốc thời gian người dùng đã đặt thì sẽ hiển thị thông báo như sau:
Ví dụ người dùng đã nhập lời nhắn là “Hello hello!!”
Question 2: [10]
Tạo chương trình có chức năng giống như một máy tính điện tử với giao diện như sau:
Source: Aptech_Java_1_PExam.zip
Create a database name: SqlExam4
| cID (int, Primary Key) | cName (varchar(25)) | cAge (tinyint) |
| 1 | Tuan Anh | 19 |
| 2 | Viet Hung | 22 |
| 3 | Hoang Minh | 40 |
| 4 | Ngoc Hai | 14 |
Product (Store Products information)
| pID (int, Primary Key) | pName (varchar(25)) | pPrice (int) |
| 1 | Ban La | 1000 |
| 2 | Quat Chay | 500 |
| 3 | May Bom Hong | 20 |
| 4 | Tivi | 5000 |
| 5 | Tu Lanh | 7000 |
Order
| oID (int, Primary Key) | cID (int, Foreign Key References Customer.cID) | oDate (DateTime) | oTotalPrice (int) |
| 1 | 1 | 09/15/2007 | NULL |
| 2 | 3 | 09/20/2007 | NULL |
| 3 | 1 | 09/23/2007 | NULL |
OrderDetail
| oID (int, Foreign Key References Order.oID) | pID (int, Foreign Key References Product.pID) | odQTY (int, Order quantity) |
| 1 | 1 | 3 |
| 1 | 3 | 5 |
| 1 | 4 | 2 |
| 2 | 5 | 1 |
| 2 | 5 | 4 |
| 2 | 3 | 5 |
| 3 | 1 | 12 |
| oID | cID | cDate | oTotalPrice |
| 3 | 1 | 2007-09-23 00:00:00.000 | NULL |
| 2 | 3 | 2007-09-20 00:00:00.000 | NULL |
| 1 | 1 | 2007-09-15 00:00:00.000 | NULL |
| pName | pPrice |
| Tu Lanh | 7000 |
| cName | pName |
| Hoang Minh | Tu Lanh |
| Hoang Minh | Tu Lanh |
| Hoang Minh | May Bom Hong |
| Tuan Anh | Ban La |
| Tuan Anh | May Bom Hong |
| Tuan Anh | Tivi |
| Tuan Anh | Ban La |
| cName |
| Viet Hung |
| Ngoc Hai |
| oID | oDate | odQTY | pName | pPrice |
| 1 | 2007-09-15 00:00:00.000 | 3 | Ba La | 1000 |
| 1 | 2007-09-15 00:00:00.000 | 5 | May Bom Hong | 20 |
| 1 | 2007-09-15 00:00:00.000 | 2 | Tivi | 5000 |
| 2 | 2007-09-20 00:00:00.000 | 1 | Tu Lanh | 7000 |
| 2 | 2007-09-20 00:00:00.000 | 4 | Tu Lanh | 7000 |
| 2 | 2007-09-20 00:00:00.000 | 5 | May Bom Hong | 20 |
| 3 | 2007-09-23 00:00:00.000 | 12 | Ba La | 1000 |
| oID | oDate | Total |
| 1 | 2007-09-15 00:00:00.000 | 13100 |
| 2 | 2007-09-20 00:00:00.000 | 35100 |
| 3 | 2007-09-23 00:00:00.000 | 12000 |
Tạo CSDL quản lý điểm học viên. CSDL gồm 3 bảng Student(RN,Name,Age,Gender), Subject(sID, sName), StudentSubject(RN,SID,Mark,Date).
Use SQL Query Analyzer to work with BookStore database and create a SQL script file follow those steps:
| StudentID (int) | Name (varchar (50)) | Age (tinyint) | Gender (bit) |
| 1 | Nguyen Thi Huyen | 19 | 0 |
| 2 | Mai Thanh Minh | 33 | 1 |
| 3 | Dao Thien Hai | 26 | 1 |
| 4 | Trinh Chan Tran | 24 | 0 |
| 5 | Diem Diem Quynh | 30 | Null |
Books (Book list)
| BookID (int) | Name (Varchar (50)) | TotalPage (int) | Type (Varchar(10)) | Quantity (int) |
| 1 | Word | 50 | Null | 10 |
| 2 | Excel | 60 | Null | 20 |
| 3 | Access | 71 | Null | 7 |
| 4 | LGC | 42 | Null | 1 |
| 5 | HTML | 71 | Null | 2 |
Borrows (Describe borrowing. Example: the first row of following table denote “Nguyen Thi Huyen has borrowed one Excel book on 10/29/2004)
| BorrowID (int) | StudentID (int) | BookID (int) | BorrowDate (datetime) |
| 1 | 1 | 1 | 10/29/2004 |
| 2 | 4 | 4 | 10/26/2004 |
DropOuts (Describe DropOut list)
| DrpID (int) | StudentID (int) | Date (datetime) |
Constraints:
– Apply the Not Null Constraint to the Name column of Books table.
– Apply the Primary Key Constraint for the StudentID, BookID, BorrowID and DrpID columns of 4 above tables.
– Apply the Identity(1,1) Constraint for the DrpID column of DropOuts table.
| BookID | Name | TotalPage | Type | Quantity |
| 2 | Excel | 60 | NULL | 20 |
| 3 | Access | 71 | NULL | 7 |
| 5 | HTML | 71 | NULL | 2 |
| Student Name | Book Name |
| Nguyen Thi Huyen | Word |
| Trinh Chan Tran | LGC |
| Trinh Chan Tran | Access |
| Mai Thanh Minh | HTML |
| Trinh Chan Tran | Word |
| Trinh Chan Tran | Word |
| Student Name | Total borrowed book |
| Dao Thien Hai | 0 |
| Diem Diem Quynh | 0 |
| Mai Thanh Minh | 1 |
| Nguyen Thi Huyen | 1 |
| Trinh Chan Tran | 4 |
| Book Name | Total Borrower |
| Word | 3 |
| Book Name | TotalPage | Type | Quantity |
| Word | 50 | Normal | 10 |
| Excel | 60 | Normal | 20 |
| Access | 71 | Thick | 7 |
| LGC | 42 | Thin | 1 |
| HTML | 71 | Thick | 2 |
| DrpID | StudentID | Date |
| 1 | 3 | <Current Date time> |
Notes: You must ensure that this action will completely or rollback.
EXAMPLE SOURCE: Aptech-SQL-2-PE-2.zip
Use SQL Query Analyzer to work with EventManagement database and create a SQL script file follow those steps:
| CusID (int) | CusName (Varchar(50)) | CusAge (Smallint) | CusGender (Bit) |
| 1 | Truong Gia Binh | 45 | 1 |
| 2 | Vuong Vu Thang | 22 | Null |
| 3 | Trieu Tran Duc | 20 | 1 |
| 4 | Tran Ngoc Oanh | 19 | 0 |
Event (Event list)
| EvtID (int) | EvtName (varchar(50) | EvtType (tinyint) | EvtDate (DateTime) |
| 1 | Hacker VN | 1 | 2005-01-13 |
| 2 | TTVN | 2 | 2004-12-12 |
| 3 | SVHN | 3 | 2005-01-01 |
CustomerEvent (Describe attendance of Event. Example: the first row of following table denote “Truong Gia Binh has attended in Hacker VN event”)
| CusID (Int) | EvtID (Int) | cesClass (Int) |
| 1 | 1 | 1 |
| 1 | 2 | 1 |
| 2 | 1 | 2 |
| 2 | 3 | 2 |
| 3 | 1 | 1 |
| 3 | 2 | 2 |
| 3 | 3 | 3 |
Constraints: (Student must use ‘Alter Table’ statement to Apply them)
– Apply the Default Constraint to the EvtType column of Event table with value is 1.
– Apply the Primary Key Constraint for CustID of Customer table, EvtID of Event table and the Composite Primary Key Constraint for the CusID and EvtID of the CustomerEvent table.
– Create a References Constraint between Customer and CustomerEvent table on CusID named ‘Contr1’, and a References Constraint between Event and CustomerEvent table on EvtID named ‘Contr2’.
| Event Name | Total |
| Hacker VN | 3 |
| TTVN | 2 |
| SVHN | 2 |
| Name | Age | Gender |
| Truong Gia Binh | 45 | Male |
| Vuong Vu Thang | 22 | Nil |
| Trieu Tran Duc | 20 | Male |
| Tran Ngoc Oanh | 19 | Female |
| Event Name | Customer Name |
| Hacker VN | Truong Gia Binh |
| Hacker VN | Vuong Vu Thang |
| Hacker VN | Trieu Tran Duc |
| SVHN | Vuong Vu Thang |
| SVHN | Trieu Tran Duc |
| TTVN | Truong Gia Binh |
| TTVN | Trieu Tran Duc |
Chapter 5 Assignment:
– All fields are required.
– Customer ID accepts maximum 5 characters, all chars must be entered in upper case.
– Email must be in correct email format (hint: must have (@) and (.) in corrcet position).
– Phone no. must be in format of (000)-000-0000 in which 0 represents a 0-9 number.
– Extension must be numeric and accepts maximum 3 chars.
– Country combo box contains some country options and only allows users to select the available options not input new country.
– Postal code must be numeric and accepts maximum 3 chars.
– Only display subfolders and files of a folder when it is selected. This is to avoid the long process of loading all drive contents at form load. Handle the event AfterSelect of the treeview to display the selected node content
This is a Shopping Cart System.
The system will allow user to add new, edit, delete products and choose products to save in a shopping cart:
The database script has been generated for you at: Shoppingcart.sql .
Use it to create your local database.
Server: xxxxxxxx
Database: xxxxxxxx
User: xxxxxxx
Create your winforms project at the following folder on your local machine
D:\xxxxxxxxxx
Perform the following functions for the application:
– When user click the Product Management menu, show the Products form. [0.5 mark]
– When user click the Shopping Cart menu, show the Shopping form. [0.5 mark]
– Show dialog (Yes/No) to confirm when user close the form. [1 mark]
– The Product ID text box is Disabled
– Load all products in database and display all fields in the All Products data grid. [2 marks]
– When user select a product in the data grid, fill all product information: ProductID, Product name, Price, Quantity to the text boxes above. [3 marks]
– When user click Update button, update the current selected product with new values in text boxes. [3 marks]
– When user click Add new button, add new product with product name, price … [3 marks]
– Fill all the products to the combo box Select product. [3 marks]
– When user select a product in the combo box, display its price in the label Price [1 mark]
– When user select a product in the combo box and enter a positive number in the quantity textbox then click Add to cart, add the product name to the list box and calculate total cost = quantity * price and set to the label Total cost [2 marks]
– User can select a product in the list box then click Remove button to remove it from cart. Re calculate the total cost [2 marks]
– If user click the Save button, insert all selected products in cart into the table Carts with quantity, total cost and [Date] = current date. [2 marks]
Total: 25 marks.
Music Album Management
Create an application to manage music albums. The application’s database has been created for you and its schema is shown in Figure 1:
Generated SQL Scripts:
Sql Scripts
This application has one form allowing users to create a music album by specifying album name and its songs. Users can filter songs by Artist and then add to the album as shown in Figure 2:
Implement the following functions for the application:
Total Mark: [25]
Curriculum: ACCP
Duration: 2 Hours
Total Marks: 30
Using NorthWind database which is available in SQL server, write code to performs the tasks as following:
– When the form is loaded, populate Combobox with CompanyName from Customers table. (4 marks)
– When the user select a customer from Combobox, all Orders (from Orders table with OrderID, OrderDate and ShipCountry fields) of that customer must be shown in the DataGrid on the left of the form. [5marks]
– When the user select an Order from the Orders list, all details (ProductName, UnitPrice, Quantity and Amount fields (Amount=UnitPrice*Quantity)) of that order must be shown in the DataGrid on the right of the form. [5 marks]
Insert the images into the form (any image) and the Close button.
Write code to close the form when the user click on the Close button. [1 marks]