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)

:help:
bossing anu puh magandang turbo c program para sa proposal. toz idedefence puh namen. hehe... sana puh mabigyan niyo ng magandang idea. salamat po...:)
 
KASI,.,.FINAL EXAM NG KAPATID KO SA PROGRAMMING,,,SA TURBO C++!EH LIMOT KO NA TO VISUAL BASIC LNG PATI ANG ALM KO,.,.PWEDE NIO PO BA AKO GAWAN NG PROGRAM,,.ITO PO UNG PROBLEM, di po ako marunong magprogram pati kapatid ko need help!

TAKE HOME EXAM KASI ,.,.SALAMAT SA MAKAKTULONG,.,. SAKIN,.

1.DESIGN A PROGRAM THAT ASKS FOR AGE AND PRINTS HOW MANY MONTHS, WEEKS, DAYS, AND MINUTES OLD YOU ARE.

2.WRITE A PROGRAM THAT WOULD ACCEPT A NUMBER AND THEN DISPLAY ALL ITS PERFECT DIVISORS. THE PROGRAM WOULD VALIDATE THE NUMBER(MUST BE POSITIVE) AND IF INVALID, IT UST DISPLAY A MESSAGE "INVALID NUMBER" AND THEN ASK THE USER FOR ANOTHER NUMBER. EX. ENTER NO.20. DIVISORS 1,2,3,4,5,10 AND 20.

HIHIT KO NLNG PO SA MAKAKATULONG JAN,.,.,[/B]
 
sir pahelp nmn po,,,ahm gagawa po kmi ng program na mag add ng 2 numbers,,
gagawa po kmi ng include file name as sum2.h and sum.h

e2 po ung sum2.h

class Sum
{
public:
Sum();
Sum(int xx,int yy);
int getX();
int getY();
void add(int xx, int yy);
int getSum() const;
private:
int x;
int y;
int sum;
};


e2 nmn po ung sum.h

#include "Sum2.h"
Sum::Sum()
{x=0;
y=0;
}

Sum::Sum(int xx, int yy)
{x=xx;
y=yy;
}

int Sum::getX()
{return(x);
}

int Sum::getY()
{return(y);
}

void Sum::add(int xx, int yy)
{sum=xx+yy;
}

int Sum::getSum() const
{return (sum);
}


e2 nmn po ung main program:

#include "sum.h"
#include <stdio.h>
#include <conio.h>

void main()
{int a,b;
printf("Enter two numbers:");
scanf("%d %d",&a,&b);
Sum mySum(a,b);
mySum.add(mySum.getX(),mySum.getY());
printf("%d",mySum.getSum());
getch();
}


hndi ko po xa maparun,,declaration syntax error po,,anu po b mali ko? sna po matulungan nyu ako,,tnx po in advance!!:help:

ahm gagawa po kmi ng program na mag add ng 2 numbers,,
gagawa po kmi ng include file name as sum2.h and sum.h

e2 po ung sum2.h

class Sum
{
public:
Sum();
Sum(int xx,int yy);
int getX();
int getY();
void add(int xx, int yy);
int getSum() const;
private:
int x;
int y;
int sum;
};


e2 nmn po ung sum.h

#include "Sum2.h"
Sum::Sum()
{x=0;
y=0;
}

Sum::Sum(int xx, int yy)
{x=xx;
y=yy;
}

int Sum::getX()
{return(x);
}

int Sum::getY()
{return(y);
}

void Sum::add(int xx, int yy)
{sum=xx+yy;
}

int Sum::getSum() const
{return (sum);
}


e2 nmn po ung main program:

#include "sum.h"
#include <stdio.h>
#include <conio.h>

void main()
{int a,b;
printf("Enter two numbers:");
scanf("%d %d",&a,&b);
Sum mySum(a,b);
mySum.add(mySum.getX(),mySum.getY());
printf("%d",mySum.getSum());
getch();
}


hndi ko po xa maparun,,declaration syntax error po,,anu po b mali ko? sna po matulungan nyu ako,,tnx po in advance!!:help:
 
