hey I am new in C++ and I have finished my code but my Prof. asked me to write pseudocode and I have no idea what that is and I dont know how to write it. Can somebody give me some example how to write pseudocde from this code.

``````//This program will calculate the monthly payment on a loan.

#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;

int main() {

double payment, rate, n, l;

cin >> rate;
rate /= 12; // or rate = rate / 12;
cout << "Please enter the number of payments: ";
cin >> n;
cout << "Please enter the amount of the loan: ";
cin >> l;
payment = rate * pow(1 + rate, n) / (pow(1 + rate, n) - 1) * l;
cout << "Loan Amount: \$"<< l << endl;
cout << "Monthly Interest Rate: "<< rate << "%" << endl;
cout << "Number of Payments: "<< n << endl;
cout << "Monthly Payment: \$"<< payment << endl;
cout << "Amount Paid Back: \$"<< n * payment << endl;
cout << "Interest Paid: \$"<< n * payment - l << endl;

return 0;
}``````

Thanks

Edited by WaltP: Added CODE Tags -- learn to use them

3
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by aqnie

hey I am new in C++ and I have finished my code but my Prof. asked me to write pseudocode and I have no idea what that is and I dont know how to write it.

Well, in my opinion, you should have ask him this when he told you to do it.

But, in lieu of that, pseudo code is describing what the program does in a (Pick Your Native Language)-like manner.

Thing like:
1) Input the values for height and width.
2) Calculate the area with `(height * width) / 2` 3) Display the result

Just thought of something. If you don't know anything about it and your Prof never taught you, how did you know is was spelled pseudocode? :icon_wink:

Edited by WaltP: n/a

1. use code tags.
2. if you are being asked for pseudocode then i am guessing your prof doesn't think you are ready for the actual code yet.