954,483 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Having trouble writing pseudocodes.

I just started taking Logic and design and Im not understanding the whole concept. I try writing it but know that its wrong and im leaving to many things out and dont know what to write or how to write it. My book tells me "this is how its done" but i dont understand why or how to write a code that asks for multiple decisions and processes. if someone could explain how and why these things work i would be in debt to you.


Someone please help!!

The question im working on is:

The summerville phone company chrges 10 centa per minute for all calls out side of the costumers area code that last over 20 minutes. All other calls are 13 cents per minute. Design a pseudocode for the following:

a. A program that accepts the following about one phone call: cosumer area code (3 digit), the costumers phone number (7 digits) called area code (3 digits), called phone number (7 digits), and called time in minutes (4 digit). Display the calling number, called number, and price for te call.

b. A program that continuously accepts data about phone calls until sentinel value is entered, and displays only about calls the cost over $10.

c. A program that continuously accepts data about phone calls until sentinel value is entered, and displays deails only about calls placed from the 212 area code to the 757 area code that last over 20 minutes.

d. A program that promts the user for a three-digit area code from which to select phone calls. Then the program coninuously accepts data about phone calls until sentinel value is entered, and displays only for phone calls placed to or from specified area code.

ND2
Newbie Poster
1 post since Jun 2011
Reputation Points: 10
Solved Threads: 0
 

We can't tell you what's wrong with your logic if you don't post the pseudocode you have. Don't expect us to give you the solution.

Narue
Bad Cop
Administrator
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
 

Pseudo code is just a step by step description of how to perform a computation, along with appropriate explanations of what each step does to fulfill the requirements. There is no magic here, just work so get started!

rubberman
Posting Virtuoso
1,564 posts since Mar 2010
Reputation Points: 277
Solved Threads: 179
 

If you need an example of pseudo-code lets take the example of how to find the largest element in an array

pick the first element as the current largest

for each element in the array
    if this element is bigger than the current largest
        save this element as the current largest
    end if
next


And to be picky, I probably should not have included the "end if" and "next" statements because those are actual keywords and not pseudo-code. But you get the drift.

Reverend Jim
Posting Shark
Moderator
1,167 posts since Aug 2010
Reputation Points: 253
Solved Threads: 159
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: