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)

HELLO ! CAN YOU HELP ME SIR/MAM ! . ME KONGTING MALI SA PROGRAM KO. KAPAG NAG VIVIEW RECORD AKO AYAW GUMANA E. PLEASE CHECK AND ANSWER IT SALAMAT ! HERES THE PROGRAM. ANYWAY IT IS A COMBINATION OF FILE & CLASS !

Di talaga yan mag sa save gumawa ka kasi ng bagong employee imbes na gamitin mo ung pinasang employee sa addEmployee.

Code:
void addEmployee(employee [COLOR="Blue"]*s[/COLOR])
{
double _sss,_pagibig,_tax;
int _late,_ot,_absent,_work,_rate;


employee [COLOR="Red"]myemployee;[/COLOR]

Ung naka kulay blue yan dapat gamitin mo hindi ung naka kulay red. Sa naka red ka kasi naglalagay ng data kaya wala epek.
 
Di talaga yan mag sa save gumawa ka kasi ng bagong employee imbes na gamitin mo ung pinasang employee sa addEmployee.

Code:
void addEmployee(employee [COLOR="Blue"]*s[/COLOR])
{
double _sss,_pagibig,_tax;
int _late,_ot,_absent,_work,_rate;


employee [COLOR="Red"]myemployee;[/COLOR]

Ung naka kulay blue yan dapat gamitin mo hindi ung naka kulay red. Sa naka red ka kasi naglalagay ng data kaya wala epek.

what po ? di ko nagets ? sorry slow :|
 
thanks sir ! i got it ! one more question. how can i display the salary. nagfafailed ksi sa display. kung anu2ng numbers lumalabas e
 
Last edited:
Di me nag aral IT, but i have a desire to learn programming, if kng ok lng TS post ka nmn tutorials d2 bout basic building softwares, and how to read basic qoutes.... If u have spare time.. Thanks and more power to ur thread.. ^^ :thumbsup:
 
thanks sir ! i got it ! one more question. how can i display the salary. nagfafailed ksi sa display. kung anu2ng numbers lumalabas e

You're not actually creating a new employee object when you call the addEmployee() function.

Code:
[B]void addEmployee(employee *s)[/B]

sa function na yan, nagpasa ka ng pointer to employee variable pero hindi mo ginamit. Also, pag mag-add ka ng data, gagawa ka ng copy ng variable, hindi yung pointer sa isang employee object lang. Otherwise, you will always be referring to that same variable.

Code:
[B]employee myemployee;[/B]

pagkatapos nag declare ka sa loob ng function ng employee variable pero once na nag exit na yung function, wala na rin yung variable dahil local lang sa addEmployee() function ang scope nya.

So bali wala talagang record ng employee ang nagagawa kaya wala ka rin record na nakikita kapag ginamit mo yung display.

Ang kelangan mong gawin is to copy the local myemployee object sa employee pointer parameter.

or

ipasa mo yung employee variable as a reference parameter sa function para hindi ka na mag-instantiate ng employee class sa loob ng addEmployee() function then i-manipulate mo na lang yung pinasa mong reference object. gets?

isa pa, kailangan mo din ng data structure para i store yung employee objects mo. kse halimbawa, gumawa ka ng 5 employees, paano mo sila iki-keep track sa memory? hindi naman pwede i-save mo na lang palagi sa file evertime na meron kang ginawang employee object diba? so, gawa ka ng data structure, gaya ng list, vector, queue or kung ano man ang suitable sa project mo na to.
 
Last edited:
idol pd ba gumamit ng oracle sa online or offline system?..,gagawa xe aq online exam n site??
 
You're not actually creating an employee object when you call addEmployee.

Code:
[B]void addEmployee(employee *s)[/B]

sa function na yan, nagpasa ka ng pointer sa employee pero hindi mo ginamit.

Code:
[B]employee myemployee;[/B]

pagkatapos nag declare ka sa loob ng function ng employee object pero once na nag exit na yung function, wala na rin yung employee object dahil local lang ang scope nya.

So bali wala talagang record ng employee ang nagagawa kaya wala ka rin record na nakikita kapag ginamit mo yung display.

Ang kelangan mong gawin is to copy the local myemployee object sa employee pointer parameter.

or

ipasa mo yung employee parameter sa function as a reference para hindi ka na gumawa pa ng instance ng employee class sa loob ng addEmployee function at i-manipulate mo na lang yung pinasa mong reference object. gets?

isa pa, kailangan mo din ng data structure para i store yung employee objects mo. kse halimbawa, gumawa ka ng 5 employees, paano mo sila iki-keep track sa memory? hindi naman pwede i save mo na lang palagi sa file evertime na meron kang ginawang employee object diba? so, gawa ka ng data structure, gaya ng list, vector, queue or kung ano man ang suitable sa project mo na to.

di pa ako masyadong marunong sa OBJECTS pero expert ako sa STRUCTURES :rofl:

di ako sure kong gagana to, pero ma ipapayo ko lang sau ay --->
Pwede mo rin e return ung employee objects mo, so kailangan mong lagyan ng returnType ung function mo tsaka catcher sa calling function mo.
 
Last edited:
HELLO ! CAN YOU HELP ME SIR/MAM ! . ME KONGTING MALI SA PROGRAM KO. KAPAG NAG VIVIEW RECORD AKO AYAW GUMANA E. PLEASE CHECK AND ANSWER IT SALAMAT ! HERES THE PROGRAM. ANYWAY IT IS A COMBINATION OF FILE & CLASS !

Try this:

Code:
void addEmployee(employee &s);
void dispRec(employee &s);

in main()
Code:
employee emps;

Code:
case 1:
addEmployee(emps);

Code:
void addEmployee(employee &s)
{
        double _sss,_pagibig,_tax;
        int _late,_ot,_absent,_work,_rate;

        cout<<"\n\t\t\tWELCOME !!! \n\n";
        cout<<"***Please Enter the following information below***\n\n";
        cout<<"Name: ";
        cin.ignore(25, '\n');
        cin.getline(s.name,50);
        cout<<"ID: ";
        cin>>s.id;
        cout<<"\nStatus: ";
        cin>>s.status;
        cout<<"\nPosition: ";
        cin>>s.position;

        cout<<"\n\n***EMPLOYEE'S DAILY REPORT***\n\n";
        cout<<" Salary Rate: ";
        cin>>_rate;
        cout<<"\n No. of Days work: ";
        cin>>_work;
        cout<<"\n No. of Absenses: ";
        cin>>_absent;
        cout<<"\n No. of Minutes Late: ";
        cin>>_late;
        cout<<"\n No. of Minutes Overtime: ";
        cin>>_ot;

        s.setattendance(_rate,_work,_absent,_late ,_ot);

        cout<<"\n\n Deductions:\n\n";
        cout<<" SSS: ";
        cin>>_sss;
        cout<<"\n Pag-ibig: ";
        cin>>_pagibig;
        cout<<"\n Tax: ";
        cin>>_tax;

        s.setdeduction(_sss,_pagibig,_tax);

        double salaryy=s.salary();

        cout<<"\n\n TOTAL SALARY: PHP. "<<s.salary()<<".00";
}

Code:
void dispRec(employee &s)
{
        cout << "Employee RECORD: ";
        hl('-',30);
        cout << "ID: "<< s.id<< endl;
        cout << "Name: " << s.name<< endl;
        cout << "Status: " << s.status << endl;
        cout << "position: " << s.position << endl;
        cout<< "salary: " <<s.salaryy<<endl;
        hl('-',30);

}

It's not finished yet, you still need to make changes to the other functions. I just did those 2 so you can at least see what's going on in your employee class.
 
buhay pa po ba itong thread na ito? may question po sana ako bout Visual Basic 6.0 eh.. wala ako mahanap na answers sa google kya dito ko naispang magtnong.. uhm.. pano ko mku2ha ung mga information ng local drives ng networked PCs? halimbawa my C: and D: ako sa remotepc ko.. then, ku2nin ko ung information nun gmit ung server na pc? TIA po..

hoping for answers.
 
Di talaga yan mag sa save gumawa ka kasi ng bagong employee imbes na gamitin mo ung pinasang employee sa addEmployee.

Code:
void addEmployee(employee [COLOR="Blue"]*s[/COLOR])
{
double _sss,_pagibig,_tax;
int _late,_ot,_absent,_work,_rate;


employee [COLOR="Red"]myemployee;[/COLOR]

Ung naka kulay blue yan dapat gamitin mo hindi ung naka kulay red. Sa naka red ka kasi naglalagay ng data kaya wala epek.


hehe naalala ko ang first year ko
 
sir patulong nmn sa vb6 ...... kasi required ako gumawa ng laro ..... sa thesis nmen .... noob lng ako sa vb6 ... gusto ko mlman lahat ng pde gawin ...ang laro po ay "the games of the generals" un parang chess ...dito sa pinas nag originate un board game n un .... ggwen nmn software ... di ako marunong magmove ng pieces ...nbsa ko mga picture box daw?? kso di ko alam tlga .... please please sir need it badly for a thesis .pra lng nmn xa chess e ... ..:noidea: :pray: :pray: :weep:
 
takehomedrill.png


ayan po thanks!! with konting Tutorials!
 
1. write a program that will print the even positioned elements in an array of 20 integers

2.write a program using standard string functions that accept a price of an item and display its coded value. the base of the key is

T S U C O M P U T E
0 1 2 3 4 5 6 7 8 9

sample ouput: Enter price:239.65
code value:UCE.PM

THanks in advance ^_^ :help:

advance C po pala ito
 
Last edited:
1. Write an application that instantiates a JFrame that contains a JButton. Disable the JButton after the user clicks it. Save the file as JFrameDisableButton.java.

2. Modify the JFrameDisableButton program so that the JButton is not disabled until the user has clicked at least 8 times. At that point, display a JLabel that indicates "That's enough!". Save the file as JFrameDisableButton2.java.


pa heLP!!!!!!!!!!!!!!!!!!!!!^^^^^^^^^^
i know parang ang simple pero nahihirapan ako eh hahahaha. sana simple codes lang para ma-trace ko :)
 
1. Write an application that instantiates a JFrame that contains a JButton. Disable the JButton after the user clicks it. Save the file as JFrameDisableButton.java.

2. Modify the JFrameDisableButton program so that the JButton is not disabled until the user has clicked at least 8 times. At that point, display a JLabel that indicates "That's enough!". Save the file as JFrameDisableButton2.java.


pa heLP!!!!!!!!!!!!!!!!!!!!!^^^^^^^^^^
i know parang ang simple pero nahihirapan ako eh hahahaha. sana simple codes lang para ma-trace ko :)

upload mo yung code mo na may jbutton kuya.. tapos disable natin..
 
@danielbargs

First you need to register ActionListener to your JButton so that it can accept ActionEvent. For example if the name of your JButton is pressButton then the code would be something like this:
Code:
pressButton.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {

    }
});
If you did that then your JButton can now accept ActionEvent which is cause by user pressing your JButton.

The next step is to disable the button. To disable the button you need to call method setEnabled() of JButton.
Code:
pressButton.setEnabled(false);

However you need to add this code inside actionPerformed so that it will only execute when the user click the button.

For your second question just add an instance variable.
Code:
private int pressCount = 0;

When the user click the button just increment that variable by 1 and then compare it 8.
Code:
++pressCount;

if (pressCount == 8) {
    pressButton.setEnabled(false);
}
 
Last edited:
mga sir and mam..
may itatanong lang po ako
kasi po yung vb6 project namin pag nag save na yung data sa access napapatungan yung unang data na nakalagay sa first row...
paano po ba yun hnd maooverlap?
may ilalagay po bang code sa vb para hindi mag overlap sa access yung data?

thanks in advance mga sir and mam!
 
Back
Top Bottom