Symbianize Forum

Most of our features and services are available only to members, so we encourage you to login or register a new account. Registration is free, fast and simple. You only need to provide a valid email. Being a member you'll gain access to all member forums and features, post a message to ask question or provide answer, and share or find resources related to mobile phones, tablets, computers, game consoles, and multimedia.

All that and more, so what are you waiting for, click the register button and join us now! Ito ang website na ginawa ng pinoy para sa pinoy!

All about programming (Specially c, c++, VB, Java)

example nga ng program na magksama abstraction, inheritance polymorhism, encapsulation!!! asap...
 
Write a function that outputs a right-side-up triangle of height n and width 2n-1; the output for n = 6 would be:
xxxxx *
xxxx***
xxx*****
xx*******
x*********
***********

Tanong ko lang po kung papaano po makagawa ng ganito?:noidea:
 
Last edited:
pa help nmn po sa case study nmin :s ung program namin about sa trigonemetric function :S
ang gamit po namin ee turbo c++ sana may maka2long..
kahit ung pinaka una lng.. ako na bahalang mag 2loy salamat :S
 
input a number between 1-10.
may pagbabasehan k n number na 3 and 8
pag ng input k ng number 1-5 magbbase k lang s 3
tpos nman if 6-10 base k ng 8
example is pag naginput k ng 2
ang li2taw is 2 is less than 3 pero hndi nia aoutput ung 2 is less than 8
then kung 4 or 5 ininput mo ssbhin is 4 is greater then 4 pero hndi li2taw na 4 is less than 8..

sana matulungan nio po ako..
 
pa help guys :) JAVA po ito ah :)

pwede po gamitin either JOption.pane or BufferedReader :)

write a program that will output the ff. nunbers.
1,2,4,7,11,16,32,39,47,56,66
 
Last edited:
^ hindi ba pwedeng print mo nlng yang mga numbers? wala ng bufferedreadr? kasi for input un
 
^ hindi ba pwedeng print mo nlng yang mga numbers? wala ng bufferedreadr? kasi for input un

Hindi po pwede input lng po eh bali po gagamit ka po sir ng looping para lumabas bali bumibilang siya ng 1,2,3,4,5,6,7,8,9,10

kea po ang lalabas na ouput is 1,2,4,7,11,16,32,39,47,56,66 :)
 
Hindi po pwede input lng po eh bali po gagamit ka po sir ng looping para lumabas bali bumibilang siya ng 1,2,3,4,5,6,7,8,9,10

kea po ang lalabas na ouput is 1,2,4,7,11,16,32,39,47,56,66 :)

ang gulo ng sequence boss ah?
ndi ba ganito sequence n2?

1+1=2
2+2=4
4+3=7
7+4=11
11+5=16
16+6=22
22+7=29
29+8=37
37+9=46
46+10=56
 
ang gulo ng sequence boss ah?
ndi ba ganito sequence n2?

1+1=2
2+2=4
4+3=7
7+4=11
11+5=16
16+6=22
22+7=29
29+8=37
37+9=46
46+10=56

ganyan po

import java.io.*;

public class Add
{
public static void main(String args []) throws Exception
{
int N=0, total=0;

for (N=1; N<10; ++N)
{

System.out.print(total + N + ", ");

if(N==1)
total =+ N-1;

else
if(N==5)
total =+16;

else
total =+ N;

}
}
}


kso ung output ko is 1, 2, 5, 7, 9, 22, 13, 15, 17

pag dating po sa pang 3 na loop nya 5 po dapat po is 4 atska pag lampas sa 7 mali na po HELP po. :pray:
 
e2 ung ginawa ko sa php

$i = 1;
for($s = 0; $s<=10; $s++){



$i = $i+$s;
echo $i.", ";

}

Output: 1, 2, 4, 7, 11, 16, 22, 29, 37, 46, 56,

sa java ganito ata, wla kc ako jdk d2 eh..

int i, adder;
i = 0;

for(adder=0; adder<=10; adder++){

i = i+adder;
System.out.print(i + ", ");

}

ptry nlng boss.
 
ganyan po

import java.io.*;

public class Add
{
public static void main(String args []) throws Exception
{
int N=0, total=0;

for (N=1; N<10; ++N)
{

System.out.print(total + N + ", ");

if(N==1)
total =+ N-1;

else
if(N==5)
total =+16;

else
total =+ N;

}
}
}


kso ung output ko is 1, 2, 5, 7, 9, 22, 13, 15, 17

pag dating po sa pang 3 na loop nya 5 po dapat po is 4 atska pag lampas sa 7 mali na po HELP po. :pray:


bakit mo nga pla ng import java.io.*; lol tnong lng
 
e2 ung ginawa ko sa php

$i = 1;
for($s = 0; $s<=10; $s++){



$i = $i+$s;
echo $i.", ";

}

Output: 1, 2, 4, 7, 11, 16, 22, 29, 37, 46, 56,

sa java ganito ata, wla kc ako jdk d2 eh..