Pa tulong po sa java ko.

Urgg, i need help with my combobox.

I've made 3 combobox.
1 for months , 1 for days, and 1 for years;

This is I what I plan,

if they choose january, the days will have 31, if february the days will be 28 only.

but I don't know how to change the items inside the combobox during runtime.

Code:
btnenter.addActionListener( // I just tried to use it in JButton
         new ActionListener(){
            public void actionPerformed(ActionEvent e){
               
               day.removeAllItems();
               day.addItem(days31); //days31 is a String that has 31 items. But when I use this there's an error in the output
            }
         }   
      );
 
sir panu gawin to thru C at C++
array lang sir thanks .exe yan sir scan nyo nalang baka sabihin nyo virus yan yan kase bigay ng prof namen gagawan daw namen ng c++/c thnks
 

Attachments

  • 3-4.rar
    32.1 KB · Views: 7
Sir can you help me po?
tulung naman po sir..pide po ba na mag bigay po kayo nang inventory system base in VB..thanks sir..
 
pa help naman po..

panu po gumawa nang mobile application sa java po.. and yung coconnect sa database..

and mga details po..

kelangan lang po namin sa project po namin,,,

kahit mga links po or mga masasabi nyu...

:pray: :pray: :pray: :pray: :pray: :pray: :pray:
 
Pa tulong po sa java ko.

Urgg, i need help with my combobox.

I've made 3 combobox.
1 for months , 1 for days, and 1 for years;

This is I what I plan,

if they choose january, the days will have 31, if february the days will be 28 only.

but I don't know how to change the items inside the combobox during runtime.

Code:
btnenter.addActionListener( // I just tried to use it in JButton
         new ActionListener(){
            public void actionPerformed(ActionEvent e){
               
               day.removeAllItems();
               day.addItem(days31); //days31 is a String that has 31 items. But when I use this there's an error in the output
            }
         }   
      );
Use java.awt.event.ItemListener instead of java.awt.event.ActionListener.

Snippet
Code:
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;

JComboBox monthComboBox = new JComboBox();
monthComboBox.addItemListener(new ItemListener() {
	public void itemStateChanged(ItemEvent e) {
		...
	}
});
 
patulong naman po sa java.

kelangan ko po kasi gumawa ng program na mai-output kung ilan yung digits ng i.d number.

example:
Enter I.D number: 201010065
(sa isang variable lang dapat sya nakalagay)

ang output nya dapat "9".

tapos kelangan din sabihin ng program kung ilan ang odd tsaka even numbers dun.

Di ko po talaga alam kung pano gagawin dito. Sana po may makatulong. :pray:
 
@yash

ganun parin po.

day.addItem(day30); ganito kasi ginagawa ko.
day30 is string that compose by 1~30.

Di ko kasi alam proper syntax para jan.
ung actionListener pantest ko if iclick ko ung btnok magpapalit ung entry ng combobox

pede po pa add fb magtatanung lang ^_^
[email protected]
 
Mga Boss me prob ako about my program di ko alam qng panu ilipat sa conditional statement & panu lagyan ng average at qng ilan ang tumpak na sagot nid lang poh kc proj. namin eh.

