INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

How do you write an Algorithm?

How do you write an Algorithm?

(OP)
Okay, I know this is a little weird, but my son needs some help figuring this out.

He is taking a Computer Programming for Engineers class, using C++ in the Sun environment. The lab instructor asked him for his algorithm. He had no clue what she was talking about. I'm a web programmer, using PHP, ASP, Perl, etc..., so I sort of had an idea, but it's been a really long time since I was in college and we just had to turn in our code and output.

I have looked in my 2 C++ books and around on the internet a bit. I found a good definition, but couldn't find an example that was basic enough for this program. Essentially what he had to do was to print out about 7 lines of output:

// Lab3a.cpp cout spacing

#include <iostream>
using namespace std;
int main ()
{
  cout << "***     ***" << endl;
  cout << "Line 2 of the output\n";
  cout << "Line 3 of the output\n";
  cout << "\n";
  cout << "A blank line is above this line" << endl;
  cout << "Line 6 of the output\n";
  //put 3 blank lines below this comment
  cout << "\n\n\n";
  cout << "Line 6 of the output\n";
  cout << "***     ***" << endl;
  return 0;
}

A very simple program. He got the required output, but I'm not exactly sure about how to tell him to go about writing an algorithm for it. I'm going to lab with him tomorrow night. Any ideas?

I don't think he'll ever be a programmer :( but I think he'll make a good Civil Engineer as long as he gets to play in the dirt every now and then :)

RE: How do you write an Algorithm?

(OP)
BTW, I'm not asking anyone to "DO" my son's homework for him. Just trying to figure out what in the world this teacher is asking for, since neither of us are familar with this terminology. I know that there have to be some folks out there who are in college or recently graduated that will have at least a clue what he's being asked to do. The instructor is assuming that everyone in the class is a computer geek and my son is not. He can barely figure out how to use his email :)

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close