int i, adder;
i = 0;

for(adder=0; adder<=10; adder++){

i = i+adder;
System.out.print(i + ", ");

}

ptry nlng boss.


eto po ung output nyan sir 0, 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, :)

mali po eh wait lng po ako salamat po tlga ah mahina po kc ako sa looping :)
 
eto po ung output nyan sir 0, 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, :)

mali po eh wait lng po ako salamat po tlga ah mahina po kc ako sa looping :)

plitan mo pla ung value nung i..

mali pla type ko.. i=0 dpat i=1
 
ganyan po

import java.io.*;

public class Add
{
public static void main(String args []) throws Exception
{
int N=0, total=0;

for (N=1; N<10; ++N)
{

System.out.print(total + N + ", ");

if(N==1)
total =+ N-1;

else
if(N==5)
total =+16;

else
total =+ N;

}
}
}


kso ung output ko is 1, 2, 5, 7, 9, 22, 13, 15, 17

pag dating po sa pang 3 na loop nya 5 po dapat po is 4 atska pag lampas sa 7 mali na po HELP po. :pray:
import java.io.*;
public class Symbianize{
public static void main(String[]args)throws Exception{
DataInputStream in=new DataInputStream(System.in);
int inp=Integer.parseInt(in.readLine());
int ans=1;
for (int i=1;i!=inp+1;i++)
System.out.print((ans=ans+i)+" ");

}
}

ganyan ba boss ?
 
import java.io.*;
public class Symbianize{
public static void main(String[]args)throws Exception{
DataInputStream in=new DataInputStream(System.in);
int inp=Integer.parseInt(in.readLine());
int ans=1;
for (int i=1;i!=inp+1;i++)
System.out.print((ans=ans+i)+" ");

}
}

ganyan ba boss ?

dapat po BufferedReader po gamit d po kc tinatanggap ng class ung DataInput :)

salamat po sir :)
 
Ano po male d2 ayaw nea kapag nag inser nako ng no. if hours para i multiply sa rate per hour nea. d nea minumltiple meron kase error. tapos ayaw nung sa ibang Employee id 104 lang pedeng mag input ng no. of hours.

Code:
import java.io.*;
import java.util.Scanner;
public class quiz{
public quiz(){}
public static void main(String[] args)throws IOException
{
System.out.println("Systems Plus College Foundation");
System.out.println(" Miranda, Angeles City ");


System.out.println(" EMPLOYEE PAYROLL");
//local variables
int nhw,E_CODE;
double rph;
float gp;

System.out.println(" Employee Code: ");
Scanner scan=new Scanner(System.in);
E_CODE=scan.nextInt();
if(E_CODE==101)
{
char[]LastName={'C','a','s','t','r','o'};
char[]FirstName={'J','u','n','e'};
char[]WholeName=new char[4];
char[]Name=new char[6];
rph=150.00;
System.arraycopy(FirstName,0,WholeName,0,4);
System.arraycopy(LastName,0,Name,0,6);
System.out.println("Employee Name : "+ new String(WholeName));
System.out.println(new String(Name));
System.out.println("Rate/Hr:"+rph);
}
if(E_CODE==102)
{
char[]LastName={'S','a','l','a','s'};
char[]FirstName={'M','i','c','o'};
char[]WholeName=new char[4];
char[]Name=new char[6];
rph=154.00;
System.arraycopy(FirstName,0,WholeName,0,4);
System.arraycopy(LastName,0,Name,0,5);
System.out.println("Employee Name : "+ new String(WholeName));
System.out.println(new String(Name));
System.out.println("Rate/Hr:"+rph);
E_CODE=scan.nextInt();

System.out.println("Grosspay: "+ gp);
}
if(E_CODE==103)
{
char[]LastName={'D','i','z','o','n'};
char[]FirstName={'M','a','n','n','y'};
char[]WholeName=new char[5];
char[]Name=new char[5];
rph=200.00;
System.arraycopy(FirstName,0,WholeName,0,5);
System.arraycopy(LastName,0,Name,0,5);
System.out.println("Employee Name : "+ new String(WholeName));
System.out.println(new String(Name));
System.out.println("Rate/Hr:"+rph);
E_CODE=scan.nextInt();
System.out.println("Grosspay: "+ gp);
}
if(E_CODE==104)
{
char[]LastName={'L','o','p','e','z'};
char[]FirstName={'J','a','e','n','a'};
char[]WholeName=new char[5];
char[]Name=new char[5];
rph=300.00;
System.arraycopy(FirstName,0,WholeName,0,5);
System.arraycopy(LastName,0,Name,0,5);
System.out.println("Employee Name : "+ new String(WholeName));
System.out.println(new String(Name));
System.out.println("Rate/Hr:"+rph);
System.out.println("No. of hours worked: ");
scan=new Scanner(System.in);

E_CODE=scan.nextInt();
gp= rph * nhw;

System.out.println("Grosspay: "+ gp);

}
}
}
 
Back
Top Bottom