When the store opened almost two weeks ago, I had to miss two (2) of my classes just to attend to stock operations. And, up to this date, business works continue to consume me that my teaching works indeed pile up.
I have to however squeeze in my works and simply prioritize whatever is more urgent and needed. It is quite wiser and important that we pursue security over our works, properties and family just in case unexpected events happen. Thus, it can be wiser for me and everyone else if insurance like health and cheap car insurance can be one of our top priorities.
Because of the missed classes, I have to cope with my absences and that means putting extra hours in school to attend to my students and their subject requirements.
The extended time will be over soon and I can only be more relieved.
Thursday, July 29, 2010
Another illustration of exception handling is the use of exception type, ArithmeticException which is normally used for division by zero among other arithmetic operations.
See the program below for this example.
[+/-] show/hide
/* program for try and catch */
import java.lang.*;
import java.io.*;
public class TryDemo2{
public static void main ( String args[]) throws IOException{
BufferedReader stdin = new BufferedReader(new InputStreamReader (System.in));
System.out.println("Input a numerator:");
String numerator=stdin.readLine();
int num1=Integer.parseInt(numerator);
System.out.println("Input a divisor:");
String divisor=stdin.readLine();
try{
int num2=Integer.parseInt(divisor);
System.out.println("The quotient of "+numerator+" and "+divisor+" is "+num1/num2);
}
catch (ArithmeticException ex){
System.out.println("Division by zero! ");
}
}
}
See the program below for this example.
[+/-] show/hide
/* program for try and catch */
import java.lang.*;
import java.io.*;
public class TryDemo2{
public static void main ( String args[]) throws IOException{
BufferedReader stdin = new BufferedReader(new InputStreamReader (System.in));
System.out.println("Input a numerator:");
String numerator=stdin.readLine();
int num1=Integer.parseInt(numerator);
System.out.println("Input a divisor:");
String divisor=stdin.readLine();
try{
int num2=Integer.parseInt(divisor);
System.out.println("The quotient of "+numerator+" and "+divisor+" is "+num1/num2);
}
catch (ArithmeticException ex){
System.out.println("Division by zero! ");
}
}
}
Labels:Java,lectures,sample programs,source codes
| Reactions: |
Catch Errors through Exceptions
Exceptions in Java can come in 3 forms: errors, runtime exceptions and logical exceptions. Errors and logical exceptions should be corrected as these affect the program's reliability and accuracy. However, runtime exceptions like division by zero, wrong input format, array access out of size, and etc. However, Java can handle these exception through try -- catch blocks.
Typically, NumberFormatException is encountered when a non-numeric input is encoded for a number input. This shall cause a program disruption that shows up the stack trace or the causes of disruption and from what method among other information.
The sample program below shows the use of exception.
[+/-] show/hide
/*program for try and catch */
import java.lang.*;
import java.io.*;
public class TryDemo1{
public static void main ( String args[]) throws IOException{
BufferedReader stdin = new BufferedReader(new InputStreamReader (System.in));
String myInput;
System.out.println("Input an integer:");
myInput=stdin.readLine();
try{
int num=Integer.parseInt(myInput);
System.out.println("The square of "+num+" is "+num*num);
}
catch (NumberFormatException ex){
System.out.println("You have encoded a wrong input");
}
System.out.println("Goodbye!");
}
}
Typically, NumberFormatException is encountered when a non-numeric input is encoded for a number input. This shall cause a program disruption that shows up the stack trace or the causes of disruption and from what method among other information.
The sample program below shows the use of exception.
[+/-] show/hide
/*program for try and catch */
import java.lang.*;
import java.io.*;
public class TryDemo1{
public static void main ( String args[]) throws IOException{
BufferedReader stdin = new BufferedReader(new InputStreamReader (System.in));
String myInput;
System.out.println("Input an integer:");
myInput=stdin.readLine();
try{
int num=Integer.parseInt(myInput);
System.out.println("The square of "+num+" is "+num*num);
}
catch (NumberFormatException ex){
System.out.println("You have encoded a wrong input");
}
System.out.println("Goodbye!");
}
}
Labels:Java,lectures,sample programs,source codes
| Reactions: |
Thursday, July 22, 2010
How to Enhance Social Skills in School
I was never an extrovert person before where I spent most of my schooling days only indoor and academic. However, from prior experience and teaching exposures, you too can develop your social skills. You can employ the following tips to rid gradually your inhibition from social activities.
1. Develop small group of friends who share with you similar interests and values;
2. Be open to welcoming new acquaintances from your friends' circles;
3. Join academic or non - academic groups;
4. Take personality - enhancement talks or fora;
5. Join in social events - start with required activities and extend these to off - school fun; and
6. Enjoy the company of others.
7. Enhance your personality through fashion and body makeover, regular exercise, diet and other personality - boosting measures like apidexin to complement your weight loss/gain programs.
Being alone may mean fun too, however, social skills are imperative whenever you wish to work. Thus, exposure while in school can gradually help you improve your interpersonal skills and through this, your confidence is further boosted. It will simply come handy when you assert your worth as you apply for or pursue a job.
1. Develop small group of friends who share with you similar interests and values;
2. Be open to welcoming new acquaintances from your friends' circles;
3. Join academic or non - academic groups;
4. Take personality - enhancement talks or fora;
5. Join in social events - start with required activities and extend these to off - school fun; and
6. Enjoy the company of others.
7. Enhance your personality through fashion and body makeover, regular exercise, diet and other personality - boosting measures like apidexin to complement your weight loss/gain programs.
Being alone may mean fun too, however, social skills are imperative whenever you wish to work. Thus, exposure while in school can gradually help you improve your interpersonal skills and through this, your confidence is further boosted. It will simply come handy when you assert your worth as you apply for or pursue a job.
| Reactions: |
School Acquiantance Day Today
Classes are suspended for half a day today to give way to our evening Acquaintance Party and the theme is for everyone to wear black and white outfit.
My sister has to scout around for the perfect match although I am quite sure other students have had troubles finding their own suits. I have to however settle with the ones in my closet and simply mix and match them.
I have to just pack my own clothing since store works are still to be attended today until 7pm. I am quite sure students are excited to show off their attire and paint the town red with all the anticipated fun.
My sister has to scout around for the perfect match although I am quite sure other students have had troubles finding their own suits. I have to however settle with the ones in my closet and simply mix and match them.
I have to just pack my own clothing since store works are still to be attended today until 7pm. I am quite sure students are excited to show off their attire and paint the town red with all the anticipated fun.
Method overriding is also possible in inheritance; with similar method name, a child class can replace the methods in the parent class.
Depending on which method you access, you will see unique actions from the instantiated class. See a sample program of how I have two methods of the same name. And, with a constructor, I pass the initial value to my classes.
[+/-] show/hide
/*with super in constructor*/
import javax.swing.*;
public class SampleInheritanceMethodOverload1{
public static void main (String args[]){
ParentClass myObject1 = new ParentClass("Yuri");
myObject1.printGreetings();
BaseClass myObject2 = new BaseClass("Juana");
myObject2.printGreetings();
}
}
class ParentClass{
String name;
ParentClass(String xname)
{
name=xname;
}
void printGreetings()
{
JOptionPane.showMessageDialog(null,"Hello "+name);
}
}
class BaseClass extends ParentClass{
String xname;
BaseClass(String myname)
{
super(myname);
xname=myname;
}
void printGreetings()
{
JOptionPane.showMessageDialog(null,"Hi "+xname);
}
}
Depending on which method you access, you will see unique actions from the instantiated class. See a sample program of how I have two methods of the same name. And, with a constructor, I pass the initial value to my classes.
[+/-] show/hide
/*with super in constructor*/
import javax.swing.*;
public class SampleInheritanceMethodOverload1{
public static void main (String args[]){
ParentClass myObject1 = new ParentClass("Yuri");
myObject1.printGreetings();
BaseClass myObject2 = new BaseClass("Juana");
myObject2.printGreetings();
}
}
class ParentClass{
String name;
ParentClass(String xname)
{
name=xname;
}
void printGreetings()
{
JOptionPane.showMessageDialog(null,"Hello "+name);
}
}
class BaseClass extends ParentClass{
String xname;
BaseClass(String myname)
{
super(myname);
xname=myname;
}
void printGreetings()
{
JOptionPane.showMessageDialog(null,"Hi "+xname);
}
}
Labels:Java,lectures,sample programs,source codes
| Reactions: |
Tuesday, July 20, 2010
How to Protect Yourself from Misfortune
Irregardless of culture, religion or gender, mishaps or misfortunes for others may happen at the most unexpected time. Thus, it pays off when we are proactive and reactive that we respond to present issues and anticipate future trends.
I get nervous when unexpected things happen and learning how to drive a motorbike at a very late age does not all help. It is however a good thing that I had a good driver to teach me and I took an orientation on traffic rules. Traffic situation is always worse in most parts of the Philippines and along with this is the monstrous number of road accidents.
Normally, a petty delinquent driver is penalized through a fine and traffic reorientation. But, don't you know that in California, when you receive your California Federal Court Traffic Ticket for a violation, you can use a an online traffic school that can help you reclaim your demerit points from traffic misfortunes. The state court recognizes this site and with a payment of $19.95, you can take the lesson and associated exam at your own pacing until you finish the complete set of lessons and you warrant for certification. An 8 - hour of online traffic schooling may be too much for you but their system allows you to cut the lessons to different times as your progress is automatically saved allowing you to resume from where you have last worked on.
At this time where everyone seems in a hurry, it is only sensible that we employ technology to get things done.
I get nervous when unexpected things happen and learning how to drive a motorbike at a very late age does not all help. It is however a good thing that I had a good driver to teach me and I took an orientation on traffic rules. Traffic situation is always worse in most parts of the Philippines and along with this is the monstrous number of road accidents.
Normally, a petty delinquent driver is penalized through a fine and traffic reorientation. But, don't you know that in California, when you receive your California Federal Court Traffic Ticket for a violation, you can use a an online traffic school that can help you reclaim your demerit points from traffic misfortunes. The state court recognizes this site and with a payment of $19.95, you can take the lesson and associated exam at your own pacing until you finish the complete set of lessons and you warrant for certification. An 8 - hour of online traffic schooling may be too much for you but their system allows you to cut the lessons to different times as your progress is automatically saved allowing you to resume from where you have last worked on.
At this time where everyone seems in a hurry, it is only sensible that we employ technology to get things done.
Labels:lectures on life and living
| Reactions: |
The Use of Super in Java Programs
The Java keyword super has a special use in the application of inheritance. When we pass parameters to our constructors, we also perform the same thing for parents and child classes. A child class may access the parent class' fields through the use of super to pass parameters to parent class.
See the sample below for the illustration.
[+/-] show/hide
/*with super in constructor*/
import javax.swing.*;
public class SampleInheritance4{
public static void main (String args[]){
String myname=JOptionPane.showInputDialog("Input a student name: ");
String myaddress=JOptionPane.showInputDialog("Input a student's address: ");
String mycourse=JOptionPane.showInputDialog("Input a student's college course: ");
College2 obj1=new College2(myname,myaddress);
obj1.setcourse(mycourse);
JOptionPane.showMessageDialog(null,"object of the child class");
JOptionPane.showMessageDialog(null,"Student's Info: "+"\n"+obj1.name+"\n"+obj1.getaddress()+"\n"+obj1.getcourse());
}
}
class Student2{
protected String name;
protected String address;
String getname()
{return this.name;}
String getaddress()
{return this.address;}
}
class College2 extends Student2{
College2(String xname,String xaddress){
super.name=xname; // passing the values of xname and xaddress to parent variables names and address
super.address=xaddress;
}
String course;
void setcourse(String xcourse)
{course=xcourse;}
String getcourse()
{return this.course;}
}
See the sample below for the illustration.
[+/-] show/hide
/*with super in constructor*/
import javax.swing.*;
public class SampleInheritance4{
public static void main (String args[]){
String myname=JOptionPane.showInputDialog("Input a student name: ");
String myaddress=JOptionPane.showInputDialog("Input a student's address: ");
String mycourse=JOptionPane.showInputDialog("Input a student's college course: ");
College2 obj1=new College2(myname,myaddress);
obj1.setcourse(mycourse);
JOptionPane.showMessageDialog(null,"object of the child class");
JOptionPane.showMessageDialog(null,"Student's Info: "+"\n"+obj1.name+"\n"+obj1.getaddress()+"\n"+obj1.getcourse());
}
}
class Student2{
protected String name;
protected String address;
String getname()
{return this.name;}
String getaddress()
{return this.address;}
}
class College2 extends Student2{
College2(String xname,String xaddress){
super.name=xname; // passing the values of xname and xaddress to parent variables names and address
super.address=xaddress;
}
String course;
void setcourse(String xcourse)
{course=xcourse;}
String getcourse()
{return this.course;}
}
Labels:Java,lectures,sample programs,source codes
| Reactions: |
How Skills Improve Your Intelligence
I read from few articles of notable individuals that IQ is inate and can be highly affected by our own genes; however, this does not mean that our skills or competencies are limited if our IQ is less or negligible. Readers' Digest once featured that IQ can be boosted through different means including:
1. getting a sensible and intellectual partner for sensible conversations throughout your time;
2. acquiring new skills as new skills create more neurons that affect our intelligence;
3. reading more and more;
4. getting a challenging job;
At my age, a challenging job seems hard to endure, but, through constant drive and push, our brain can fully work. I recently learned how to drive and this is a new skill that requires wits and a lot of practical sense. Responsibility however, does not end before and during traffic exam; greater responsibility is even endured once we receive our driver's license. Inevitably, however, road accidents or unintentional lapse to abide by the road rules may possibly happen causing infringement against our license. Thus, it is highly important that we take the needed schooling and doing this fast is simply more preferred.
In Nevada Traffic School Online, they can give you a fast and effective way to relieve your driving points from demerits. A mere $19.95 is a meager amount to reclaim your driving merit points. The court recognizes this traffic school entity and you are allowed to have an 8-hour traffic course. Their vivid instructions on how to take the lesson and the quiz are 1-2-3 ways to getting your license' honor again.
1. getting a sensible and intellectual partner for sensible conversations throughout your time;
2. acquiring new skills as new skills create more neurons that affect our intelligence;
3. reading more and more;
4. getting a challenging job;
At my age, a challenging job seems hard to endure, but, through constant drive and push, our brain can fully work. I recently learned how to drive and this is a new skill that requires wits and a lot of practical sense. Responsibility however, does not end before and during traffic exam; greater responsibility is even endured once we receive our driver's license. Inevitably, however, road accidents or unintentional lapse to abide by the road rules may possibly happen causing infringement against our license. Thus, it is highly important that we take the needed schooling and doing this fast is simply more preferred.
In Nevada Traffic School Online, they can give you a fast and effective way to relieve your driving points from demerits. A mere $19.95 is a meager amount to reclaim your driving merit points. The court recognizes this traffic school entity and you are allowed to have an 8-hour traffic course. Their vivid instructions on how to take the lesson and the quiz are 1-2-3 ways to getting your license' honor again.
| Reactions: |
More of Inheritance Illustration
To define clearly the use of inheritance, we apply this to a relationship between a student who has to go through different schooling levels including college.
The program below assigns the Student as the parent class while College as the child class. Through inheritance, the child class can simply call the methods and fields in the parent class by any object that instantiates it.
The program below illustrates this point.
[+/-] show/hide
import javax.swing.*;
public class SampleInheritance3{
public static void main (String args[]){
String myname=JOptionPane.showInputDialog("Input a student name: ");
String myaddress=JOptionPane.showInputDialog("Input a student's address: ");
Student1 obj1=new Student1();
obj1.setname(myname);
obj1.setaddress(myaddress);
System.out.println("object of parent class");
System.out.println("Student's name : "+obj1.getname());
System.out.println("Student's address : "+obj1.getaddress());
College1 obj2=new College1();
String mycourse=JOptionPane.showInputDialog("Input a student's college course: ");
obj2.setname(myname);
obj2.setaddress(myaddress);
obj2.setcourse(mycourse);
JOptionPane.showMessageDialog(null,"object of the child class");
JOptionPane.showMessageDialog(null,"Student's Info: "+"\n"+obj2.name+"\n"+obj2.getaddress()+"\n"+obj2.getcourse());
}
}
class Student1{
protected String name;
protected String address;
void setname(String xname)
{name=xname;}
String getname()
{return name;}
void setaddress(String xaddress)
{address=xaddress;}
String getaddress()
{return address;}
}
class College1 extends Student1{
String course;
void setcourse(String xcourse)
{course=xcourse;}
String getcourse()
{return course;}
}
The program below assigns the Student as the parent class while College as the child class. Through inheritance, the child class can simply call the methods and fields in the parent class by any object that instantiates it.
The program below illustrates this point.
[+/-] show/hide
import javax.swing.*;
public class SampleInheritance3{
public static void main (String args[]){
String myname=JOptionPane.showInputDialog("Input a student name: ");
String myaddress=JOptionPane.showInputDialog("Input a student's address: ");
Student1 obj1=new Student1();
obj1.setname(myname);
obj1.setaddress(myaddress);
System.out.println("object of parent class");
System.out.println("Student's name : "+obj1.getname());
System.out.println("Student's address : "+obj1.getaddress());
College1 obj2=new College1();
String mycourse=JOptionPane.showInputDialog("Input a student's college course: ");
obj2.setname(myname);
obj2.setaddress(myaddress);
obj2.setcourse(mycourse);
JOptionPane.showMessageDialog(null,"object of the child class");
JOptionPane.showMessageDialog(null,"Student's Info: "+"\n"+obj2.name+"\n"+obj2.getaddress()+"\n"+obj2.getcourse());
}
}
class Student1{
protected String name;
protected String address;
void setname(String xname)
{name=xname;}
String getname()
{return name;}
void setaddress(String xaddress)
{address=xaddress;}
String getaddress()
{return address;}
}
class College1 extends Student1{
String course;
void setcourse(String xcourse)
{course=xcourse;}
String getcourse()
{return course;}
}
Labels:Java,lectures,sample programs,source codes
| Reactions: |
Thursday, July 8, 2010
How to Improve Your Personality
Personality affects self - confidence and this is an issue not limited to students or teachers alone. In fact, a number has low self - esteem that printed and non - printed media seem too define personality if you have long legs, great body figures, Hollywood face or hefty paychecks.
However, self - confidence can only be improved through self interventions too to start with. Experts say that to improve your personality, you have to at least address the cause(s) of your poor self - esteem; these can be your physical features like body weights or disfigures or poor hygiene. You can actually remedy this through exercise using fitness equipment or alike. If you have a body disfigure, a surgery or artificial replacement can be done. A poor hygiene that leads to bad breath or body odor can also be remedied as commercial products or services can assist you.
More importantly, it is necessary that you have a positive outlook of yourself; if you believe that you are as important as others and not afraid to commit mistakes, other people will simply respect and trust you more. You don't have to be a celebrity or VIP to be heard; an improved self - confidence can make a valuable difference.
However, self - confidence can only be improved through self interventions too to start with. Experts say that to improve your personality, you have to at least address the cause(s) of your poor self - esteem; these can be your physical features like body weights or disfigures or poor hygiene. You can actually remedy this through exercise using fitness equipment or alike. If you have a body disfigure, a surgery or artificial replacement can be done. A poor hygiene that leads to bad breath or body odor can also be remedied as commercial products or services can assist you.
More importantly, it is necessary that you have a positive outlook of yourself; if you believe that you are as important as others and not afraid to commit mistakes, other people will simply respect and trust you more. You don't have to be a celebrity or VIP to be heard; an improved self - confidence can make a valuable difference.
| Reactions: |
Another Java Inheritance Sample
Posted in a previous post, another illustration of inheritance is the program herein with methods that return values to their calling program.
[+/-] show/hide
import javax.swing.*;
public class SampleInheritance2{
public static void main (String args[]){
String numstring1=JOptionPane.showInputDialog("Input a number");
int mynum1=Integer.parseInt(numstring1);
Parent2 obj1=new Parent2();
obj1.setnum(mynum1);
System.out.println("Your input from parent : "+obj1.num);
System.out.println("Square: "+obj1.square());
System.out.println("Cube: "+obj1.cube());
String numstring2=JOptionPane.showInputDialog("Input a number");
int mynum2=Integer.parseInt(numstring2);
Child2 obj2=new Child2();
obj2.setnum(mynum2);
System.out.println("Your input from child class: "+obj2.getnum());
System.out.println("Square: "+obj2.square());
System.out.println("Cube: "+obj2.cube());
System.out.println("Nth from child class: "+obj2.nth());
}
}
class Parent2{
int num;
void setnum(int x)
{num=x;}
int square()
{int mysquare=num*num;
return mysquare;
}
int cube()
{int mycube =num*num*num;
return mycube;
}
int getnum()
{return num;}
}
class Child2 extends Parent2{
double nth()
{ System.out.println(" last value of num "+num);
double myquo=num/2.0;
return myquo;}
}
[+/-] show/hide
import javax.swing.*;
public class SampleInheritance2{
public static void main (String args[]){
String numstring1=JOptionPane.showInputDialog("Input a number");
int mynum1=Integer.parseInt(numstring1);
Parent2 obj1=new Parent2();
obj1.setnum(mynum1);
System.out.println("Your input from parent : "+obj1.num);
System.out.println("Square: "+obj1.square());
System.out.println("Cube: "+obj1.cube());
String numstring2=JOptionPane.showInputDialog("Input a number");
int mynum2=Integer.parseInt(numstring2);
Child2 obj2=new Child2();
obj2.setnum(mynum2);
System.out.println("Your input from child class: "+obj2.getnum());
System.out.println("Square: "+obj2.square());
System.out.println("Cube: "+obj2.cube());
System.out.println("Nth from child class: "+obj2.nth());
}
}
class Parent2{
int num;
void setnum(int x)
{num=x;}
int square()
{int mysquare=num*num;
return mysquare;
}
int cube()
{int mycube =num*num*num;
return mycube;
}
int getnum()
{return num;}
}
class Child2 extends Parent2{
double nth()
{ System.out.println(" last value of num "+num);
double myquo=num/2.0;
return myquo;}
}
Labels:Java,lectures,sample programs,source codes
| Reactions: |
Java's Principle of Inheritance
One of the highlights of object - oriented programming is its ability to reuse objects. In Java, a parent and child relationship can exist and this is done through the keyword extends.
With the relationship, a child can access the parent's methods and fields with the child's class ability to create its own methods and attributes.
See the program below for the sample program.
[+/-] show/hide
import javax.swing.*;
public class SampleInheritance{
public static void main (String args[]){
String numstring1=JOptionPane.showInputDialog("Input a number");
int mynum1=Integer.parseInt(numstring1);
Parent1 obj1=new Parent1();
obj1.setnum(mynum1);
obj1.square();
obj1.cube();
System.out.println("Last number result from parent methods: "+obj1.getnum());
String numstring2=JOptionPane.showInputDialog("Input a number");
int mynum2=Integer.parseInt(numstring2);
Child1 obj2=new Child1();
obj2.setnum(mynum2);
obj2.square();
obj2.cube();
obj2.nth();
System.out.println("Last number result with parent and child methods: "+obj2.getnum());
}
}
class Parent1{
int num;
void setnum(int x)
{num=x;}
void square()
{num=num*num;
}
void cube()
{num =num*num*num;
}
int getnum()
{return num;}
}
class Child1 extends Parent1{
void nth()
{ num=num/2;}
}
With the relationship, a child can access the parent's methods and fields with the child's class ability to create its own methods and attributes.
See the program below for the sample program.
[+/-] show/hide
import javax.swing.*;
public class SampleInheritance{
public static void main (String args[]){
String numstring1=JOptionPane.showInputDialog("Input a number");
int mynum1=Integer.parseInt(numstring1);
Parent1 obj1=new Parent1();
obj1.setnum(mynum1);
obj1.square();
obj1.cube();
System.out.println("Last number result from parent methods: "+obj1.getnum());
String numstring2=JOptionPane.showInputDialog("Input a number");
int mynum2=Integer.parseInt(numstring2);
Child1 obj2=new Child1();
obj2.setnum(mynum2);
obj2.square();
obj2.cube();
obj2.nth();
System.out.println("Last number result with parent and child methods: "+obj2.getnum());
}
}
class Parent1{
int num;
void setnum(int x)
{num=x;}
void square()
{num=num*num;
}
void cube()
{num =num*num*num;
}
int getnum()
{return num;}
}
class Child1 extends Parent1{
void nth()
{ num=num/2;}
}
Labels:Java,lectures,sample programs,source codes
| Reactions: |
Sunday, July 4, 2010
Anyone But the Teacher Can Be Absent
Teaching can be a fulfilling work but quite draining too especially if you have more than three (3) subject preparations to do every week. I only have three (3) preparations but two (2) of these subjects are new and with laboratory that quite fill my entire week including Saturdays. I have to exert more readings on these two (2) subjects that I feel I have a full - time load to endure.
I don't feel well as I have colds and my kid has been sick for a couple of days with on and off fever. He has been absent from school for three (3) days and we still have to bring him to his pediatrician for thorough check - up while I am still contemplating whether I have to miss my class. This is the sad thing about being absent when you are teacher; you shall waste the time of all your students and I quite feel quite guilty about that, so, as much as possible, I go to school in spite of uncomfortable situations.
Teaching students about academic contents, health including human growth hormone supplements , social and economic problems, values education among others are complementary. I guess this commitment for service is rooted from my orientation as a private secular teacher.
I only hope I don't get dizzy when I face my students today.
I don't feel well as I have colds and my kid has been sick for a couple of days with on and off fever. He has been absent from school for three (3) days and we still have to bring him to his pediatrician for thorough check - up while I am still contemplating whether I have to miss my class. This is the sad thing about being absent when you are teacher; you shall waste the time of all your students and I quite feel quite guilty about that, so, as much as possible, I go to school in spite of uncomfortable situations.
Teaching students about academic contents, health including human growth hormone supplements , social and economic problems, values education among others are complementary. I guess this commitment for service is rooted from my orientation as a private secular teacher.
I only hope I don't get dizzy when I face my students today.
| Reactions: |
Center of Excellence for Information Technology Education Programs
One of the main thrusts of CHED is for schools to provide quality education through competent faculty, sufficient facilities and effective programs can help produce highly able graduates. And, when schools manage to acquire COE recognition, they receive due assistance and honor from CHED.
In the Philippines, only the following schools are recognized as COE on IT:
In the Philippines, only the following schools are recognized as COE on IT:
- Ateneo de Manila University - NCR
- De La Salle University - NCR
- East Asia College - NCR
- Polytechnic University of the Philippines - NCR
- University of the Philippines-Diliman - NCR
- Baguio Colleges Foundation- CAR
- Lorma College - Region 1
- University of La Sallette - Region 2
- Angeles University Foundation - Region 3
- De La Salle University-Dasmariñas - Region 4
- University of the Philippines, Los Baños
- Ateneo de Naga - Region 5
- Southern Luzon Technological College Foundation Inc. -Legazpi - Region 5
- University of Negros Occidental-Recoletos - Region 6
- Cebu Institute of Technology - Region 7
- Asian Development Foundation College -Region 8
- Ateneo de Zamboanga - Region 9
- St. Columban College- Region 9
- Misamis University - Region 10
- Xavier University - Region 10
- Ateneo de Davao University - Region 11
- Notre Dame of Marbel University - Region 11
- Mindanao State University-Iligan Instituteof Technology - Region 12
Labels:IT Education,IT Graduates,personal
| Reactions: |
What Should You Study?
Your Learning Style: Competent and Cooperative |
![]() You have a great head for facts and figures. You can remember and use any fact you've read. You Should Study: Dentistry Education Environmental Science Finance Nursing Nutrition Science Medicine Law |
Overcoming College Fear
It is quite typical among incoming college freshmen that they shall feel anxiety as transition from high school to college kicks in. Thus, most schools do have Freshmen Forum or alike as an intervening medium to aid freshmen adjust with college life.
Normally, they are joined with other freshmen with some experts to discuss openly their anxiety and to discuss how they can cope with the social and academic pressures among others. Further, they are joined with peer councilors and student organizations where they can socially harness their skills, interests and talents.
The role of the Guidance Office contributes significantly to influencing freshmen to like their new life as students. They provide various services to include adjustment from staying away from home, some tips and insights on vices, sex, academic delinquency, health issues including sexual transmitted diseases, beauty and personality tips including blackheads treatment among others.
College life is never easy, however, it provides wide array of experience of fun, wisdom and excitement that when properly enjoyed can make college days quite pleasant and memorable.
Normally, they are joined with other freshmen with some experts to discuss openly their anxiety and to discuss how they can cope with the social and academic pressures among others. Further, they are joined with peer councilors and student organizations where they can socially harness their skills, interests and talents.
The role of the Guidance Office contributes significantly to influencing freshmen to like their new life as students. They provide various services to include adjustment from staying away from home, some tips and insights on vices, sex, academic delinquency, health issues including sexual transmitted diseases, beauty and personality tips including blackheads treatment among others.
College life is never easy, however, it provides wide array of experience of fun, wisdom and excitement that when properly enjoyed can make college days quite pleasant and memorable.
| Reactions: |
Java Certification Exam Tips on Constructors
Java Certification Exam is given to Java programmers to earn a professional JAVA certified recognition. I found this tips from this Java Exam Tips portal.
The JVM does not call an object’s constructor when an object is cloned.
Constructors never return a value. If you do specify a return value, the JVM will interpret your intended constructor as a method.
If a class contains no constructor declarations, then a default constructor that takes no arguments is supplied. This default constructor invokes the no-args superclass constructor, i.e. calls super();
If, in a constructor, you do not make a direct call to super or this (with or without args) [note: must be on the first line] then super(no args) will first be invoked then any code in the constructor will be executed. See constructors.jpr project.
A call to this in a constructor must also be on the first line. Note: can’t have an explicit call to super followed by a call to this in a constructor - only one direct call to another constructor is allowed.
Are You a Good Student?
You Are a Great Student |
![]() You aren't afraid to crack the books when you need to, and you make your education a true priority. You could become a PhD in anything, if you set your mind to it. There's no limit to what you can learn! |
Saturday, July 3, 2010
Term Exams Soon
Come second week of July, students of my school will have to hurdle through their Prelims exams and this definitely mean paying again for their tuition, complying with term requirements and studying for all their enrolled subjects' exams.
I can only feel for my students who have more than three subjects to juggle with because these subjects shall definitely require them to devote their time and resources. And, when they don't have good study habits, they can quite risk their grades.
I remember when I was still a student, I had to prepare for my major exams a week prior to exam dates to make me more comprehend the subjects and could relax during exam days. I had to endure long hours of deprived sleep, strained eyes from hard readings, and more hours for requirements and due projects that I looked quite lanky and dead. Good thing though that there are now de - stressors and medications like memory boosters and under eye cream for dark circles to make the toil less obvious.
But, nowadays, most students don't seriously study anymore and if they can find a way to make their exams easier, they will simply be happy to oblige to. I just hope that they can do well this coming exam as it entirely affects their semestral grades.
I can only feel for my students who have more than three subjects to juggle with because these subjects shall definitely require them to devote their time and resources. And, when they don't have good study habits, they can quite risk their grades.
I remember when I was still a student, I had to prepare for my major exams a week prior to exam dates to make me more comprehend the subjects and could relax during exam days. I had to endure long hours of deprived sleep, strained eyes from hard readings, and more hours for requirements and due projects that I looked quite lanky and dead. Good thing though that there are now de - stressors and medications like memory boosters and under eye cream for dark circles to make the toil less obvious.
But, nowadays, most students don't seriously study anymore and if they can find a way to make their exams easier, they will simply be happy to oblige to. I just hope that they can do well this coming exam as it entirely affects their semestral grades.
| Reactions: |
Another Java Constructor Sample
When an object is defined, we can also access methods and fields. Below is another use of constructor and accessing instance variables for use.
[+/-] show/hide
import java.io.*;
public class CircleQuiz {
double radius;
double area, diameter;
CircleQuiz()
{ radius=1;}
public static void main(String args[]) throws IOException{
BufferedReader br= new BufferedReader(new InputStreamReader(System.in));
CircleQuiz x=new CircleQuiz();
String str;
double r;
System.out.println("use of Constructors:");
System.out.println("Default radius from a constructor: "+x.getRadius());
System.out.println("New Input for radius:");
System.out.println("Input radius :");
r=Double.parseDouble(br.readLine());
if (r<=0) r=x.radius; x.setRadius(r); System.out.println("Diameter "+x.computeDiameter(r)); System.out.println("Area"+x.computeArea(r)); } double getRadius() { return radius;} void setRadius(double x) { radius=x;} double computeDiameter(double r ) { double circleDiameter =r * 2; return circleDiameter;} double computeArea(double r ) { double circleArea =3.14 * r * r; return circleArea;} }
[+/-] show/hide
import java.io.*;
public class CircleQuiz {
double radius;
double area, diameter;
CircleQuiz()
{ radius=1;}
public static void main(String args[]) throws IOException{
BufferedReader br= new BufferedReader(new InputStreamReader(System.in));
CircleQuiz x=new CircleQuiz();
String str;
double r;
System.out.println("use of Constructors:");
System.out.println("Default radius from a constructor: "+x.getRadius());
System.out.println("New Input for radius:");
System.out.println("Input radius :");
r=Double.parseDouble(br.readLine());
if (r<=0) r=x.radius; x.setRadius(r); System.out.println("Diameter "+x.computeDiameter(r)); System.out.println("Area"+x.computeArea(r)); } double getRadius() { return radius;} void setRadius(double x) { radius=x;} double computeDiameter(double r ) { double circleDiameter =r * 2; return circleDiameter;} double computeArea(double r ) { double circleArea =3.14 * r * r; return circleArea;} }
Labels:Java,sample programs,source codes
| Reactions: |
Add-on Works Among Teachers but Unpaid
Aside from serving the school for a school year, public teachers do have to serve during election time and census works too. And, although they receive supplemental benefits from these, unfortunately, they have to long wait for their payments. Sigh! As a teacher, I can only lament of all the overworks but underpays we endure.
Here's a news clip taken from ABS - CBN news page.
Here's a news clip taken from ABS - CBN news page.
| Reactions: |
Bonding with Students
Few pics with old students and my sibling, Tammy
The thing with teaching in different schools over a span of a decade brings a lot of good and bad sides. For one, I get to meet different eccentric and subtle students and colleagues including administrators. And whenever I can, I try to hang out with them until they are no longer my students and I am out from their school.
I remember joining them in their acquaintance parties, birthdays, proms, weddings, hikings among others and once in awhile, I get to bump with them in malls or in another city but they never fail to say hello and more. So, now that I am in another school, I only hold a lot of good memories with my old students including wacky pictures in my unit that I wish I can slide show together with the rest of the nice pictures with friends and loved ones.
Most of my students are already graduates and working themselves but they still give their greetings through a random message sent to my phone or to my online accounts and I can quite get touched.
Another Java Constructor with Static Methods
It is possible that when we define methods to be static, we can access them using classname.methodname() format.
The program below is the other version of this program.
[+/-] show/hide
import java.io.*;
public class Householdv2 {
static int numOccupants;
static double annualIncome;
Householdv2()
{ numOccupants=1;
annualIncome=0;}
public static void main(String args[]) throws IOException{
BufferedReader br= new BufferedReader(new InputStreamReader(System.in));
//Household x=new Household();
String str;
int numOcc;
double xincome=0.0;
System.out.println("use of Constructors:");
System.out.println("Number of Occupants "+Householdv2.getOccupants());
System.out.println("Annual Income"+Householdv2.getIncome());
System.out.println("After Use:");
System.out.println("Input number of occupants :");
numOcc=Integer.parseInt(br.readLine());
System.out.println("Input Annual Income: ");
str=br.readLine();
xincome=Double.parseDouble(str);
Householdv2.setOccupants(numOcc);
Householdv2.setIncome(xincome);
if (numOcc<=0) Householdv2.numOccupants=1; if (xincome<0.0) Householdv2.annualIncome=0.0; System.out.println("Number of Occupants "+Householdv2.getOccupants()); System.out.println("Annual Income"+Householdv2.getIncome()); } static double getIncome() { return annualIncome;} static void setOccupants(int x) { numOccupants=x;} static double getOccupants() { return numOccupants;} static void setIncome(double x) { annualIncome=x;} }
The program below is the other version of this program.
[+/-] show/hide
import java.io.*;
public class Householdv2 {
static int numOccupants;
static double annualIncome;
Householdv2()
{ numOccupants=1;
annualIncome=0;}
public static void main(String args[]) throws IOException{
BufferedReader br= new BufferedReader(new InputStreamReader(System.in));
//Household x=new Household();
String str;
int numOcc;
double xincome=0.0;
System.out.println("use of Constructors:");
System.out.println("Number of Occupants "+Householdv2.getOccupants());
System.out.println("Annual Income"+Householdv2.getIncome());
System.out.println("After Use:");
System.out.println("Input number of occupants :");
numOcc=Integer.parseInt(br.readLine());
System.out.println("Input Annual Income: ");
str=br.readLine();
xincome=Double.parseDouble(str);
Householdv2.setOccupants(numOcc);
Householdv2.setIncome(xincome);
if (numOcc<=0) Householdv2.numOccupants=1; if (xincome<0.0) Householdv2.annualIncome=0.0; System.out.println("Number of Occupants "+Householdv2.getOccupants()); System.out.println("Annual Income"+Householdv2.getIncome()); } static double getIncome() { return annualIncome;} static void setOccupants(int x) { numOccupants=x;} static double getOccupants() { return numOccupants;} static void setIncome(double x) { annualIncome=x;} }
Labels:Java,lectures,sample programs,source codes
| Reactions: |
Another Java Constructor
As posted about Java's constructors, it can be used to initialize variables but may be later replaced by new values.
See sample program.
[+/-] show/hide
import java.io.*;
public class Household {
int numOccupants;
double annualIncome;
Household()
{ numOccupants=1;
annualIncome=0;}
public static void main(String args[]) throws IOException{
BufferedReader br= new BufferedReader(new InputStreamReader(System.in));
Household x=new Household();
String str;
int numOcc;
double xincome=0.0;
System.out.println("use of Constructors:");
System.out.println("Number of Occupants "+x.getOccupants());
System.out.println("Annual Income"+x.getIncome());
System.out.println("After Use:");
System.out.println("Input number of occupants :");
numOcc=Integer.parseInt(br.readLine());
System.out.println("Input Annual Income: ");
str=br.readLine();
xincome=Double.parseDouble(str);
x.setOccupants(numOcc);
x.setIncome(xincome);
if (numOcc<=0)
x.numOccupants=1;
if (xincome<=0.0)
x.annualIncome=0.0;
System.out.println("Number of Occupants "+x.getOccupants());
System.out.println("Annual Income"+x.getIncome()); }
double getIncome()
{ return this.annualIncome;}
void setOccupants(int x)
{ this.numOccupants=x;}
double getOccupants()
{ return this.numOccupants;}
void setIncome(double x)
{ annualIncome=x;} }
See sample program.
[+/-] show/hide
import java.io.*;
public class Household {
int numOccupants;
double annualIncome;
Household()
{ numOccupants=1;
annualIncome=0;}
public static void main(String args[]) throws IOException{
BufferedReader br= new BufferedReader(new InputStreamReader(System.in));
Household x=new Household();
String str;
int numOcc;
double xincome=0.0;
System.out.println("use of Constructors:");
System.out.println("Number of Occupants "+x.getOccupants());
System.out.println("Annual Income"+x.getIncome());
System.out.println("After Use:");
System.out.println("Input number of occupants :");
numOcc=Integer.parseInt(br.readLine());
System.out.println("Input Annual Income: ");
str=br.readLine();
xincome=Double.parseDouble(str);
x.setOccupants(numOcc);
x.setIncome(xincome);
if (numOcc<=0)
x.numOccupants=1;
if (xincome<=0.0)
x.annualIncome=0.0;
System.out.println("Number of Occupants "+x.getOccupants());
System.out.println("Annual Income"+x.getIncome()); }
double getIncome()
{ return this.annualIncome;}
void setOccupants(int x)
{ this.numOccupants=x;}
double getOccupants()
{ return this.numOccupants;}
void setIncome(double x)
{ annualIncome=x;} }
Labels:Java,lectures,sample programs,source codes
| Reactions: |
Friday, July 2, 2010
Knowledge 101
When the weather shifts from extreme cold to superb warm, our immunity only weakens and if we don't have a healthy lifestyle among other things, we can only aggravate our condition. On top of these typical illnesses, dengue fever is more dreaded.
There is now an alarming number of dengue cases where most students are affected. Dengue fever is caused by an affected mosquito carrying the dengue virus. Normally, these mosquitoes live in clean stagnant water that may have accumulated from regular rainfalls. Once bitten, the affected patient may acquire symptoms like high fever, severe headache, vomiting, rashes 3-4 days after the fever, and body pains that if not properly and promptly treated may also lead to death. Thus, the Department of Health can only advice the general public to remove any stagnant water and emit anti - dengue sprays especially in the late afternoons.
We can opt to be healthy or sick by becoming proactive and responsive to present health issues including dengue fever, cancer, obesity, strokes, heart diseases among others. Thus, we can only take actions and readings against common health problems and know their countermeasures like preventions, cures, side effects of treatments like side effects of diet pills to name a few.
Unexpected deaths or serious complications from typical problems can be prevented if only we are knowledgeable on how to combat them making us save our own life or our loved ones.
There is now an alarming number of dengue cases where most students are affected. Dengue fever is caused by an affected mosquito carrying the dengue virus. Normally, these mosquitoes live in clean stagnant water that may have accumulated from regular rainfalls. Once bitten, the affected patient may acquire symptoms like high fever, severe headache, vomiting, rashes 3-4 days after the fever, and body pains that if not properly and promptly treated may also lead to death. Thus, the Department of Health can only advice the general public to remove any stagnant water and emit anti - dengue sprays especially in the late afternoons.
We can opt to be healthy or sick by becoming proactive and responsive to present health issues including dengue fever, cancer, obesity, strokes, heart diseases among others. Thus, we can only take actions and readings against common health problems and know their countermeasures like preventions, cures, side effects of treatments like side effects of diet pills to name a few.
Unexpected deaths or serious complications from typical problems can be prevented if only we are knowledgeable on how to combat them making us save our own life or our loved ones.
| Reactions: |
Java's Constructor with Arguments
You can pass arguments to constructors but just like any other method, arguments for constructor must be one:one ratio and of the same data type.
Below are the two files where one passes arguments to another file containing the constructor.
[+/-] show/hide
import javax.swing.*;
class TestExpandedConstructorv2 {
public static void main (String args[]){
String sitenum = JOptionPane.showInputDialog(" Input site number:");
String UsageFee = JOptionPane.showInputDialog(" Input usage fee:");
String mgrname = JOptionPane.showInputDialog(" Input manager's name:");
int a = Integer.parseInt(sitenum);
double b =Double.parseDouble(UsageFee);
//calling a class with constructor and arguments
EventSiteConstructorv2 oneSite = new EventSiteConstructorv2(a,b,mgrname);
System.out.println("Name :"+oneSite.getManagerName());
System.out.println("Site Number: "+oneSite.getSiteNumber());
System.out.println("Usage Fee:"+oneSite.getUsageFee());
}
}
public class EventSiteConstructorv2 {
private int siteNumber;
private double usageFee;
private String managerName;
EventSiteConstructorv2(int x, double y, String z){
siteNumber=x;
usageFee=y;
managerName=z;
}
public int getSiteNumber()
{ return siteNumber;}
public void setSiteNumber(int n)
{ siteNumber=n;}
public void setUsageFee(double amt)
{ usageFee=amt;}
public double getUsageFee()
{ return usageFee;}
public String getManagerName()
{ return managerName;}
public void setManagerName(String name)
{ managerName=name;}
}
Below are the two files where one passes arguments to another file containing the constructor.
[+/-] show/hide
import javax.swing.*;
class TestExpandedConstructorv2 {
public static void main (String args[]){
String sitenum = JOptionPane.showInputDialog(" Input site number:");
String UsageFee = JOptionPane.showInputDialog(" Input usage fee:");
String mgrname = JOptionPane.showInputDialog(" Input manager's name:");
int a = Integer.parseInt(sitenum);
double b =Double.parseDouble(UsageFee);
//calling a class with constructor and arguments
EventSiteConstructorv2 oneSite = new EventSiteConstructorv2(a,b,mgrname);
System.out.println("Name :"+oneSite.getManagerName());
System.out.println("Site Number: "+oneSite.getSiteNumber());
System.out.println("Usage Fee:"+oneSite.getUsageFee());
}
}
public class EventSiteConstructorv2 {
private int siteNumber;
private double usageFee;
private String managerName;
EventSiteConstructorv2(int x, double y, String z){
siteNumber=x;
usageFee=y;
managerName=z;
}
public int getSiteNumber()
{ return siteNumber;}
public void setSiteNumber(int n)
{ siteNumber=n;}
public void setUsageFee(double amt)
{ usageFee=amt;}
public double getUsageFee()
{ return usageFee;}
public String getManagerName()
{ return managerName;}
public void setManagerName(String name)
{ managerName=name;}
}
Labels:Java,lectures,sample programs,source codes
| Reactions: |
Java's Constructors
Constructors are made to create objects and initialize their values. Unlike other methods, constructor method carries the name of its class and does not return any value.
I have two programs below with one file containing the constructor while the other one is calling the constructor file.
[+/-] show/hide
public class TestExpandedConstructor {
public static void main (String args[]){
EventSiteConstructor oneSite = new EventSiteConstructor(); // calling file with constructor
System.out.println("Name :"+oneSite.getManagerName());
System.out.println("Site Number: "+oneSite.getSiteNumber());
System.out.println("Usage Fee:"+oneSite.getUsageFee());
}
}
public class EventSiteConstructor {
private int siteNumber;
private double usageFee;
private String managerName;
EventSiteConstructor(){ //this is the constructor method
siteNumber=5;
usageFee=1000.00;
managerName="Rosilie";
}
public int getSiteNumber()
{ return siteNumber;}
public void setSiteNumber(int n)
{ siteNumber=n;}
public void setUsageFee(double amt)
{ usageFee=amt;}
public double getUsageFee()
{ return usageFee;}
public String getManagerName()
{ return managerName;}
public void setManagerName(String name)
{ managerName=name;}
}
I have two programs below with one file containing the constructor while the other one is calling the constructor file.
[+/-] show/hide
public class TestExpandedConstructor {
public static void main (String args[]){
EventSiteConstructor oneSite = new EventSiteConstructor(); // calling file with constructor
System.out.println("Name :"+oneSite.getManagerName());
System.out.println("Site Number: "+oneSite.getSiteNumber());
System.out.println("Usage Fee:"+oneSite.getUsageFee());
}
}
public class EventSiteConstructor {
private int siteNumber;
private double usageFee;
private String managerName;
EventSiteConstructor(){ //this is the constructor method
siteNumber=5;
usageFee=1000.00;
managerName="Rosilie";
}
public int getSiteNumber()
{ return siteNumber;}
public void setSiteNumber(int n)
{ siteNumber=n;}
public void setUsageFee(double amt)
{ usageFee=amt;}
public double getUsageFee()
{ return usageFee;}
public String getManagerName()
{ return managerName;}
public void setManagerName(String name)
{ managerName=name;}
}
Labels:Java,lectures,sample programs,source codes
| Reactions: |
Students’ Acquaintance Party
It has been the tradition among schools that acquaintance parties are held for various departments. This is to welcome the freshmen and transferees to the department and to allow old and new students to have fun together. The entire faculty along with school personnel normally joins this party to warm students for the new school year.
Our school shall hold our acquaintance party this July and depending on the students’ clamor for formal or casual party, the location is to be determined yet.
Normally, when the acquaintance party is formal in theme, the ladies are on their long silk dress with proper make-up while the gentlemen are on their coats with mens ties in a lavish hotel dining room.
My old school before would rather hold our parties in beaches or resorts for a more informal event and wacky fun.
Our school shall hold our acquaintance party this July and depending on the students’ clamor for formal or casual party, the location is to be determined yet.
Normally, when the acquaintance party is formal in theme, the ladies are on their long silk dress with proper make-up while the gentlemen are on their coats with mens ties in a lavish hotel dining room.
My old school before would rather hold our parties in beaches or resorts for a more informal event and wacky fun.
More Java Methods
Mutator and accessor methods can be created in Java; you can check the sample program below.
[+/-] show/hide
/*Sample program on methods
*/
import java.io.*;
public class TuitionMethodv2 {
double tuition;
double tunits;
double unitprice;
String name;
String course;
public static void main(String args[]) throws IOException{
BufferedReader br= new BufferedReader(new InputStreamReader(System.in));
TuitionMethodv2 myObject=new TuitionMethodv2();
System.out.println("Input your name:");
String myname=br.readLine();
System.out.println("Input your course:");
String mycourse=br.readLine();
System.out.println("Input tuition units:");
String totalunits=br.readLine();
double mytunits=Double.parseDouble(totalunits);
System.out.println("Input unit price:");
String unitrate=br.readLine();
double myuprice=Double.parseDouble(unitrate);
myObject.setName(myname);
myObject.setCourse(mycourse);
myObject.setUnitPrice(myuprice);
myObject.setTotalUnits(mytunits);
System.out.println("Name: "+myObject.getName());
System.out.println("Course: "+myObject.getCourse());
System.out.println("Total Units: "+myObject.getTotalUnits());
System.out.println("Unit Price: "+myObject.getUnitPrice());
System.out.println("Due Tuition: "+myObject.compute());
}
void setName(String xname){
name=xname;
}
void setCourse(String xcourse){
course=xcourse;
}
void setUnitPrice(double xunitprice){
unitprice=xunitprice;
}
void setTotalUnits(double xtunits){
tunits=xtunits;
}
String getName(){
return name;
}
String getCourse(){
return course;
}
double getUnitPrice(){
return unitprice;
}
double getTotalUnits(){
return tunits;
}
double compute()
{ tuition= tunits*unitprice;
return tuition;}
}
[+/-] show/hide
/*Sample program on methods
*/
import java.io.*;
public class TuitionMethodv2 {
double tuition;
double tunits;
double unitprice;
String name;
String course;
public static void main(String args[]) throws IOException{
BufferedReader br= new BufferedReader(new InputStreamReader(System.in));
TuitionMethodv2 myObject=new TuitionMethodv2();
System.out.println("Input your name:");
String myname=br.readLine();
System.out.println("Input your course:");
String mycourse=br.readLine();
System.out.println("Input tuition units:");
String totalunits=br.readLine();
double mytunits=Double.parseDouble(totalunits);
System.out.println("Input unit price:");
String unitrate=br.readLine();
double myuprice=Double.parseDouble(unitrate);
myObject.setName(myname);
myObject.setCourse(mycourse);
myObject.setUnitPrice(myuprice);
myObject.setTotalUnits(mytunits);
System.out.println("Name: "+myObject.getName());
System.out.println("Course: "+myObject.getCourse());
System.out.println("Total Units: "+myObject.getTotalUnits());
System.out.println("Unit Price: "+myObject.getUnitPrice());
System.out.println("Due Tuition: "+myObject.compute());
}
void setName(String xname){
name=xname;
}
void setCourse(String xcourse){
course=xcourse;
}
void setUnitPrice(double xunitprice){
unitprice=xunitprice;
}
void setTotalUnits(double xtunits){
tunits=xtunits;
}
String getName(){
return name;
}
String getCourse(){
return course;
}
double getUnitPrice(){
return unitprice;
}
double getTotalUnits(){
return tunits;
}
double compute()
{ tuition= tunits*unitprice;
return tuition;}
}
Labels:Java,sample programs,source codes
| Reactions: |
Creating Java Objects
We can create an instance of a class through the new keyword associated with a certain class. For instance if there exists a class called TuitionMethod, we can create an object, say myObject so we can freely access the class' methods and fields.
To create an object, we write:
TuitionMethod myObject = new TuitionMethod();
[+/-] show/hide
To create an object, we write:
TuitionMethod myObject = new TuitionMethod();
[+/-] show/hide
/*Sample program on methods
*/
import java.io.*;
public class TuitionMethod {
double tuition;
public static void main(String args[]) throws IOException{
double tunits;
double unitprice;
BufferedReader br= new BufferedReader(new InputStreamReader(System.in));
TuitionMethod myObject=new TuitionMethod();
System.out.println("Input tuition units:");
String totalunits=br.readLine();
tunits=Double.parseDouble(totalunits);
System.out.println("Input unit price:");
String unitrate=br.readLine();
unitprice=Double.parseDouble(unitrate);
myObject.compute(tunits,unitprice);
System.out.println("Your tuition is "+myObject.compute(tunits,unitprice ));
}
private void compute(double myunits, double uprice)
{ double tuition= myunits*uprice;
return tuition;
}
}
*/
import java.io.*;
public class TuitionMethod {
double tuition;
public static void main(String args[]) throws IOException{
double tunits;
double unitprice;
BufferedReader br= new BufferedReader(new InputStreamReader(System.in));
TuitionMethod myObject=new TuitionMethod();
System.out.println("Input tuition units:");
String totalunits=br.readLine();
tunits=Double.parseDouble(totalunits);
System.out.println("Input unit price:");
String unitrate=br.readLine();
unitprice=Double.parseDouble(unitrate);
myObject.compute(tunits,unitprice);
System.out.println("Your tuition is "+myObject.compute(tunits,unitprice ));
}
private void compute(double myunits, double uprice)
{ double tuition= myunits*uprice;
return tuition;
}
}
Labels:lectures,sample programs,source codes
| Reactions: |
Enduring Students and Teachers
Next to home, school is the second place where students spend most of their time. And, with two weeks since class time, I know students are having tough times at school especially when teachers swarm them with exams and requirements. My own college sibling can only lament of her too many school works.
I only work as a part-time teacher but my three (3) subjects can quite overwhelm me that I wish I can have a vacation again. Branson vacations seem to be a lovely and pleasing start and spending breaks with loved ones can only make the time – off more delightful.
We can only wait for October to come before we can have our semestral break again. For now, students and teachers including myself can only endure school time.
I only work as a part-time teacher but my three (3) subjects can quite overwhelm me that I wish I can have a vacation again. Branson vacations seem to be a lovely and pleasing start and spending breaks with loved ones can only make the time – off more delightful.
We can only wait for October to come before we can have our semestral break again. For now, students and teachers including myself can only endure school time.
Another Sample Java Program on Methods
You can pass arguments to your Java method(s) and using an instance of a class or using static methods, this method can be freely accessed within the file or outside the file.
[+/-] show/hide
[+/-] show/hide
/*Sample program on methods
*/
import java.io.*;
public class ComputePayQuiz {
double netpay;
public static void main(String args[]) throws IOException{
double hrate;
double hrsworked;
double tdeductions;
String name;
String position;
String payperiod;
BufferedReader br= new BufferedReader(new InputStreamReader(System.in));
ComputePayQuiz myObject=new ComputePayQuiz();
System.out.println("Input employee's name:");
name=br.readLine();
System.out.println("Input employee's position:");
position=br.readLine();
System.out.println("Input payroll period:");
payperiod=br.readLine();
System.out.println("Input employee's hourly rate:");
hrate=Double.parseDouble(br.readLine());
System.out.println("Input employee's hours worked:");
hrsworked=Double.parseDouble(br.readLine());
System.out.println("Input employee's total deductions:");
tdeductions=Double.parseDouble(br.readLine());
System.out.println("Payroll Period:"+payperiod);
System.out.println("Name:"+name);
System.out.println("Position:"+position);
System.out.println("Hourly Rate:"+hrate);
System.out.println("Hours worked:"+hrsworked);
System.out.println("Employee's Net Pay: "+myObject.compute(hrate,hrsworked,tdeductions));
}
double compute(double hr, double hw, double td)
{ netpay= (hr*hw) - td;
return netpay;
}
}
*/
import java.io.*;
public class ComputePayQuiz {
double netpay;
public static void main(String args[]) throws IOException{
double hrate;
double hrsworked;
double tdeductions;
String name;
String position;
String payperiod;
BufferedReader br= new BufferedReader(new InputStreamReader(System.in));
ComputePayQuiz myObject=new ComputePayQuiz();
System.out.println("Input employee's name:");
name=br.readLine();
System.out.println("Input employee's position:");
position=br.readLine();
System.out.println("Input payroll period:");
payperiod=br.readLine();
System.out.println("Input employee's hourly rate:");
hrate=Double.parseDouble(br.readLine());
System.out.println("Input employee's hours worked:");
hrsworked=Double.parseDouble(br.readLine());
System.out.println("Input employee's total deductions:");
tdeductions=Double.parseDouble(br.readLine());
System.out.println("Payroll Period:"+payperiod);
System.out.println("Name:"+name);
System.out.println("Position:"+position);
System.out.println("Hourly Rate:"+hrate);
System.out.println("Hours worked:"+hrsworked);
System.out.println("Employee's Net Pay: "+myObject.compute(hrate,hrsworked,tdeductions));
}
double compute(double hr, double hw, double td)
{ netpay= (hr*hw) - td;
return netpay;
}
}
Labels:lectures,sample programs,source codes
| Reactions: |
Getting All Brain – Twisted with Teaching
I may have taught for over a decade and have acquired the needed teaching skills and competency to deliver my lessons but I guess I can only complain on what I teach from my subject load. Over these years, I handled a good deal of technical subjects from the basics to major subjects of Information Technology, Systems and Computer Science. However, with constant innovations in computer industry, the content can only vary in very fast pace making the teacher all frenzy.
I guess with teaching, business and blogging works among other things, I can only get head – twisted. Sigh! Am I really getting old with these stuffs? I can only blame too many works on hand that time is only limited and wacky.
I guess with teaching, business and blogging works among other things, I can only get head – twisted. Sigh! Am I really getting old with these stuffs? I can only blame too many works on hand that time is only limited and wacky.
| Reactions: |
Thursday, July 1, 2010
Top Ways to Earn A Grades
Earning valedictory or cum laude recognitions are not at all easy but not impossible too. I quite believe that higher IQ means something but intelligence is not enough to earn high marks, not alone A grades as STUDY HABITS play a major thing.
So, here are few but effective ways to earn an elusive A from any subject even if it means terrible teachers.
1. Read more. Don't just rely on your teachers' resources; reading a hefty of sources can make your teacher's subject way too easy and elementary.
2. Be prepared 1 - 2 steps ahead of your teachers' present lessons. Having a course topic outline will get you more ready.
3. Prepare for unannounced and announced exams a few days at least. To assess students' preparedness or to at least punish students, teachers do give unannounced exams just for the heck of it, thus, having read in advance can make you still earn good scores.
4. Be with friends who share similar motivations with you. Stay clear from friends who would rather invite you to a party or try vices; not only that they can influence you, they can also mock your ideals.
5. Know your priorities and remain focused. Knowing that you prioritize your grades more than anything else is enough to be personally motivated. However, the idea is to remain consistent and proactive with these priorities.
6. Take a break when needed. You still deserve safe and responsible fun since this will get you re-energized and reminded you that you are still alive and a social being and not just a walking bookworm.
So, here are few but effective ways to earn an elusive A from any subject even if it means terrible teachers.
1. Read more. Don't just rely on your teachers' resources; reading a hefty of sources can make your teacher's subject way too easy and elementary.
2. Be prepared 1 - 2 steps ahead of your teachers' present lessons. Having a course topic outline will get you more ready.
3. Prepare for unannounced and announced exams a few days at least. To assess students' preparedness or to at least punish students, teachers do give unannounced exams just for the heck of it, thus, having read in advance can make you still earn good scores.
4. Be with friends who share similar motivations with you. Stay clear from friends who would rather invite you to a party or try vices; not only that they can influence you, they can also mock your ideals.
5. Know your priorities and remain focused. Knowing that you prioritize your grades more than anything else is enough to be personally motivated. However, the idea is to remain consistent and proactive with these priorities.
6. Take a break when needed. You still deserve safe and responsible fun since this will get you re-energized and reminded you that you are still alive and a social being and not just a walking bookworm.
Labels:lectures on life and living
| Reactions: |
Subscribe to:
Posts (Atom)












