Question
DECLARE const char part1[] = Dear DECLARE const char part2[] = Our records show that your account has a balance of $ DECLARE
DECLARE const char part1[] = "Dear "
DECLARE const char part2[] = "Our records show that your account has a"
" balance of $"
DECLARE const char part3[] = " and a past due amount of $"
DECLARE const char part4[] = " Your last payment was on "
DECLARE const char part5[] = " Please pay the past-due amount as soon as possible. "
DECLARE const char part6[] = "Please ignore this letter if you have already sent payment. "
DECLARE const char part7[] = "Sincerely, "
DECLARE const char part8[] = "Blue Star Electric"
DECLARE const int MAX = 80 //line size
void printLetter(char firstName[100], char lastName[100], char lastPayment[100], char balance[100], char pastDue[100])
DECLARE int position = 0
CALL position = printLine(position, part1)
CALL position = printLine(position, firstName)
CALL position = printLine(position, " ")
CALL position = printLine(position, lastName)
CALL position = printLine(position, ": ")
CALL position = printLine(position, part2)
CALL position = printLine(position, balance)
CALL position = printLine(position, part3)
CALL position = printLine(position, pastDue)
CALL position = printLine(position, part4)
CALL position = printLine(position, lastPayment)
CALL position = printLine(position, part5)
CALL position = printLine(position, part6)
CALL position = printLine(position, part7)
CALL position = printLine(position, part8)
END Function printLetter
void getInfo(char firstName[100], char lastName[100], char lastPayment[100], char balance[100], char pastDue[100])
DISPLAY"Enter first name: "
INPUT firstName
DISPLAY"Enter last name: "
INPUT lastName
DISPLAY"Enter last payment: "
INPUT lastPayment
DISPLAY"Enter balance: "
INPUT balance
DISPLAY"Enter past due amount: "
INPUT pastDue
END FUNCITON getInfo
int printLine(int position, const char line[])
loop for i=0 to line.length
DISPLAY line[i]
INCREMENT position
if position >= MAX THEN
DISPLAY NEWLINE
SET position = 0
END IF
END LOOP
return position
END FUNCTON printLine
int main()
DECLARE char firstName[100]
DECLARE char lastName[100]
DECLARE char lastPayment[100]
DECLARE char balance [100]
DECLARE char pastDue[100]
DECLARE char again
DECLARE int position
CALL getInfo(firstName, lastName, lastPayment, balance, pastDue)
CALL printLetter(firstName, lastName, lastPayment, balance, pastDue)
END FUNCTION main
Question???
How to draw a flowchart using a simple shape to represent each function.
- Include what information each function will gather or product
- Identify what relationship, if any, exists between functions.
Step by Step Solution
3.28 Rating (151 Votes )
There are 3 Steps involved in it
Step: 1
Introduction Flowcharts are graphical representations of a process or algorithm depicting the sequence of steps and decision points involved In the pr...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started