Code:
#include <iostream.h>
int main(void)
{
    int ans;
    char a, b, c;
    cout <<"\t\tLaguna State Polythecnic University" <<endl;
    cout <<"\tProject by Group 6" <<endl;
    
    switch (ans==a)
    cout <<"1. Commonly used OS?" <<endl;
    case 'a' cout <<"a. Windows OS" <<endl;
    break;
    case 'b' cout <<"b. Linux OS" <<endl;
    break;
    case 'c' cout <<"c. Mac Operating System" <<endl;
    break;
    default
      
    cout <<"2. Most ppular Games of all time?" <<endl;
    cout <<a <<"a. Dota" <<endl;
    cout <<b <<"b. Grand theft auto" <<endl;
    cout <<c <<"Free cell" <<endl;
    cin>> ans;
    else (ans!=a)
    
    if (ans==a)
    cout <<"3. Meanning of HTML?" <<endl;
    cout <<a <<"a. Hotdog Tapsilog Mami Longanisa" <<endl;
    cout <<b <<"b. Hyper Text Markup Language" <<endl;
    cout <<c <<"c. all of the above" <<endl;
    cin>> ans;
    
    cout <<"4. Most widely used Internet Browser?" <<endl;
    cout <<a <<"a. Google Chrome" <<endl;
    cout <<b <<"b. Internet Explorer" <<endl;
    cout <<c <<"c. Mozilla Firefox" <<endl;
    cin>> ans;
    
    cout <<"5. Is Mam Lormatet a great instructor?" <<endl;
    cout <<a <<"a. Yes:" <<endl;
    cout <<b <<"b. No" <<endl;
    cout <<b <<"c. None of the above" <<endl;
    cin>> ans;
    
    cout <<"6. The most popular networking site?" <<endl;
    cout <<a <<"a. Friendster" <<endl;
    cout <<b <<"b. Twitter" <<endl;
    cout <<c <<"c. Facebook" <<endl;
    cin>> ans;
    
    cout <<"7. Largest cellular phone Producer?" <<endl;
    cout <<a <<"a. Samsung" <<endl;
    cout <<b <<"b. NOKIA" <<endl;
    cout <<c <<"c. Alcatel" <<endl;
    cin>> ans;
    
    cout <<"8. What application would you use to create a presentation or slide show?" <<endl;
    cout <<a <<"a. MS Word" <<endl;
    cout <<b <<"b. MS Excel" <<endl;
    cout <<c <<"c. MS PowerPoint" <<endl;
    cin>> ans;
    
    cout <<"9. A C++ statement which repeats the the program?
    cout <<a <<"a. Functions" <<endl;
    cout <<b <<"b. Loop Statement" <<endl;
    cout <<c <<"c. Conditional Statement" <<endl;
    cin>> ans;
    
    cout <<"10. Operator used on C++ to input a charater
    cout <<a <<"a. cin" <<endl;
    cout <<b <<"b. cout" <<endl;
    cout <<c <<"c. switch" <<endl;
    
    system("pause");
}
 
patulong naman po sa java.

kelangan ko po kasi gumawa ng program na mai-output kung ilan yung digits ng i.d number.

example:
Enter I.D number: 201010065
(sa isang variable lang dapat sya nakalagay)

ang output nya dapat "9".

tapos kelangan din sabihin ng program kung ilan ang odd tsaka even numbers dun.

Di ko po talaga alam kung pano gagawin dito. Sana po may makatulong. :pray:

kung integer yung variable na ginamit mo para paglagyan ng input, int length = Integer.toString(IDnumber).length();

kung string naman, int length = IDnumber.length();

sana makatulong :thumbsup: :salute:
 
Mga Boss me prob ako about my program di ko alam qng panu ilipat sa conditional statement & panu lagyan ng average at qng ilan ang tumpak na sagot nid lang poh kc proj. namin eh.

