Quantcast

Got Homework?

Connect with other students for help. It's a free community.

  • across
    MIT Grad Student
    Online now
  • laura*
    Helped 1,000 students
    Online now
  • Hero
    College Math Guru
    Online now

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

alfers101

can someone help me make a flowchart from this program: #include <cstdlib> #include <iostream> using namespace std; int main(int argc, char *argv[]) { int point[10],large=0; cout<<"Enter a number: "<<endl; cin>>point[0]; large=point[0]; for(int x=0;x<10;x++) { cin>>point[x]; if(point[x]>large) large=point[x]; } cout<<"The largest number is "<<large<<endl; system("PAUSE"); return EXIT_SUCCESS; }

  • 2 years ago
  • 2 years ago

  • This Question is Closed
  1. maitre_kaio
    Best Response
    You've already chosen the best response.
    Medals 2

    You should have asked this in the computer science group. But it didn't take me much too long, and I think it could be interesting for people beginning the OCW course.

    • 2 years ago
    1 Attachment
  2. alfers101
    Best Response
    You've already chosen the best response.
    Medals 0

    what could be its analysis ? the IPO . Input, Process and Output?

    • 2 years ago
  3. maitre_kaio
    Best Response
    You've already chosen the best response.
    Medals 2

    Input: 10 integers Process: walk through the integers and keep in memory the largest integer found Output: The largest of the 10 integers

    • 2 years ago
  4. alfers101
    Best Response
    You've already chosen the best response.
    Medals 0

    so that is the Analysis of the program ?

    • 2 years ago
  5. maitre_kaio
    Best Response
    You've already chosen the best response.
    Medals 2

    It's my analysis, I don't know what you or your teacher are expecting. It certainly describes what the program is doing, but maybe you're expecting a specific way to describe this analysis...

    • 2 years ago
  6. alfers101
    Best Response
    You've already chosen the best response.
    Medals 0

    yup . is this correct ? INPUT: Point[10],x=1,large=0 PROCESS: for(int x=1;x<10;x++); if(point[x]>large) OUTPUT: The largest number

    • 2 years ago
  7. maitre_kaio
    Best Response
    You've already chosen the best response.
    Medals 2

    It seems correct to me, except x=1 is really in the process, not the input. And I should say that the output is the largest number, or 0 is the user entered negative numbers.

    • 2 years ago
  8. alfers101
    Best Response
    You've already chosen the best response.
    Medals 0

    so in the flowchart. the x=1 is in the process box not in the initialization??

    • 2 years ago
  9. maitre_kaio
    Best Response
    You've already chosen the best response.
    Medals 2

    Sure, because it is just a way to loop through the numbers

    • 2 years ago
  10. alfers101
    Best Response
    You've already chosen the best response.
    Medals 0

    then on my output in my analysis, it should be The largest number or 0 or negative numbers?

    • 2 years ago
  11. maitre_kaio
    Best Response
    You've already chosen the best response.
    Medals 2

    Do you understand the program, or the diagram I made ? If not, please take 5 minutes to think about it. Then you'll probably be able to answer yourself. If not, I'll help you to find yourself the answer.

    • 2 years ago
  12. alfers101
    Best Response
    You've already chosen the best response.
    Medals 0

    this is my flowchart. im sorry for the arrow, i did it on a rush ^^

    • 2 years ago
    1 Attachment
  13. maitre_kaio
    Best Response
    You've already chosen the best response.
    Medals 2

    sorry I can't read docx, put a picture instead

    • 2 years ago
  14. alfers101
    Best Response
    You've already chosen the best response.
    Medals 0

    here you go

    • 2 years ago
    1 Attachment
  15. maitre_kaio
    Best Response
    You've already chosen the best response.
    Medals 2

    compare yours with mine now, and try to understand the differences

    • 2 years ago
  16. alfers101
    Best Response
    You've already chosen the best response.
    Medals 0

    what is ur initialization ?

    • 2 years ago
  17. alfers101
    Best Response
    You've already chosen the best response.
    Medals 0

    LOL :D its almost the same.

    • 2 years ago
  18. maitre_kaio
    Best Response
    You've already chosen the best response.
    Medals 2

    There are subtle but important differences :) Try to do that: run yourself the flow with a paper and a pen, just for 2 or 3 numbers.

    • 2 years ago
  19. alfers101
    Best Response
    You've already chosen the best response.
    Medals 0

    hmm what would be its analysis ? thats my problem

    • 2 years ago
  20. maitre_kaio
    Best Response
    You've already chosen the best response.
    Medals 2

    draw three columns: one for for large, one for x (or indice), one for point[x]. Then try to go through each step of my flowchart. Don't try to analyze anything for the moment. Your brain will do the work and you'll understand easily how it works.

    • 2 years ago
    • Attachments:

See more questions >>>

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.