hapit na tunga ka sa adlaw cgeg tubag2x unya imong pseudocode nga gipanghambog wa jafon niabot ![cheesy](images/smilies/cheesy.gif)
ten minutes nko bro ay...
file: first.java
Code:
import java.util.Scanner;
public class first
{
public static void main(String[] args)
{
Scanner input = new Scanner(System.in);
int number;
String reverse;
System.out.print("Enter an integer : ");
number = input.nextInt();
reverse = new StringBuffer(Integer.toString(number)).reverse().toString();
System.out.println("Integer reversed : " + reverse);
}
}
file: second.java
Code:
import java.lang.Math;
import java.util.*;
public class second
{
public static void main(String[] args)
{
int index = 0;
int power = 0;
int firstnum = 0;
int secondnum = 0;
int evensum = 0;
double squaresum = 0;
char letter = 'A';
Scanner input = new Scanner(System.in);
while (!(firstnum < secondnum))
{
System.out.print("ENTER FIRST INTEGER : ");
firstnum = input.nextInt();
System.out.print("ENTER SECOND INTEGER : ");
secondnum = input.nextInt();
if (!(firstnum < secondnum))
{
System.out.println("THE FIRST INTEGER MUST BE LESS THAN THE SECOND INTEGER.\n");
}
}
index = firstnum;
System.out.print("ALL ODD NUMBERS : ");
while (index >= firstnum && index <= secondnum)
{
if (index % 2 != 0)
{
System.out.print(index);
if (index < secondnum - 1)
{
System.out.print(", ");
}
else
{
System.out.println();
}
}
else
{
evensum += index;
}
index++;
}
System.out.println("SUM OF ALL EVEN NUMBERS : " + evensum);
index = firstnum;
System.out.println("ALL NUMBERS WITH THEIR RESPECTIVE POWERS FROM 1 TO 10 :");
while (index >= firstnum && index <= secondnum)
{
System.out.print(index + " : ");
power = 1;
while (power >= 1 && power <= 10)
{
double number = java.lang.Math.pow(index, power);
System.out.printf("%10.0f", number);
if (power == 2 && index % 2 != 0)
{
squaresum += number;
}
if (power < 10)
{
System.out.print(", ");
}
power++;
}
System.out.println();
index++;
}
System.out.printf("SUM OF THE SQUARES OF ALL ODD NUMBERS : %.0f\n", squaresum);
System.out.print("ALL UPPERCASE LETTERS : ");
while (letter >= 'A' && letter <= 'Z')
{
System.out.print(letter);
if (letter < 'Z')
{
System.out.print(", ");
}
else
{
System.out.println();
}
letter++;
}
}
}
![](http://www.jamesbanogon.com/java.jpg)
another five minutes tingali kay naa na error-handling pakapin. ikaw bro, asa nman imong pseudocode? naa pa ka pa-explain2x sa flow sa program? ikaw man tingali si mickey mouse bro