Code:
#include <iostream.h>
int main(void)
{
    int ans;
    char a, b, c;
    cout <<"\t\tLaguna State Polythecnic University" <<endl;
    cout <<"\tProject by Group 6" <<endl;
    
    switch (ans==a)
    cout <<"1. Commonly used OS?" <<endl;
    case 'a' cout <<"a. Windows OS" <<endl;
    break;
    case 'b' cout <<"b. Linux OS" <<endl;
    break;
    case 'c' cout <<"c. Mac Operating System" <<endl;
    break;
    default
      
    cout <<"2. Most ppular Games of all time?" <<endl;
    cout <<a <<"a. Dota" <<endl;
    cout <<b <<"b. Grand theft auto" <<endl;
    cout <<c <<"Free cell" <<endl;
    cin>> ans;
    else (ans!=a)
    
    if (ans==a)
    cout <<"3. Meanning of HTML?" <<endl;
    cout <<a <<"a. Hotdog Tapsilog Mami Longanisa" <<endl;
    cout <<b <<"b. Hyper Text Markup Language" <<endl;
    cout <<c <<"c. all of the above" <<endl;
    cin>> ans;
    
    cout <<"4. Most widely used Internet Browser?" <<endl;
    cout <<a <<"a. Google Chrome" <<endl;
    cout <<b <<"b. Internet Explorer" <<endl;
    cout <<c <<"c. Mozilla Firefox" <<endl;
    cin>> ans;
    
    cout <<"5. Is Mam Lormatet a great instructor?" <<endl;
    cout <<a <<"a. Yes:" <<endl;
    cout <<b <<"b. No" <<endl;
    cout <<b <<"c. None of the above" <<endl;
    cin>> ans;
    
    cout <<"6. The most popular networking site?" <<endl;
    cout <<a <<"a. Friendster" <<endl;
    cout <<b <<"b. Twitter" <<endl;
    cout <<c <<"c. Facebook" <<endl;
    cin>> ans;
    
    cout <<"7. Largest cellular phone Producer?" <<endl;
    cout <<a <<"a. Samsung" <<endl;
    cout <<b <<"b. NOKIA" <<endl;
    cout <<c <<"c. Alcatel" <<endl;
    cin>> ans;
    
    cout <<"8. What application would you use to create a presentation or slide show?" <<endl;
    cout <<a <<"a. MS Word" <<endl;
    cout <<b <<"b. MS Excel" <<endl;
    cout <<c <<"c. MS PowerPoint" <<endl;
    cin>> ans;
    
    cout <<"9. A C++ statement which repeats the the program?
    cout <<a <<"a. Functions" <<endl;
    cout <<b <<"b. Loop Statement" <<endl;
    cout <<c <<"c. Conditional Statement" <<endl;
    cin>> ans;
    
    cout <<"10. Operator used on C++ to input a charater
    cout <<a <<"a. cin" <<endl;
    cout <<b <<"b. cout" <<endl;
    cout <<c <<"c. switch" <<endl;
    
    system("pause");
}

gawa ka ng character array of correct answers kunwari..
Code:
char ans[] = "abcabccbaa";

tapos check mo yung answer na ininput ng user sa array mo..

simula ans[0] hanggang ans[9].. yung [0] yung first question, marunong ka naman siguro mag compare ng characters di ba? hehe..

pag correct (pareho yung answer dun sa character array mo) lagay ka ng correct answer na counter.. tapos pagkatapos ng program, eh di yung value ng counter mo eh divide mo sa total number of questions para sa average.. :D
 
patulong naman po sa java.

kelangan ko po kasi gumawa ng program na mai-output kung ilan yung digits ng i.d number.

example:
Enter I.D number: 201010065
(sa isang variable lang dapat sya nakalagay)

ang output nya dapat "9".

tapos kelangan din sabihin ng program kung ilan ang odd tsaka even numbers dun.

Di ko po talaga alam kung pano gagawin dito. Sana po may makatulong. :pray:


bro eto po yung sagot ko jan

Code:
import java.io.*;

public class symb {

    public static void main(String[] args) throws IOException {
    	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    	System.out.print("Enter I.D. Number: ");
    	String id = br.readLine();

   		System.out.println("ID Number Length: " + id.length());

   		Character x;
   		int value;
   		int odd = 0;
   		int even = 0;

   		for(int i=0; i<id.length(); i++){
   			x = id.charAt(i);
   			String temp = x.toString();
			value = Integer.parseInt(temp);
			
   			if(value%2 == 0){
   				even += 1;
   			}
   			else
   				odd += 1;
   		}

   		System.out.println("There are " + even + " even numbers.");
   		System.out.println("There are " + odd + " odd numbers.");
    }
}
 
Mga sir, paano gawing online yung java program. Kunyare simple addition. Yung user mabubuksan yung ginawa kong program sa internet. Tapos magiinput sya di ba. Yung input nya marereceive ko din sa pc ko. Tapos parehung mag a-output sa user at saki. Panu kaya yuing codes nun sa html at sa java.

