I am having a problem getting started on an assignment. I have to write a program for a mortgage calculator with a set dollar amount and a set APR. The instructor mentioned using pseudocode. Could someone please point me in the right direction.

Thanks
Very Confused

Recommended Answers

All 4 Replies

EDIT:^^ Bah, you beat me already.

psedo. can either be written up like a prewrite (scramble ideas down and the basic idea of the program) or can be implemented before the code to explain what the following code does.

for example:

//Include files
#include <iostream>

//namespace
#using namespace std;

//Main
int main()
{
//Display "Hello in console and pause"
cout << "hello";
cin.get();
return 0;

}

I thought I'd add a bit of commentary on the topic that might help you understand what your instructor was talking about a bit better.

As you probably already know from the other posts, pseudocode is a way to layout the logic of a program without actually coding it. What your instructor is wanting to see is not whether or not you can actually code a mortgage calculator, but whether or not you can understand the logic that needs to be used to design such a calculator. It's kind of like describing how a program works in story mode rather than in actual code. You shouldn't abstract too much; however, since that will be too vague to show whether you understand the concept of the programs logic or not.

It's not really psuedocode to say, "read a file and print the number of occurances of the word 'hint'". It is psuedocode to say:

create a counter variable
set the counter variable to 0

open the specified input file for reading
read the file line by line
   scan the line for occurances of the string 'hint'
       increment the counter variable by 1 each time the string is found
close the file

print the value of the counter variable

I hope that helps your understanding.

Thank you all. i think I have it if not I will be back.

Bears

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.