Teentalk

Author Topic: Course: Computer Science  (Read 9248 times)

Hanzo23

  • cotton candy
  • *****
  • Posts: 2430
  • Karma: +127/-43
  • Quod fuimus, estis; quod sumus, vos eritis
Re: Course: Computer Science
« Reply #180 on: July 13, 2011, 11:30:21 pm »
Hi sisters, I really need help, may alam ba kayong sites that woud be helpful in C++ codes programming, I really have some trouble with it. If pwede po ipost yun links, pa-post na lang, if not po please pa-pm po. I would gladly appreciate that. Another thing can you help me po in this two problems. :(

First problem:

Write a C++ program that would display this kind of pattern.
*Note: The number has spaces between them.

1
2 2
3 3 3
4 4 4 4
5 5 5 5 5

Here's how I did it in C# (You may want to convert certain conventions into C++ format)

Quote
int X,Y;
for (X=1; X<=5; X++)
{
     for (Y=X; Y>=1 Y--)
             {
                  Console.Write(" "+X); //this writes the value for the value of X in the Y iteration
              }
      Console.WriteLine(); //ends the "Write" command once it meets the condition of the 2nd "for" loop   
}
Console.ReadLine(); //allows to see the result without closing the console window. Hit "enter" to close


I'll see if I can help you with your second question. The only challenge that remains for you is to translate this C# code into C++. The functions should be similar and the format of the commands are the only difference.
« Last Edit: July 13, 2011, 11:36:31 pm by Hanzo23 »
You shall no longer take things at second or third hand nor look through the eyes of the dead, nor feed on the spectres in books
You shall not look through my eyes either nor take things from me
You shall listen to all sides and filter them from yourself

Hanzo23

  • cotton candy
  • *****
  • Posts: 2430
  • Karma: +127/-43
  • Quod fuimus, estis; quod sumus, vos eritis
Re: Course: Computer Science
« Reply #181 on: July 14, 2011, 02:17:23 am »
Second problem:

Write a C++ program that would display this output pattern.

1
2 2
3 3 3
4 4 4 4
5 5 5 5 5
6 6 6 6
7 7 7
8 8
9



Note: We must USE NESTED LOOPING for all the problems. For the first problem, there are two FOR structures and for the second one, there are 4 FOR structures. I really need your help guys so please please sisters, kindly help me po. :( Godbless you all. Thank you. :(

Here is the code I have built using C# (You should be able to translate that now into C++)

int X,Y,Z,V;
for (X=1; X<=5; X++)
{
     for (Y=X; Y>=1 Y--)
             {
                  Console.Write(" "+X); //this writes the value for the value of X in the Y iteration
              }
      Console.WriteLine(); //ends the "Write" command once it meets the condition of the  "Y" for loop
}
for (Z=6; Z<=10; Z++) //declares Z=6 in an incrementing loop
{
      for (V=X-1; V>1; V--) // using inheritance from the value of X, the int V (which is the iterator), borrows the current value in X and decrements it
     {
            Console.Write(" "+Z); //writes the value of Z
      }
Console.WriteLine(); //ends the write command once it meets the condition of the "V" for loop
X--; //another decrement value for X to get a lower starting inherited value
}
Console.ReadLine(); //To be used to demo the layout. Press enter to escape the command console
You shall no longer take things at second or third hand nor look through the eyes of the dead, nor feed on the spectres in books
You shall not look through my eyes either nor take things from me
You shall listen to all sides and filter them from yourself

angelsakura2

  • taffy
  • ***
  • Posts: 345
  • Karma: +5/-8
  • I'll never be the same if we ever meet again.
Re: Course: Computer Science
« Reply #182 on: July 14, 2011, 07:18:29 pm »
Here is the code I have built using C# (You should be able to translate that now into C++)

int X,Y,Z,V;
for (X=1; X<=5; X++)
{
     for (Y=X; Y>=1 Y--)
             {
                  Console.Write(" "+X); //this writes the value for the value of X in the Y iteration
              }
      Console.WriteLine(); //ends the "Write" command once it meets the condition of the  "Y" for loop
}
for (Z=6; Z<=10; Z++) //declares Z=6 in an incrementing loop
{
      for (V=X-1; V>1; V--) // using inheritance from the value of X, the int V (which is the iterator), borrows the current value in X and decrements it
     {
            Console.Write(" "+Z); //writes the value of Z
      }
Console.WriteLine(); //ends the write command once it meets the condition of the "V" for loop
X--; //another decrement value for X to get a lower starting inherited value
}
Console.ReadLine(); //To be used to demo the layout. Press enter to escape the command console
Here's how I did it in C# (You may want to convert certain conventions into C++ format)

I'll see if I can help you with your second question. The only challenge that remains for you is to translate this C# code into C++. The functions should be similar and the format of the commands are the only difference.

Hi sis, thank you for helping me. I give you a yay for this sister! :) However i have some trouble converting this since i haven't tackled c# yet,and i couldn't find any converter that would work but i'm working on it. :) Thank you so much sis. :)) I would juust like to ask sis, should i use "IF-ELSE" with this? or just stick with the "FOR statements? :) Thank you sis! :)
Fear not the weapon but the hand that wields it. Ü

Hanzo23

  • cotton candy
  • *****
  • Posts: 2430
  • Karma: +127/-43
  • Quod fuimus, estis; quod sumus, vos eritis
Re: Course: Computer Science
« Reply #183 on: July 14, 2011, 07:25:51 pm »
Hi sis, thank you for helping me. I give you a yay for this sister! :) However i have some trouble converting this since i haven't tackled c# yet,and i couldn't find any converter that would work but i'm working on it. :) Thank you so much sis. :)) I would juust like to ask sis, should i use "IF-ELSE" with this? or just stick with the "FOR statements? :) Thank you sis! :)

You dont need to use any IF or nested IF statements when the only criteria that was given to you is to use FOR loops.

C# and C++ share a lot of common traits. for example. the Console.WriteLine() method is also allowed to be used in C++. The Nested IF statements are identical so you only need to figure out how to write the output based on the programming language you are using.

BTW........ Im a guy  ;)
You shall no longer take things at second or third hand nor look through the eyes of the dead, nor feed on the spectres in books
You shall not look through my eyes either nor take things from me
You shall listen to all sides and filter them from yourself

