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)

guys cnu OL jn na programmer nid help sa c++ code for Numbers convert to word...sample output: Enter a number: 1346 then the output will be One thousand three hundred fourty six..helpppp mga sir...
 
Panu po gmwa ng filesystem proj. na ineedit ung file nid help po .. kc di po xa nageedit eh nagdagdag lang ung info nya .. eto po ung code ko ..

public static void edit() throws IOException{

long pos = 0L;

File f = new File("d:/bin/jod.txt");

RandomAccessFile input = new RandomAccessFile(f,"rw");

Scanner c = new Scanner(System.in);

boolean moreRecords = true;
String Firstname;
String Lastname;
String Midname;
int Age;
String Gender;
String Date;
String Address;
String City;
Long TelNo;
String Status;
String Citizenship;
String Occupation;
String Religion;
String OwnorRentHouse;
Long HouseNumber;

input.seek(0L);
pos = input.getFilePointer();
input.seek(pos);

System.out.println(" Enter the House Number Do you want to Edit ");
int g = c.nextInt();

do{

try{


Firstname = input.readUTF();
Lastname = input.readUTF();
Middlename = input.readUTF();
Age = input.readInt();
Gender = input.readUTF();
Date = input.readUTF();
Address = input.readUTF();
City = input.readUTF();
TelNo = input.readLong();
Status = input.readUTF();
Citizenship = input.readUTF();
Occupation = input.readUTF();
Religion = input.readUTF();
OwnorRentHouse = input.readUTF();
HouseNumber = input.readLong();

pos = input.getFilePointer();
input.seek(pos);
input.seek(input.getFilePointer());




if ( g == HouseNumber){

RandomAccessFile arm = new RandomAccessFile(f,"rw");

System.out.print("First Name: ");
Firstname = xyz.readLine();
System.out.print("Last Name: ");
Lastname = xyz.readLine();
System.out.print("Middle Name: ");
Middlename = xyz.readLine();
System.out.print("Age: ");
Age = Integer.parseInt(xyz.readLine());
System.out.print("Gender: ");
Gender = xyz.readLine();
System.out.print("Date: ");
Date = xyz.readLine();
System.out.print("Address: ");
Address = xyz.readLine();
System.out.print("City: ");
City = xyz.readLine();
System.out.print("Tel No.: ");
TelNo = Long.parseLong(xyz.readLine());
System.out.print("Status: ");
Status = xyz.readLine();
System.out.print("Citizenship: ");
Citizenship = xyz.readLine();
System.out.print("Occupation: ");
Occupation = xyz.readLine();
System.out.print("Religion: ");
Religion = xyz.readLine();
System.out.print("Own or Rent House:");
OwnorRentHouse = xyz.readLine();
System.out.print("House Number: ");
HouseNumber = Long.parseLong(xyz.readLine());

arm.seek(input.getFilePointer());
arm.writeUTF(Firstname);
arm.writeUTF(Lastname);
arm.writeUTF(Middlename);
arm.writeInt(Age);
arm.writeUTF(Gender);
arm.writeUTF(Date);
arm.writeUTF(Address);
arm.writeUTF(City);
arm.writeLong(TelNo);
arm.writeUTF(Status);
arm.writeUTF(Citizenship);
arm.writeUTF(Occupation);
arm.writeUTF(Religion);
arm.writeUTF(OwnorRentHouse);
arm.writeLong(HouseNumber);



}
}catch(IOException e){
moreRecords = false;

System.err.println(e.toString());
System.exit(1);
}

System.out.println(" File Edited Finished ~__~ ");
ed();
}while(input.getFilePointer()<input.length());
}
 
pakipost yung textfile na ineedit mo. para malaman natin format. here is a snippet sa filereader na ginagamit ko
Code:
StringBuilder contents = new StringBuilder();

    try {
      //use buffering, reading one line at a time
      //FileReader always assumes default encoding is OK!
      BufferedReader input =  new BufferedReader(new FileReader(path));
      try {
        String line = null; //not declared within while loop
        /*
        * readLine is a bit quirky :
        * it returns the content of a line MINUS the newline.
        * it returns null only for the END of the stream.
        * it returns an empty String if two newlines appear in a row.
        */
        while (( line = input.readLine()) != null){
          contents.append(line);
          contents.append(System.getProperty("line.separator"));
        }
      }
      finally {
        input.close();
      }
    }
    catch (IOException ex){
      ex.printStackTrace();
    }

every loop sa while, isang line ang naaappend sa contents. yung contents ang string kung saan mastore ang naread na line
 
guyz pa help po
simple lang ang problem

pwede po ba sample program ng java na nakakapagsave lang sa msdbase
kahit isang word lang ma save sa msdbase at naka GUI po sia or kahit hindi na naka gui basta makuha ko lang codes


ty po
 
sir sna po matulungan nyo ako sa assign ko til monday..java program po xa.pinagawa po kasi kmi ng instructor namin ng java program na bus reservation using option pane..
Output
kelangan ng computation per destination

example:
urdaneta to launion
urdaneta= input fare to la union=input fare

hope matulungan nyo po ako.thanks and god bless
 
Patulong po ako nalilito kc ako..
Kilan po pwedeng gamitin ang while,do while,for ,if. Sa pag solve ng problem.

ang while mag test muna ng condition mo before doing the procedure you entered
and do while gagawin muna ang procedure before testing the condition
ang if diff lang sa while eh nag loloop ang while sa if 1 pass lang.
 
may GTK/C programmer ba dito?
may tanong lang sana ako about Gthread.
 
Last edited:
malaki ba difference ng C sa C++?
 
guys cnu OL jn na programmer nid help sa c++ code for Numbers convert to word...sample output: Enter a number: 1346 then the output will be One thousand three hundred fourty six..helpppp mga sir...
ala mo ba gumamit ng arrays at modulo kuya>>?
malaki ba difference ng C sa C++?

wala naman maxado..
 
pwede po makahingi ng tulong sa java?
panu po ba maggenerate ng numbers from 2-5, ng walang repetition?
sabi kasi ilagay daw sa array.
so ung magiging output nya eh 2, 3, 4, at 5 lang.
salamat po sa mga makakatulong sakin!
:pray::pray:
 
pwede po makahingi ng tulong sa java?
panu po ba maggenerate ng numbers from 2-5, ng walang repetition?
sabi kasi ilagay daw sa array.
so ung magiging output nya eh 2, 3, 4, at 5 lang.
salamat po sa mga makakatulong sakin!
:pray::pray:

int array [ ] = new int [ 5 ] ;

for ( int i = 0 ; i < array.lenth ; i ++ ) {


array [ i ] = i ;

System.out.print ( array [ i ] + " , " ) ;

}

or

for ( int i = 0 ; i < 5 ; i ++ ) {



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

}
 
Last edited:
@author..gumagwa po kc aq ng code.. about resistor. (from value to color of resistor)....

bale ang output po dapat gn2...

VALUE TO COLOR//title

//d2 po lalagay ung
RESISTOR VALUE:
TOLERANCE OF RESISTOR:

//e2 na ung sagot
1st COLOR:
2nd COLOR
3rd COLOR:
4th COLOR(bale e2 ung tolerance):


pde po b pki post po ung code n2 sa borland c++...sumskit n ulo ko d2..hahhaah...need help ASAP!!SALAMAT!!!:help::help::help::weep::weep::weep:
 
Last edited:
@author..gumagwa po kc aq ng code.. about resistor. (from value to color of resistor)....

bale ang output po dapat gn2...

VALUE TO COLOR//title

//d2 po lalagay ung
RESISTOR VALUE:
TOLERANCE OF RESISTOR:

//e2 na ung sagot
1st COLOR:
2nd COLOR
3rd COLOR:
4th COLOR(bale e2 ung tolerance):


pde po b pki post po ung code n2 sa borland c++...sumskit n ulo ko d2..hahhaah...need help ASAP!!SALAMAT!!!:help::help::help::weep::weep::weep:

hehehe kaya mo yan Ohms
kapagod yan :lol:
 
Last edited:
@author..gumagwa po kc aq ng code.. about resistor. (from value to color of resistor)....

bale ang output po dapat gn2...

VALUE TO COLOR//title

//d2 po lalagay ung
RESISTOR VALUE:
TOLERANCE OF RESISTOR:

//e2 na ung sagot
1st COLOR:
2nd COLOR
3rd COLOR:
4th COLOR(bale e2 ung tolerance):


pde po b pki post po ung code n2 sa borland c++...sumskit n ulo ko d2..hahhaah...need help ASAP!!SALAMAT!!!:help::help::help::weep::weep::weep:

post mo yung mga color and yung value nila.
 
tsk. sorry. hindi ko kayo matulungan. C kasi ako.
 
post mo yung mga color and yung value nila.


Black-0
brown-1
red -2
orange -3
yellow-4
green -5
blue -6
violet-7
gray-8
white-9

(1st and 2nd color are based on the number given above)
(3rd color is based on the number of zero that will added to 1st and 2nd color. e.g. blue- it has six zero to be added or x1000000 of the combination of the 1st and 2nd band)


gan2 po un...e.g.

Value of resistor:2300
tolerance[5/10/20]: 10

1st color:red
2nd color:orange
3rd color:red
4th color silver



Mga ka SB.....need po tlga...pls...:pray::pray::pray:
 
Back
Top Bottom