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)

View attachment 968998sir pahelp namn po ako sa assignment ko nde ko po kasi masundan ehh salamat po

Write a Java program that accepts as input a positive integer value N in the range 1 to 1000, then proceeds to determine and output the factors of N. The program also indicates whether N is a prime number or a composite number. Assume that the input is a valid value in the specified range.

Hindi pa ako marunong ng Java. Guide na lang. C language. Madali lang yan.

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

int main(){
int N, ctr, fac = 0;/*N yung number, ctr para sa loop at factors, fac naman para sa number ng factors excluding 1 at yung number itself*/
printf("Input an integer value N from 1 to 1000: ");
scanf("%d", &N);
printf("\nThe factors of %d are:\n1, ", N);
for(ctr = 2; ctr < N; ctr++){
if(N % ctr == 0){
printf("%d, ", ctr);
fac++;
}
}
printf("%d.\n", N);
if(fac == 0)
printf("\n%d is a prime number.", N);
else
printf("\n%d is a composite number.", N);
getch();
}
 

Attachments

  • 1.jpg
    1.jpg
    32.1 KB · Views: 3
  • 2.jpg
    2.jpg
    25.2 KB · Views: 2
guys baguhan palang ako sa java , pa add nga po ng ibang pde pang ilagay dito ,or padugtungan po, di kac ako marunong nung ibang code ,dpat po ay aabot ng 200 lines, hahaha thanks!



import java.io.*;
import javax.swing.JOptionPane;
public class ATM{
public static void main(String[]args)throws Exception{
BufferedReader buff = new BufferedReader(new InputStreamReader(System.in));




int password = 0;
int option = 0;
System.out.println("-------------------------------------------------------------------------------");
System.out.println("<<ONLINE FRUITS SELLER >>");
System.out.println("-------------------------------------------------------------------------------");
System.out.println("Please type 143 as password :)");




while(password!=143){
System.out.print("Enter password: ");
password = Integer.parseInt(buff.readLine());




if(password==143){
System.out.println("===============================================================================");
System.out.println("<< M E N U >>");
System.out.println("===============================================================================");
System.out.println("What kind of fruits you want to buy?");
System.out.println("1. Apple || 2. Banana");
System.out.println("3. Grapes || 4. Strawberry");
String option1 = JOptionPane.showInputDialog("Enter No. 1-4: ");
option = Integer.parseInt(option1);
if(option==1){
System.out.println("<<You choose apple.>>");
System.out.println("How many?");
}
}
}
}

}
 
sir pwede po ba makihinge ng installer ng visual basic 6.0 yung compatible sa lahat !!! Pleasseee...
 
Patulong naman mga kasymb nating programmer dyan. Paano ba gagamitin tong code na binigay saamin ng teacher namin? Bali yung data sa sql palalabasin sa excel gamit tong code na ito sa vb.
Code:
Public Function Export31(ByVal InitRow As Long, ByVal DBAccess As String) As Long




        'On Error Resume Next


        Dim MyIndex As Integer                            'Used for Index
        Dim MyRecordCount As Long                    'Store the number of record on the table
        Dim MyFieldCount As Integer                    'Store the number of fields or column
        Dim ApExcel As Object                      'To open Excel
        Dim MyCol As String
        Dim cmd1 As New MySqlCommand
        Dim Reader As MySqlDataReader
        Dim cmd11 As New MySqlCommand
        ApExcel = GetObject("c:\user\LISTOFSTUDENTS.xlsx")

        ApExcel.Application.Visible = True
        ApExcel.Windows(1).Visible = True

        cmd1.Connection = myadoconnection
        myadoconnection.Open()

        cmd1.CommandText = "SELECT distinct cus_id_no from customer"

        cmd1.CommandType = ADODB.CommandTypeEnum.adCmdText
        Reader = cmd1.ExecuteReader
        MyFieldCount = Reader.FieldCount

        For MyIndex = 0 To MyFieldCount - 1

        Next
        MyCol = Chr((64 + MyIndex)) & InitRow
        MyRecordCount = 1 + InitRow

        Do While Reader.Read
            For MyIndex = 1 To MyFieldCount

                ApExcel.Worksheets(1).Cells(MyRecordCount, MyIndex).Formula = Reader.Item((MyIndex - 1)).ToString()

            Next
            MyRecordCount = MyRecordCount + 1
            'rs.MoveNext()
            If MyRecordCount > 5 Then
                Exit Do
            End If
        Loop

        myadoconnection.Close()

        '******END
        Export31 = MyRecordCount

        '    End Function
        'call this function in button procedure
        Export31(5, "\midterm.mdb")
 
Last edited:
Help naman. Paano iinstall yung microsoft visual studio 6.0 (Enterprise Edition) sa windows 8 64bit? pag iniinstall ko kasi sya naghahang lang sa dulo. 1st year palang kasi ako. Di tuloy ako makapag practice :weep: Salamat sa sasagot! :thanks::thanks::thanks::thanks::thanks:
 
pa help mo ng GUI ng JACK and PoY java program.. finals lang poh namen tnx..
 
patulong po sa c++/ paano mag separate ng letter gamit ang array .
apple
word[0]-a
word[1]-p
word[2]-p
word[3]-l
word[4]-e
patulong po penge ng sample code
 