angelsakura2

  • taffy
  • ***
  • Posts: 345
  • Karma: +5/-8
  • I'll never be the same if we ever meet again.
Re: Course: Computer Science
« Reply #184 on: July 14, 2011, 09:03:23 pm »
You dont need to use any IF or nested IF statements when the only criteria that was given to you is to use FOR loops.

C# and C++ share a lot of common traits. for example. the Console.WriteLine() method is also allowed to be used in C++. The Nested IF statements are identical so you only need to figure out how to write the output based on the programming language you are using.

BTW........ Im a guy  ;)

Oh im sorry for that, thanks a lot bro. haha i need to study how to convert that to c++ to get it right. Thank you bro. You really help me a lot. :)
Fear not the weapon but the hand that wields it. Ü

Hanzo23

  • cotton candy
  • *****
  • Posts: 2430
  • Karma: +127/-43
  • Quod fuimus, estis; quod sumus, vos eritis
Re: Course: Computer Science
« Reply #185 on: July 14, 2011, 10:04:27 pm »
Oh im sorry for that, thanks a lot bro. haha i need to study how to convert that to c++ to get it right. Thank you bro. You really help me a lot. :)
No prob.

The FOR statements should be the same format. I checked MSDN and they should be the same. The only difference is to translate "Write()" and "WriteLine()" into C++. The major difference for them is that "Write()" outputs the value in a single line continuously and "WriteLine()" outputs the value into a single line of text and any future output moves to the next line below.
You shall no longer take things at second or third hand nor look through the eyes of the dead, nor feed on the spectres in books
You shall not look through my eyes either nor take things from me
You shall listen to all sides and filter them from yourself

