ass 2 itp

.doc

School

Northern Virginia Community College *

*We aren’t endorsed by this school

Course

100

Subject

Computer Science

Date

Nov 24, 2024

Type

doc

Pages

5

Uploaded by Robemaru4

Report
ITP 100 - Designing and desk-checking algorithms 5 A Defining diagram Input Processing Output Prompt for hours, minutes1 12-hour time hours minutes Get hours, minutes Calculate 12-hour time Print 12-hour time B Solution algorithm Convert_24hour_time 1 Prompt for hours, minutes 2 Get hours, minutes 3 DOWHILE (hours, minutes) NOT = 9999 4 IF hours > 12 THEN hours = hours – 12 time = ‘p.m.’ ELSE time = ‘a.m.’ ENDIF 5 Display hours, ‘.’, minutes, time 6 Prompt for hours, minutes 7 Get hours, minutes ENDDO END C Desk checking
i Input data: First data set Second data set Third data set Hours, minutes 1020 2224 9999 ii Expected results: First data set Second data set Third data set 12-hour time 10.20a.m. 9.23p.m
iii Desk check table: Statement Hours Minutes Time 12-hour time DOWHIL First time Get 10 20 DOWHILE True IF a.m. Second time Get 22 24 DOWHILE True IF 10 p.m. Display 10.24p.m. Get 99 99 DOWHILE False ITP 100 - Designing and desk-checking algorithms 6 A Defining diagram Input Processing Output customer_no Name address Postcode Total_amt_owing Read Customer Record Calculate Min_amt_due Print Min_amt_due Customer_no Name address Postcode Total_amt_owing
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
B Solution algorithm Calculate min_amount_due 1 Read customer record 2 DOWHILE more records 3 IF total_amt_owing < $5.00 THEN Min_amount_due = total_amt_owing ELSE Min_amount_due = total_amt_owing /4 IF min_amount_due < $5.00 THEN Min_amount_due = $5.00 ENDIF ENDIF 4 Print customer_no, name, address, 5 Total_amt_owing,min_amount_due 6 Read customer record ENDDO END C Desk checking i Input data: First data set Second data set Customer no 1111 1112 EOF Name John Fhinny Address Boezman Charlestone Postcode 10235 10236 Totsl_amt_owing $25 $4 ii Expected results: First data set Second data set John Boezman 1111 $6.25 Fhinny Charlestone 1112 $4.00
iii Desk check table: Statement Customer no Name Address Total_amount_owing Min_amount_due First record Read 1111 John Boezman $25 DOWHILE IF $6.25 print Yes Yes Yes Yes Yes Second record Read 1112 Fhinny Charlestone $4 DOWHILE IF $4 print Yes Yes Yes Yes Yes Third record Read EOF DOWHILE print