Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please complete the questions below in this Word document and submit only this document for grading. Do not remove the questions or text that is

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

Please complete the questions below in this Word document and submit only this document for grading. Do not remove the questions or text that is here. Mark any modifications or additions to the pseudocode or comments by showing them in red. Any flowcharts given are images. Either describe the changes needed or mark them in red using the Word drawing tools. Performing Maintenance In this week's chapters you learned that some of the tasks assigned to new programmers frequently involve maintenancemaking changes to existing programs because of new requirements. Assume that the flowchart below for each question is a separate working program in your organization and that it needs modifications as described in the comments (lines that begin with two slashes) at the beginning of the code. Your job is to alter the pseudocode to meet the new specifications as noted above. 1. // MAINTENANCE03 // Modularize this program ... start // Assume that this program works, but that it needs to be structured and modularized. A No Yes B? E No D? Yes F G Yes Yes H? J? No No K F G 2. // MAINTENANCE04 // Currently, this program displays data for all students. Modity to display only those who have more than 60 credits and have a GPA of at least 3.5. detailLoop() output "Enter credits >> start (housekeepingo) output "Enter student string nane input credits Declarations num credits nun spa string QUIT - "222" output "Enter gpa >> - input na housekeeping input spa return Yes finish nane > QUIT? detail Loop output name." Credits: credits. GPA: ". spa No output "Program finished finish retum "Enter student name or -. QUIT . "to quit >> stop input nane (return Find the Bugs 1. Each code segment below starts with some comments (lines that begin with two slashes) that describe the program. Examine the pseudocode that follows the introductory comments, then find and correct all the bugs as indicated above using red marks. a. // DEBUGO3-01 // This pseudocode is intended to determine whether students have // passed or failed a course; student needs to average 60 or // more on two tests. start Declarations num first test num sesendTest num average num PASSING = 60 while first fest, not equal to O output "Enter first score or 0 to quit input first test output "Enter second score" input sesendTest average = (first test + sesendTest) / 2 quput "Average is ", average if average >= PASSING then output "Pass" else output "Fail" endif endwhite stop b. // DEBUG04-01 // apartment, $75 for renting a two-bedroom apartment, $55 for // renting a one-bedroom apartment, and $30 for renting a studio 11 (zero-bedroom) apartment. Output is the salesperson's // name and ID number and the commission earned on the rental. start Declarations num sedes persones string sedeslersenNams num numbedrooms num COMM 3 = $100.00 num COMM 2 = $75.00 num COMM 1 = $55.00 num COMM STUDIO = $30.00 num QUIT = 9999 Seti Ready) while salespersenth QUIT detaithear 1) endwhite finish () stop getReady) output "Enter salesperson ID or ", QUIT, " output salespersoner return to quit " 11 detaithear 1) output "Enter name input salespersenName output "Enter number of bedrooms rented " input numbedreams if numbedreoms. > 3 then SommissionEarned = COMM 3 else if numbedregms 1 then commission = COMM 1 else commission = COMM 4 endif endif endif output sabesleasanth, sadeshersName, semicianEarned output "Enter salesperson ID or ", QUIT, " to quit input salespersents return finish() output "End of report" return Please complete the questions below in this Word document and submit only this document for grading. Do not remove the questions or text that is here. Mark any modifications or additions to the pseudocode or comments by showing them in red. Any flowcharts given are images. Either describe the changes needed or mark them in red using the Word drawing tools. Performing Maintenance In this week's chapters you learned that some of the tasks assigned to new programmers frequently involve maintenancemaking changes to existing programs because of new requirements. Assume that the flowchart below for each question is a separate working program in your organization and that it needs modifications as described in the comments (lines that begin with two slashes) at the beginning of the code. Your job is to alter the pseudocode to meet the new specifications as noted above. 1. // MAINTENANCE03 // Modularize this program ... start // Assume that this program works, but that it needs to be structured and modularized. A No Yes B? E No D? Yes F G Yes Yes H? J? No No K F G 2. // MAINTENANCE04 // Currently, this program displays data for all students. Modity to display only those who have more than 60 credits and have a GPA of at least 3.5. detailLoop() output "Enter credits >> start (housekeepingo) output "Enter student string nane input credits Declarations num credits nun spa string QUIT - "222" output "Enter gpa >> - input na housekeeping input spa return Yes finish nane > QUIT? detail Loop output name." Credits: credits. GPA: ". spa No output "Program finished finish retum "Enter student name or -. QUIT . "to quit >> stop input nane (return Find the Bugs 1. Each code segment below starts with some comments (lines that begin with two slashes) that describe the program. Examine the pseudocode that follows the introductory comments, then find and correct all the bugs as indicated above using red marks. a. // DEBUGO3-01 // This pseudocode is intended to determine whether students have // passed or failed a course; student needs to average 60 or // more on two tests. start Declarations num first test num sesendTest num average num PASSING = 60 while first fest, not equal to O output "Enter first score or 0 to quit input first test output "Enter second score" input sesendTest average = (first test + sesendTest) / 2 quput "Average is ", average if average >= PASSING then output "Pass" else output "Fail" endif endwhite stop b. // DEBUG04-01 // apartment, $75 for renting a two-bedroom apartment, $55 for // renting a one-bedroom apartment, and $30 for renting a studio 11 (zero-bedroom) apartment. Output is the salesperson's // name and ID number and the commission earned on the rental. start Declarations num sedes persones string sedeslersenNams num numbedrooms num COMM 3 = $100.00 num COMM 2 = $75.00 num COMM 1 = $55.00 num COMM STUDIO = $30.00 num QUIT = 9999 Seti Ready) while salespersenth QUIT detaithear 1) endwhite finish () stop getReady) output "Enter salesperson ID or ", QUIT, " output salespersoner return to quit " 11 detaithear 1) output "Enter name input salespersenName output "Enter number of bedrooms rented " input numbedreams if numbedreoms. > 3 then SommissionEarned = COMM 3 else if numbedregms 1 then commission = COMM 1 else commission = COMM 4 endif endif endif output sabesleasanth, sadeshersName, semicianEarned output "Enter salesperson ID or ", QUIT, " to quit input salespersents return finish() output "End of report" return

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Accounting questions