angelsakura2

  • taffy
  • ***
  • Posts: 345
  • Karma: +5/-8
  • I'll never be the same if we ever meet again.
Re: Course: Computer Science
« Reply #186 on: July 23, 2011, 05:51:46 pm »
No prob.

The FOR statements should be the same format. I checked MSDN and they should be the same. The only difference is to translate "Write()" and "WriteLine()" into C++. The major difference for them is that "Write()" outputs the value in a single line continuously and "WriteLine()" outputs the value into a single line of text and any future output moves to the next line below.

Thank you bro. Sorry late reply. Naging busy kasi sa school po e.

Fear not the weapon but the hand that wields it. Ü

angelsakura2

  • taffy
  • ***
  • Posts: 345
  • Karma: +5/-8
  • I'll never be the same if we ever meet again.
Re: Course: Computer Science
« Reply #187 on: July 23, 2011, 05:56:08 pm »
Hi bros and sis, i need a favor po. Pahelp ulit po sana sa programming since im stuck. It is kinda long and i need to pass it before midhight but i have only finished 1/4 of it and im stuck. :( If there is anyone there who is willing to help, please kindly pm me po. Thank you. :(( This will mean a lot.
Fear not the weapon but the hand that wields it. Ü

patrishapink

  • sugar drops
  • *
  • Posts: 56
  • Karma: +1/-1
  • Everlasting~
    • Tumblr
Re: Course: Computer Science
« Reply #188 on: August 19, 2011, 01:01:21 pm »
Boring raw ang ConSci sabi ng kuya ko eh. Kaya nga may nag-suggest sa kanya na IT na lang raw yung kukunin niya. ;)

Hanzo23

  • cotton candy
  • *****
  • Posts: 2430
  • Karma: +127/-43
  • Quod fuimus, estis; quod sumus, vos eritis
Re: Course: Computer Science
« Reply #189 on: August 19, 2011, 01:15:39 pm »
Boring raw ang ConSci sabi ng kuya ko eh. Kaya nga may nag-suggest sa kanya na IT na lang raw yung kukunin niya. ;)

I wouldnt confirm it is boring per se, if you like puzzles, or problem solving, you'll love this profession. It takes a lot of concentration to understand the problem and come up with a solution.
You shall no longer take things at second or third hand nor look through the eyes of the dead, nor feed on the spectres in books
You shall not look through my eyes either nor take things from me
You shall listen to all sides and filter them from yourself

angelsakura2

  • taffy
  • ***
  • Posts: 345
  • Karma: +5/-8
  • I'll never be the same if we ever meet again.
Re: Course: Computer Science
« Reply #190 on: November 05, 2011, 10:43:45 pm »
Hi po. I need your help. May assignment kasi kami sa C# po e I dont seem to get this last part.

"You should have another implementation class (BorrowerApp = form1) for the calling of a constructor and for creating an instance of a Borrower class. "

Our goal is to create a simplified library system. The last line which is the one above is confusing, d ko po alam if I should create another form or another class, and what I would put inside the class or form. Thank you po sa mga may opinyons or sasagot, any idea? :)
Fear not the weapon but the hand that wields it. Ü

xinmoi

  • taffy
  • ***
  • Posts: 476
  • Karma: +4/-6
  • :> smug peys. :P
Re: Course: Computer Science
« Reply #191 on: November 25, 2011, 05:28:39 pm »
Hello CS people. Patulong naman. Baka may i-susuggest kayong thesis proposal. Me and my group are making with this for 3 weeks na. Kaya lang wala talaga kaming maisip. Pa-suggest naman. Or, mag-share na lang kayo ng na-thesis nyo. It will surely be a great help!  :)
Life is tough. But I am TOUGHER!




what can i do to make YOU love me?

Hanzo23

  • cotton candy
  • *****
  • Posts: 2430
  • Karma: +127/-43
  • Quod fuimus, estis; quod sumus, vos eritis
