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!
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.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 } } );
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
JComboBox monthComboBox = new JComboBox();
monthComboBox.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) {
...
}
});
#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.
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"); }
char ans[] = "abcabccbaa";
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.
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.");
}
}
#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();
}
#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();
}
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."); } }