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!
^ 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
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
w8 boss wla ako java eh.. gwn ko sa php
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.
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
import java.io.*;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.
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 ?
palitan mu lang un line DataInputStream ..... ng Buffered Reader in=new BufferedReader blah blahdapat po BufferedReader po gamit d po kc tinatanggap ng class ung DataInput
salamat po sir
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);
}
}
}