Re: Course: Computer Science
« Reply #192 on: November 26, 2011, 02:00:27 pm »
Hello CS people. Patulong naman. Baka may i-susuggest kayong thesis proposal. Me and my group are making with this for 3 weeks na. Kaya lang wala talaga kaming maisip. Pa-suggest naman. Or, mag-share na lang kayo ng na-thesis nyo. It will surely be a great help!  :)

Are you strictly software only? what are the skill levels in terms of coding and programming language of your groupmates?
You shall no longer take things at second or third hand nor look through the eyes of the dead, nor feed on the spectres in books
You shall not look through my eyes either nor take things from me
You shall listen to all sides and filter them from yourself

akosidaph

  • cotton candy
  • *****
  • Posts: 1060
  • Karma: +60/-6
  • SPONGEBOB <3
    • FB Page
Re: Course: Computer Science
« Reply #193 on: November 26, 2011, 09:48:46 pm »
Hello po :) Medyo naguguluhan pa po kasi ako sa kukuning course. My choices are: BSBAA, BSMath at ito. Mahal ko po kasi yung Math mula pagkabata hanggang ngayon. Kaya lang, biglang dumating si ICT sa buhay ko na nagturo sa akin ng basic programming gamit ang C++ at VB6. So, kung okay lang po, share naman po kayo ng something about Computer Science. Para lang alam ko po kung ano talaga kukunin ko. Thanks po :) Have a nice day :)

Hanzo23

  • cotton candy
  • *****
  • Posts: 2430
  • Karma: +127/-43
  • Quod fuimus, estis; quod sumus, vos eritis
Re: Course: Computer Science
« Reply #194 on: November 27, 2011, 09:29:20 am »
Hello po :) Medyo naguguluhan pa po kasi ako sa kukuning course. My choices are: BSBAA, BSMath at ito. Mahal ko po kasi yung Math mula pagkabata hanggang ngayon. Kaya lang, biglang dumating si ICT sa buhay ko na nagturo sa akin ng basic programming gamit ang C++ at VB6. So, kung okay lang po, share naman po kayo ng something about Computer Science. Para lang alam ko po kung ano talaga kukunin ko. Thanks po :) Have a nice day :)

Computer Science has a very wide field by itself. Some programming jobs are math intensive (algorithms, encryption, finance, simulations for both entertainment and military) and sometimes a master's degree in Mathematics is needed to get into these certain kind of careers.

If you love math, I would still recommend the CS field just because of the amount of career openings and the general path where the market is shifting.
You shall no longer take things at second or third hand nor look through the eyes of the dead, nor feed on the spectres in books
You shall not look through my eyes either nor take things from me
You shall listen to all sides and filter them from yourself

 

Candy Blog

Who We Spotted: Leighton Meester and Mario Maurer for Penshoppe
by: sam, 2012-05-27
Considering this has been one of the most star studded 7 days in Philippine Fashion Week...

Council of Cool Blog

Double Whammy
by: Janelle, 2012-05-23
Last May 8, I was given the chance to attend not one but two amazing events for Candy....
Summit Media
WOMEN'S TITLES: Cosmopolitan | Candy | Yummy | Good Housekeeping | OK! | Preview | Town & Country | Women's Health | Yes!
MEN'S TITLES: FHM | Entrepreneur | Men's Health | Techie | Topgear
WEBSITES: Female Network | Smart Parenting | Jobstreet | Style Bible | Shopcrazy

Reproduction of material from any CandyMag.com pages without written permission is strictly prohibited.
Copyright 2012 Summit Digital. All rights reserved. CandyMag.com is a property of Summit Media.

Contact information: 6F & 7F Robinsons Cybergate Center Tower 3 Robinsons Pioneer Complex Pioneer St., Mandaluyong City 1550 Philippines.
Telephone (63-2) 451-8888 | Fax (63-2) 631-7788

Our Privacy Policy | Terms of Service | Summit Media Corporate Website