What's new

Closed Pa help naman po about sa increment

Status
Not open for further replies.
Kung gagawa ka po ng multiplication table bale ganito po yun sa java

ex.

Scanner input = new Scanner(System.in);
System.out.print("Enter Numbers ");

int n = input.nextInt();

for(int i = 1; i <= 10; i++)
System.out.println(n+" * "+i+" = "+n*i);

Sample nag input ako ng 1 bale ang output na po ay ganito.

Enter Numbers 1
1 * 1 = 1
1 * 2 = 2
1 * 3 = 3
1 * 4 = 4
1 * 5 = 5
1 * 6 = 6
1 * 7 = 7
1 * 8 = 8
1 * 9 = 9
1 * 10 = 10

sana po makatulong. Godbless.
Galing mo idol.
 
Magsimula ka sa mga scripting languages tulad ng html aralin mo yung mga complex frameset at table then jump ka sa css, practisin mo kahit di mo lahat magamit ng rules ng css as long na ma build mo yung logic mo then mag java ka.
prô tip di mo kailngan aralin lahat ng programming languages need mo lang ma master ang isa
boss na master mo na yata ung assembly language? paturo naman. hehehe
 
#include <iostream.h>

int main ();
{

int a;

for (i=1;i<=a; i++)
{
cout<<i;
}
return 0;
}
baka ganto . tagal ko na d nagamit c++ eh try mo nlng
 
/*
multiplication table
*/
#include<iostream>
using namespace std;

int main()
{
int c=1,d=1;

for(c=1;c<=10;c++) //umpisa, ang c ay 1. hanggat hindi nagiging 10, magdagdag ng 1 sa c kada iteration.
{

for(d=1;d<=10;d++) //umpisa, ang d ay 1. hanggat hindi nagiging 10, magdagdag ng 1 sa d kada iteration.
{
cout<<c*d<<" "; //idisplay: c x d
}
cout<<endl;
}

return 0;

}
 
01234567890123456789
1.......###########........
2.....#############.....
3...###############..
4...|..................................|..
5...|..###..._____...###...|..
6...|..###...|.......|...###...|..
7...|............|.....o|.............|..
8...|............|.......|.............|..
9...----------------------------------..
eto po yung dapat na output na epinagawa samin ni sir dati. whew.. marami nag try. konte lang ang nag tagumpay.. bagsak ako dyan. hehehe pinag hinayan nako ng loob kasi. hahaha use your favorite loops or combination of loops that have been taught, warning (dont use force method).

ps. disregard nalang ung numbers at period. guidelines ko lang yan hehehe thanks sa programmer na gagawa ng code neto.. kung ikaw lang sana naging classmate namen na salba mo na halos lahat kami.
Parang ang hirap niyan
 
01234567890123456789
1.......###########........
2.....#############.....
3...###############..
4...|..................................|..
5...|..###..._____...###...|..
6...|..###...|.......|...###...|..
7...|............|.....o|.............|..
8...|............|.......|.............|..
9...----------------------------------..
eto po yung dapat na output na epinagawa samin ni sir dati. whew.. marami nag try. konte lang ang nag tagumpay.. bagsak ako dyan. hehehe pinag hinayan nako ng loob kasi. hahaha use your favorite loops or combination of loops that have been taught, warning (dont use force method).

ps. disregard nalang ung numbers at period. guidelines ko lang yan hehehe thanks sa programmer na gagawa ng code neto.. kung ikaw lang sana naging classmate namen na salba mo na halos lahat kami.

Eto po baka sakaling makatulong pa po sainyo. Medyo nalito ako kung gagawin pa dynamic kaya eto lang po kinaya. Di ko lang po alam kung pasok sa condition ng prof nyo yung code pero gumagana po sya
Code:
#include <iostream>

using namespace std;

