How JustAnswer Works:

  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.

Ask R.A. McConnell Your Own Question

R.A. McConnell
R.A. McConnell, Consultant
Category: Programming
Satisfied Customers: 757
Experience:  A-Plus, MCP, 18+ years experience, LINUX admin
45119205
Type Your Programming Question Here...
R.A. McConnell is online now
A new question is answered every 9 seconds

Im in need of a Pseudo code. This may seem elementary to some

Resolved Question:

I'm in need of a Pseudo code. This may seem elementary to some but I'm having a difficult time with it because its a subject that I really have no interest in but I have to take the class due to prerequisite .

Example:

Write a program that obtains two integer numbers from the user.

It will print out the sum of those numbers.

Pseudo code:

Prompt the user to enter the first integer
Prompt the user to enter a second integer
Compute the sum of the two user inputs
Display an output prompt that explains the answer as the sum
Display the result
Submitted: 1 year ago.
Category: Programming
Expert:  R.A. McConnell replied 1 year ago.

Hello, I'll be happy to help you with this.


Pseudo code for a project like follows:


create variables integer1, integer2, explanation, sum;
display("Please enter your first integer: ");
input integer1;
if (has_errors(integer1)) {
exit_with_error("Error. Non-integer value in first integer.");
}
newline;
display("Please enter your second integer: ");
if (has_errors(integer2)) {
exit_with_error("Error. Non-integer value in second integer.");
}
sum = integer1 + integer2;
newline;
display("The sum of the two integers is: ");
display(sum);


If you would like clarification on any of these points, more depth in my answer, or if you have additional questions with regard to this matter, please don't hesitate to ask and I'll be happy to continue to lend a hand.

R.A. McConnell, Consultant
Category: Programming
Satisfied Customers: 757
Experience: A-Plus, MCP, 18+ years experience, LINUX admin
R.A. McConnell and other Programming Specialists are ready to help you
Customer: replied 1 year ago.

I just noticed a few more things needed...I hope it not too late to have them added if their not already there. Thank you So much for the fast response.


 



  1. The program must have some sort of menu that allows users to make selections to do a particular calculation.

  2. It must provide five menu items that allow the user to make a calculation. There should be an additional menu item for user to exit the program. So, total of 6 menu item.

  3. Once the user selects a menu item, program should perform calculation, display the result to the user, and return to the main menu. User should be presented with main menu until they choose option to exit the program.



Expert:  R.A. McConnell replied 1 year ago.
Do you know what the five (5) menu items (aside from the sixth, which will exit the program) should be? I can imagine the following:


  1. Enter the First Number.

  2. Enter the Second Number.

  3. Add the Numbers.

  4. Subtract the Second Number from the First.

  5. Multiply the Numbers.



But your original requirements specified adding (providing a sum) the number, so I want to make sure that a change to this is correct.
Customer: replied 1 year ago.

Thank You so much. I have been in a panic over this. Coding is not my thing, now if the assignment was write an essay or draw a picture I would be all over it. But not this. Thanks Again!!

Expert:  R.A. McConnell replied 1 year ago.
Is the list that I provided what you want the menu to be?
Customer: replied 1 year ago.

yes

Expert:  R.A. McConnell replied 1 year ago.