Sa java program di ba gagawing JApplet tapos sa html code para malink yung java.class eh <a href .....></a>. Yan hanggang jan lang alam ko. Hehe. Sana matulungan nyu ko at maturuan. For future use lang. TIA!!

Edit: pahelp na din pala sa pag oonline nung html code (yung web hosting site
 
Last edited:
Mga bossing ano mali ko dito kase ayaw mag space yung asterisk * * * * * ganto laging ganto ****** output na nilalabas. and yung color na nilagay ko ayaw neang mag rotate..

Code:
#include<stdio.h>
#include<conio.h>
void main()
{
int x;
int a=1,b=2,c=3,d=4,e=5,f=6,g=7,h=8;
int move;

clrscr();
for( x=1;x<=10;x++){
textcolor(a);

gotoxy(30+x,12);cprintf("*");
textcolor(b);
gotoxy(40+x,12);cprintf("*");
textcolor(c);
gotoxy(40+x,12+x);cprintf("* ");
textcolor(d);
gotoxy(40-x,12-x);cprintf("*");
textcolor(e);
gotoxy(40-x,12+x);cprintf("*");
textcolor(f);
gotoxy(39+x,12-x);cprintf(" *");
textcolor(g);
gotoxy(40,x+1);cprintf("*");
textcolor(h);
gotoxy(40,12+x);cprintf("*");
textcolor(a);

}
move=h;
h=a;
a=b;
b=c;
c=d;
d=e;
e=f;
f=g;

getch(); 
}

refer nalang po d2 para dun sa example. http://symbianize.com/showthread.php?p=7932951#post7932951

salamat poh
 
Mga bossing ano mali ko dito kase ayaw mag space yung asterisk * * * * * ganto laging ganto ****** output na nilalabas. and yung color na nilagay ko ayaw neang mag rotate..

Code:
#include<stdio.h>
#include<conio.h>
void main()
{
int x;
int a=1,b=2,c=3,d=4,e=5,f=6,g=7,h=8;
int move;

clrscr();
for( x=1;x<=10;x++){
textcolor(a);

gotoxy(30+x,12);cprintf("*");
textcolor(b);
gotoxy(40+x,12);cprintf("*");
textcolor(c);
gotoxy(40+x,12+x);cprintf("* ");
textcolor(d);
gotoxy(40-x,12-x);cprintf("*");
textcolor(e);
gotoxy(40-x,12+x);cprintf("*");
textcolor(f);
gotoxy(39+x,12-x);cprintf(" *");
textcolor(g);
gotoxy(40,x+1);cprintf("*");
textcolor(h);
gotoxy(40,12+x);cprintf("*");
textcolor(a);

}
move=h;
h=a;
a=b;
b=c;
c=d;
d=e;
e=f;
f=g;

getch(); 
}

refer nalang po d2 para dun sa example. http://symbianize.com/showthread.php?p=7932951#post7932951

salamat poh
 
pwede ko po ba magawa to ng hindi nagamit ng length() method? pinagbawalan kasi kami ng prof namin eh.


bro eto po yung sagot ko jan

Code:
import java.io.*;

public class symb {

    public static void main(String[] args) throws IOException {
    	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    	System.out.print("Enter I.D. Number: ");
    	String id = br.readLine();

   		System.out.println("ID Number Length: " + id.length());

   		Character x;
   		int value;
   		int odd = 0;
   		int even = 0;

   		for(int i=0; i<id.length(); i++){
   			x = id.charAt(i);
   			String temp = x.toString();
			value = Integer.parseInt(temp);
			
   			if(value%2 == 0){
   				even += 1;
   			}
   			else
   				odd += 1;
   		}

   		System.out.println("There are " + even + " even numbers.");
   		System.out.println("There are " + odd + " odd numbers.");
    }
}
 
jo, try mo gumawa ng pointer dyan sa input mo.. siya mismo magbibilang kung ilan hanggang makakita sya ng null character.. :D
 
pano po ba gawin ang output na to?

SUN MON TUE WED THU FRI SAT
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30
ANO PO BANG MGA KEYWORD ANG KAILANGAN?
 
Back
Top Bottom