main(){
    //bubong fixed values po ito
    int max = 18;
    int roofRowCount = 4;
    do{
        for (int space = 1; space<=roofRowCount;space++){
            cout << " ";
        }
        for(int bubong=0; bubong<=max-(roofRowCount*2); bubong++){
            cout << "#";
        }
        cout<< endl;
        roofRowCount--;
    }while(roofRowCount>0);

    //body fixed din po ito ha hehe
    int katawanRows = 5;
    int katawanColumns = max - 4;
    int maxDoorBody = 3;
       
    for (int i=katawanRows; i>0;i--){       
        cout << " |";
       
        if (i == katawanRows){
            //Pader ng bahay
            for(int c=0;c<=katawanColumns;c++){
                cout << " ";
            }
        }       
        else if (i == 4 || i == 3 ){
            //initial window pati pintuan
            for (int ctr = 0; ctr<1; ctr++){
                cout<<" ";
                for (int xxx=0;xxx<3;xxx++){
                    cout << "#";
                }
                cout<<" ";               
                if(i == 4){
                    for(int _=0;_<5;_++){
                        cout << "_";
                    }
                }
                else if (i == 3 || i == 2 || i == 1){
                    cout << "|";                                   
                    for(int _=0;_<i;_++){
                        cout << " ";
                    }                                       
                    cout << "|";
                }               
                cout<<" ";
                for (int xxx=0;xxx<3;xxx++){
                    cout << "#";
                }
                cout<<" ";
            }
        }
       
        else {
            //final ng pinto na may door knob
            for (int ctr = 0; ctr<1; ctr++){
                for (int xxx=0;xxx<5;xxx++){
                    cout << " ";
                }               
                if (i == 3 || i == 2 || i == 1){
                    cout << "|";                                   
                    for(int _=0;_<i;_++){
                        cout << " ";
                    }
                   
                    if(i==2){
                        cout << "•";
                    }
                    else {
                        int x=0;
                        do {
                            cout << " ";
                            x++;
                        }while(x<2);
                    }
                                               
                    cout << "|";
                }               
                for (int xxx=0;xxx<5;xxx++){
                    cout << " ";
                }
            }
        }       
        cout << "|";
        cout << endl;
    }
    //Talampakan ng bahay
    cout << " ";
      for (int foundation=0; foundation<=max-2; foundation++){
          cout <<"_";
    }
}

testttt.jpg
 

Attachments

S
Eto po baka sakaling makatulong pa po sainyo. Medyo nalito ako kung gagawin pa dynamic kaya eto lang po kinaya. Di ko lang po alam kung pasok sa condition ng prof nyo yung code pero gumagana po sya
Code:
#include <iostream>

using namespace std;

main(){
    //bubong fixed values po ito
    int max = 18;
    int roofRowCount = 4;
    do{
        for (int space = 1; space<=roofRowCount;space++){
            cout << " ";
        }
        for(int bubong=0; bubong<=max-(roofRowCount*2); bubong++){
            cout << "#";
        }
        cout<< endl;
        roofRowCount--;
    }while(roofRowCount>0);

    //body fixed din po ito ha hehe
    int katawanRows = 5;
    int katawanColumns = max - 4;
    int maxDoorBody = 3;
      
    for (int i=katawanRows; i>0;i--){      
        cout << " |";
      
        if (i == katawanRows){
            //Pader ng bahay
            for(int c=0;c<=katawanColumns;c++){
                cout << " ";
            }
        }      
        else if (i == 4 || i == 3 ){
            //initial window pati pintuan
            for (int ctr = 0; ctr<1; ctr++){
                cout<<" ";
                for (int xxx=0;xxx<3;xxx++){
                    cout << "#";
                }
                cout<<" ";              
                if(i == 4){
                    for(int _=0;_<5;_++){
                        cout << "_";
                    }
                }
                else if (i == 3 || i == 2 || i == 1){
                    cout << "|";                                  
                    for(int _=0;_<i;_++){
                        cout << " ";
                    }                                      
                    cout << "|";
                }              
                cout<<" ";
                for (int xxx=0;xxx<3;xxx++){
                    cout << "#";
                }
                cout<<" ";
            }
        }
      
        else {
            //final ng pinto na may door knob
            for (int ctr = 0; ctr<1; ctr++){
                for (int xxx=0;xxx<5;xxx++){
                    cout << " ";
                }              
                if (i == 3 || i == 2 || i == 1){
                    cout << "|";                                  
                    for(int _=0;_<i;_++){
                        cout << " ";
                    }
                  
                    if(i==2){
                        cout << "•";
                    }
                    else {
                        int x=0;
                        do {
                            cout << " ";
                            x++;
                        }while(x<2);
                    }
                                              
                    cout << "|";
                }              
                for (int xxx=0;xxx<5;xxx++){
                    cout << " ";
                }
            }
        }      
        cout << "|";
        cout << endl;
    }
    //Talampakan ng bahay
    cout << " ";
      for (int foundation=0; foundation<=max-2; foundation++){
          cout <<"_";
    }
}

testttt.jpg
Sobrang haba prang nag force method, sobrang inefficient :) practice pa kuya
 

Attachments

Status
Not open for further replies.

Similar threads

Back
Top