Professional Documents
Culture Documents
in
CS ELECTIVE
Submmited by:
Arlo Carl Ancheta Figuracion
BS Computer Science II-A
Definition:
The code above is a source code a java programming that will display the characters
Hello World and also the Hello Data and this is my first program in java.
if(gender.equals("m")){
System.out.println("Male");
}
else if(gender.equals("f")){
System.out.println("Female");
}
else{
System.out.println("Invalid Character");
}
}
Definition:
The code above is a source code of an if else condition in java programming that will
ask the user what is the Gender and display the gender of the user. The legends are m that
corresponds to Male and f for the Female.
System.out.println("PERSONAL INFORMATION");
System.out.print("Name: Arlo Carl Ancheta Figuracion");
System.out.println("
Age: 19 years old ");
System.out.print("Birthday: April 14, 1993");
System.out.println("
Birth Place: Laoag City ");
System.out.println("Address: Brgy. 57 Daurao, Pila Laoag City");
System.out.print("Civil Status: Single");
System.out.println("
Citizenship: Filipino");
System.out.println("");
System.out.println("FAMILY BACKGROUND");
System.out.println("Name of Father: Warlito Amistosa
Figuracion");
System.out.println("Name of Mother: Anna Liza Ancheta
Figuracion");
System.out.println("Siblings: Ariel Anne Wharly A. Figuracion");
System.out.println("
Angelie July Anne A. Figuracion");
}
Definition:
The source code above is a program that will display only my Biodata. By using the
[System.out.println("");].
Definition:
The source code above is a program that will compute and display for the sum,
difference, product and quotient of the two numbers/integers by the user.
Definition:
The source code above will compute for the Basic Salary by multiplying the product of
number of hours work in a day and 85 and the number of days worked in a month, Totality of
Deduction by adding the pag-ibig(100.00), SSS(150.00) and the Tax of Basic Salary of 12%and
the Total/Net Salary by subtracting the Basic Salary and the Totality of deduction and display
and also ask for the name of the employee, number of days worked in a month, number of hours
work in a day, Pag-ibig, SSS and Tax.
Project Name: IfelseSalary
Source Code:
import java.util.*;
public class IfelseSalary {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sal = new Scanner(System.in);
String status;
String empname;
int noOfWork;
int noOfDays;
double pagibig,sss,Tax,Tax1;
double TofDeduction;
double BSalary,Tsalary;
System.out.print("Name: ");
empname=sal.next();
System.out.print("No. of hours Worked per Day: ");
noOfWork=sal.nextInt();
System.out.print("No. of Days Worked: ");
noOfDays=sal.nextInt();
System.out.print("Enter Status: ");
status=sal.next();
if(status.equals("s")){
pagibig=100.00;
sss=150.00;
Tax1=0.12;
BSalary=(noOfWork*85)*noOfDays;
Tax=BSalary*Tax1;
TofDeduction=pagibig+sss+Tax;
Tsalary=BSalary-TofDeduction;
System.out.println("Name: "+empname);
System.out.println("No. of hours Worked per Day:
"+noOfWork);
"+TofDeduction);
}
else if(status.equals("m")){
pagibig=100.00;
sss=150.00;
Tax1=0.06;
BSalary=(noOfWork*85)*noOfDays;
Tax=BSalary*Tax1;
TofDeduction=pagibig+sss+Tax;
Tsalary=BSalary-TofDeduction;
System.out.println("Name: "+empname);
System.out.println("No. of hours Worked per Day:
"+noOfWork);
}
else if(status.equals("w")){
pagibig=100.00;
sss=150.00;
Tax1=0.03;
BSalary=(noOfWork*85)*noOfDays;
Tax=BSalary*Tax1;
TofDeduction=pagibig+sss+Tax;
Tsalary=BSalary-TofDeduction;
System.out.println("Name: "+empname);
System.out.println("No. of hours Worked per Day:
"+noOfWork);
}
else{
}
}
Definition:
System.out.println("invalid");
The source code above will compute for the Basic Salary by multiplying the product of
number of hours work in a day and 85 and the number of days worked in a month, Totality of
Deduction by adding the pag-ibig(100.00), SSS(150.00) and the Tax of Basic Salary and the
Total/Net Salary by subtracting the Basic Salary and the Totality of deduction and display and
also ask for the name of the employee, number of days worked in a month, number of hours
work in a day, Pag-ibig, SSS and Tax.
This program will ask the if the employee is s single, m married or w widowed to
know what the corresponding Tax value is for the employee.
Project Name: OddEven
Source Code:
import java.util.*;
public class OddEven{
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
int n;
Scanner num = new Scanner(System.in);
System.out.print("Enter Integer: ");
n=num.nextInt();
if (n % 2 == 0)
System.out.println("Given number is Even.");
else
System.out.println("Given number is Odd.");
}
}
Definition:
The source code above is determining if the number/integer input by the user is Odd or
Even.
System.out.println("FAMILY BACKGROUND");
System.out.println("Name of Father:
Fname=bio.next();
System.out.println("Name of Mother:
Mname=bio.next();
System.out.println("Siblings: ");
Sibling=bio.next();
Sibling1=bio.next();
");
");
System.out.println("PERSONAL INFORMATION");
System.out.print("Name: "+fname+" "+sname+" "+mname+" "+lname);
System.out.println("
Age: "+age+" tears old");
System.out.print("Sex: "+Sex);
System.out.println("
Contact Number: "+num);
System.out.println("E-mail: " + email);
System.out.print("Birthday: "+day+" "+mons+" "+year);
System.out.println("
BirthPlace: "+bplace);
System.out.println("Address: "+add);
System.out.print("Civil Status: "+cstatus);
System.out.println("
Citizenship: "+cship);
System.out.println("Religion: "+rel);
System.out.println("FAMILY BACKGROUND");
System.out.println("Name of Father: "+Fname);
System.out.println("Name of Mother: "+Mname);
System.out.print("Siblings: "+Sibling);
System.out.println(
Sibling1);
System.out.println("Motto: Time is Gold");
}
}
Definition:
The source code above is a program that will ask the user what is the following last name,
first name, second name, middle name, address, age, birthday, birthplace, citizenship, religion,
civil status, name of Father and mother and siblings, sex preference, contact number and motto.
And display them. By using the [System.out.println("" + );].
Definition:
The Source code above is programs that will denominate a certain amount of bill or
currency.