Module 4 Exercises.docx - 5 Pseudocode start Declarations num number housekeeping while number >= 1 detailLoop endwhile finishUp stop housekeeping

Module 4 Exercises.docx - 5 Pseudocode start Declarations...

This preview shows page 1 - 3 out of 3 pages.

5. Pseudocode: start Declarations num number housekeeping() while number >= 1 detailLoop() endwhile finishUp() stop housekeeping() number = 10 return detailLoop() output number number = number - 1 return finishUp() output “End of program” return 9. Pseudocode: start Declarations num accountNum num balance num year string firstName string lastName num INTEREST_RATE = 0.04 num TERM = 20 string PROMPT1 = “Enter an account number or 999 to exit” string PROMPT2 = “Enter the name and balance” housekeeping while accountNum does not equal 999 detailLoop() endwhile finishUp() stop housekeeping() output PROMPT1 input accountNum return
Image of page 1
detailLoop() output PROMPT2 input firstName, lastName, balance output accountNum, firstName, lastName year = 0 while year < TERM balance = balance * (1 + INTEREST_RATE) year = year + 1 output year, balance endwhile output PROMPT1
Image of page 2
Image of page 3

You've reached the end of your free preview.

Want to read all 3 pages?

Unformatted text preview: input accountNum return finishUp() output “End of program” return 10. Pseudocode:startDeclarations num buildingNum num aptNum num month num TOTAL_BUILDS = 20 num TOTAL_UNITS = 15num TOTAL_MONTHS = 12 num RENT = 800 string COUPON_HEADING = “Payment Coupon”housekeeping() while buildingNum <= TOTAL_BUILDS detailLoop() endwhile finishUp() stop housekeeping() buildingNum = 1 return detailLoop() aptNum = 1 while aptNum <= TOTAL_UNITS month = 1 while month <= TOTAL_MONTHS output COUPON_HEADING output “Building Number: “, buildingNumoutput “Apartment Number: “, aptNum output “Month: “, month output “Rent Due: “, RENT month = month + 1 endwhileaptNum = aptNum + 1 endwhilebuildingNum = buildingNum + 1 return finishUp() output “End of program” return...
View Full Document

  • Fall '15
  • Equals sign, ASCII, accountNum, output year, num TERM

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes
A+ icon
Ask Expert Tutors