Here is the modified program with a menu. I wrote it for command line our text output (to get the formatting correct, I'll need to edit this again, so give it about five minutes, then check again):
create variables integer1, integer2, explanation, result, loopCounter, menuChoice;

create array menuItem[];

function displayMenu() {

for (loopCounter = 0; loopCounter < length(menuItem[]); loopCounter++) {

display(menuItem[x]);

}

}

menuItem[1] = "Enter the First Number" + newline;

menuItem[2] = "Enter the Second Number" + newline;

menuItem[3] = "Add the Numbers" + newline;

menuItem[4] = "Subtract the Second Number from the First" + newline; menuItem[5] = "Multiply the Numbers" + newline;

menuItem[6] = "Exit the Program" + newline; menuChoice = 0;

while (menuChoice != 6) {

displayMenu();

waitForInput menuChoice;

if (menuChoice == 1) {

display("Please enter your first integer: ");

input integer1;

if (has_errors(integer1)) {

exit_with_error("Error. Non-integer value in first integer.");

}

}

if (menuChoice == 2) {

display("Please enter your second integer: ");

if (has_errors(integer2)) {

exit_with_error("Error. Non-integer value in second integer.");

}

}

if (menuChoice == 3) {

result = integer1 + integer2;

display("The sum of the two integers is: ");

display(result + newline);

}

if (menuChoice == 4) {

result = integer1 - integer2;

display("The difference between the two integers is: ");

display(result + newline);

}

if (menuChoice == 5) {

result = integer1 * integer2;

display("The product of the two integers is: ");

display(result + newline);

}

if (menuChoice == 6) {

exitProgram;

}

else restartLoop;

}

Customer: replied 1 year ago.

Were you able to edit that code?

Expert:  R.A. McConnell replied 1 year ago.
Yes, although the indentation didn't work quite the way I wanted. Regardless, the code as posted will work just fine.
Customer: replied 1 year ago.
Thank so very much!!! Have a great rest of your week!

JustAnswer in the News:

 
 
 
Ask-a-doc Web sites: If you've got a quick question, you can try to get an answer from sites that say they have various specialists on hand to give quick answers... Justanswer.com.
JustAnswer.com...has seen a spike since October in legal questions from readers about layoffs, unemployment and severance.
Web sites like justanswer.com/legal
...leave nothing to chance.
Traffic on JustAnswer rose 14 percent...and had nearly 400,000 page views in 30 days...inquiries related to stress, high blood pressure, drinking and heart pain jumped 33 percent.
Tory Johnson, GMA Workplace Contributor, discusses work-from-home jobs, such as JustAnswer in which verified Experts answer people’s questions.
I will tell you that...the things you have to go through to be an Expert are quite rigorous.
 
 
 

What Customers are Saying:

 
 
 
  • My Expert answered my question promptly and he resolved the issue totally. This is a great service. I am so glad I found it I will definitely use the service again if needed. One Happy Customer New York
< Last | Next >
  • My Expert answered my question promptly and he resolved the issue totally. This is a great service. I am so glad I found it I will definitely use the service again if needed. One Happy Customer New York
  • Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help. Mary C. Freshfield, Liverpool, UK
  • This expert is wonderful. They truly know what they are talking about, and they actually care about you. They really helped put my nerves at ease. Thank you so much!!!! Alex Los Angeles, CA
  • Thank you for all your help. It is nice to know that this service is here for people like myself, who need answers fast and are not sure who to consult. GP Hesperia, CA
  • I couldn't be more satisfied! This is the site I will always come to when I need a second opinion. Justin Kernersville, NC
  • Just let me say that this encounter has been entirely professional and most helpful. I liked that I could ask additional questions and get answered in a very short turn around. Esther Woodstock, NY
  • Thank you so much for taking your time and knowledge to support my concerns. Not only did you answer my questions, you even took it a step further with replying with more pertinent information I needed to know. Robin Elkton, Maryland
 
 
 

Meet The Experts:

 
 
 
  • ATLPROG

    Computer Software Engineer

    Satisfied Customers:

    7463
    MS in IT.Several years of programming experience in Java C++ C C# Python VB Javascript HTML
< Last | Next >
  • http://ww2.justanswer.com/uploads/SP/spatlanta2010/2011-6-23_12450_photo.64x64.gif ATLPROG's Avatar

    ATLPROG

    Computer Software Engineer

    Satisfied Customers:

    7463
    MS in IT.Several years of programming experience in Java C++ C C# Python VB Javascript HTML
  • http://ww2.justanswer.com/uploads/ComputersGuru/2010-02-13_051118_Photo41.JPG LogicPro's Avatar

    LogicPro

    Computer Software Engineer

    Satisfied Customers:

    5603
    Expert in C, C++, Java, DOT NET, Python, HTML, Javascript, Design.
  • http://ww2.justanswer.com/uploads/unvadim/2010-11-15_210218_avatar.jpg unvadim's Avatar

    unvadim

    Computer Software Engineer

    Satisfied Customers:

    1158
    Good knowledge of OOP principles. 3+ years of programming experience with Java and C++. Sun Certified Java Programmer 5.0.
  • http://ww2.justanswer.com/uploads/lifesaver333/2010-10-17_191349_ls.jpeg lifesaver's Avatar

    lifesaver

    Computer Software Engineer

    Satisfied Customers:

    950
    Several years of intensive programming and application development experience in various platforms.
  • http://ww2.justanswer.com/uploads/EH/ehabtutor/2012-8-2_202016_1.64x64.jpg ehabtutor's Avatar

    ehabtutor

    Computer Software Engineer

    Satisfied Customers:

    864
    Bachelor of computer science, 5+ years experience in software development, software company owner
  • http://ww2.justanswer.com/uploads/RA/rajivsharma086/2012-6-6_17128_displaypic.64x64.jpg Raj's Avatar

    Raj

    Computer Engg.

    Satisfied Customers:

    860
    BE CS, 4+ Experience in Programming and Database (ERP)
  • http://ww2.justanswer.com/uploads/eljonis/2010-01-06_130406_eljon2.jpg Eljon's Avatar

    Eljon

    Consultant

    Satisfied Customers:

    590
    11 yrs of programming (PHP, WordPress, XSL, SQL, JavaScript)