Thursday, March 10, 2011

JAVA - GUI - JFrame

Standard Calculator

1 Create the Form shown in the figure below in NetBeans



















button names: b1,b2,b3,b4,b5,b6,b7,b8,b9,b0

2. Right click the button 1 ==> Events ==> Actions then supply the code below



supply the same code in button 1 to the rest of the buttons from 2 to 0 but don't forget to change the property name of each button.

3. Add this method anywhere in your code, as long as it's between the curly brackets of the class




4. Double click your + , * , / , - button and supply the code below in each button

//for addition

String addbutton = bplus.getText();
getOperator(addbutton);

//for subtraction
String minusbutton = bminus.getText();
getOperator(minusbutton);

//for division
String divutton = bdiv.getText();
getOperator(divutton);

//for multiplication
String mulbutton = bmul.getText();
getOperator(mulbutton);


5. Double click the Equal Button and supply the following code:




5. Double click the clear button and supply this code:


total1 = 0;
txtdisplay.setText("");



Enjoy!!!!

Monday, March 7, 2011

COMED2 - SQL

1. Open this website:

http://www.w3schools.com/sql/sql_tryit.asp

2. Practice SQL commands

Saturday, March 5, 2011

Friday, March 4, 2011

IT406 - Assignment

1. Write a program to determine the equivalent grade of student in a class as follows:

a. Determine the final grade of the student by the formula:

final grade = 0.30 of midterm grade + 0.10 of pre-final + 0.06 of final

b. Determine the equivalent grade for the numerical value obtained by the following grading remarks:

Thursday, March 3, 2011

IT 406 - Exercise3

2. Create a program that gives a discount of 100 pesos to a customer if the shirt bought is XL and the price is greater than 500 pesos; a discount of 50 pesos if the bought is L and the price is greater than 400

Save under the filename: Exer3

IT Elective - Log-in Form with Database

source:

copy and paste the site above and try this tutorial :

http://frozenade.wordpress.com/2007/11/24/how-to-create-login-page-in-php-and-mysql-with-session/

Wednesday, March 2, 2011

IT - 406 Quiz1

Using else if

Prob.) Write a program that asks the user for the hours worked for the week and the hourly rate. The basic salary is compute as:

Salary = hours worked * hourly rate

Bonuses are given:

No. of hours > 45 Bonus of 500 pesos

No. of hours > 40 and <=45 Bonus of 250 pesos

No. of hours > 35 and <= 40 Bonus of 150 pesos

Display the basic salary, bonus and the total salary (basic salary + bonus) for the week.

Followers

Visitor

free counters

FEEDJIT Live Traffic Feed