Boss, baka po meron kayong GUI ng Student Information. penge naman po. kung maari po eh pati code.salamat po. May isa pa po akong problema, hindi ko po kasi maiconnect yung project ko sa database. Ano po bang dapat kong gawin???Salamat po
 
patulong po sa c++/ paano mag separate ng letter gamit ang array .
apple
word[0]-a
word[1]-p
word[2]-p
word[3]-l
word[4]-e
patulong po penge ng sample code

paki try po nito.
code::blocks 13.12 with minGW compiler

Code:
#include <iostream>
#include <cstring>      //for strlen() function

using namespace std;

int main()
{  char *word;
    int i;

    cout << "Enter a string: ";
    cin >> word;
    cout << "\n";

    // Result

    for(i=0; i < strlen(word); i++)
        cout << "word[" << i << "] = " << word[i] << "\n";

    return 0;
}
 
patulong po sa c++/ paano mag separate ng letter gamit ang array .
apple
word[0]-a
word[1]-p
word[2]-p
word[3]-l
word[4]-e
patulong po penge ng sample code


yung first code, using data type string. tapos yung 2nd para sa numbers. kung icoconvert string per character to integer :)

1st code
Code:
#include <iostream>
#include <string>
using namespace std;

int main () {

	string word;
	cin >> word; //input: apple
	
	// kung apple ang ininput or string, as if nakalagay na yun sa array
	// word[0] = 'a'
	// word[1] = 'p'
	// word[2] = 'p'
	// word[3] = 'l'
	// word[4] = 'e'
	
	int i=0;
	while(i!=word.length()) {
	cout << word[i] << ' ';
	i++;
	}
	
return 0;
}

2nd code
Code:
#include <iostream>
#include <string>

using namespace std;

int main () {

	string wordtemp;
	cin >> wordtemp; //ilalagay muna sa string bago iconvert sa int
	
	int word[wordtemp.length()]; //pass the size of word sa array size
	
	for( int i=0; i < sizeof(word) / sizeof(word[0]); i++ ) { //converting per char to array
		word[i]=wordtemp[i]-'0';
	}
	
	// example ang ininput mong number: 18960
	// word[0] = 1;
	// word[1] = 8;
	// word[2] = 9;
	// word[3] = 6;
	// word[4] = 0;
	
	for( int i=0; i < sizeof(word) / sizeof(word[0]); i++ )
	cout << word[i] << ' ';
	cout << endl;
	
	//converted char numbers into int
	
return 0;
}
 
pano po to mga bossing?. d ko po ma.update eh.. ano pong problema nito?. pa.help naman po






String value1=((JTextField)a1.getDateEditor().getUiComponent()).getText();
String value2=b2.getText();
String value3=c3.getText();
String value4=d4.getText();
String value5=e5.getText();
String value6=f6.getText();
String value7=g7.getText();
String value8=h8.getText();
try{

PreparedStatement statement = conn.prepareStatement("update client.client1 set code = ?, name = ?, address = ?, amount = ?, phone = ?, fax = ?, email = ? where date = ?");

statement.setString(1, value1);
statement.setString(2, value2);
statement.setString(3, value3);
statement.setString(4, value4);
statement.setString(5, value5);
statement.setString(6, value6);
statement.setString(7, value7);
statement.setString(8, value8);

statement.executeUpdate();
statement.close();




JOptionPane.showMessageDialog(null, "Updated Successfully", "", JOptionPane.INFORMATION_MESSAGE);

}
catch(Exception e){
Logger.getLogger(edt_1.class.getName()).log(Level.SEVERE, null, e);
JOptionPane.showMessageDialog(null, e.getMessage(), "ERROR", JOptionPane.ERROR_MESSAGE);
 
patulong naman po sa problem ko...di kopo siya alam ito po ung meta character regular expression
Gawa ka program using java wherein may regex involve. Ang isosolve nung program mo imamatch nya lahat ng word that starts sa letter "a" from the inputted string.. ito po ung binigay niyang case study
 
patulong naman po sa problem ko...di kopo siya alam ito po ung meta character regular expression
Gawa ka program using java wherein may regex involve. Ang isosolve nung program mo imamatch nya lahat ng word that starts sa letter "a" from the inputted string.. ito po ung binigay niyang case study

The pattern of regular expression would be something like this.
pattern = "a[^\\s]*";

Note I used to backslash there instead of one to prevent Java from interpreting \s as a escape character for string.

explanation:

a -> find character a from a string then
[^\\s]* -> find zero or more character that is not a type of space.
 
Hello po. Patulong naman po ako. May project po kami na kelangan mag generate ng LINE GRAPH. Penge po sana ng code. Gamit ko po ay NetBeans. :salute:
 
Boss patulong naman sa C++ nalilito kasi ako eh. Pwede bigay kang example ng code na may parameters (tama ba) tapos functions na nagrereturn ng value (ganto ata yung syntax eh yung "void functionname()" nagiging "int void functionname() o int functionname(void)" (hindi ako sure). Pahelp naman po :help:
 
Hello there!! newbie lang ako dito sa symbianize and most important reason ko po ay dahil sa java. I want somebody to help me. I'am creating a java application now na kailangan ng functions similar to d-link ng apple. pinagkaiba lang walang device. so need ko gumamit ng ftp with java functions. I hope somebody can help me :pray: :help:


Best Regards:
Dhez ;)
 
Back
Top Bottom