1090C Computer Programming I Lab 1 - Flow Charts and Pseudo Code SPRING 2020 10 Pts / 2 Extra Pts
1090C Computer Programming I Lab 1 - Flow Charts and Pseudo Code SPRING 2020 10 Pts / 2 Extra Pts
Labs are never about getting done… They are about learning.
I often will include a short mini-lecture at the start of the lab directions. This is designed to
focus your attention on the learning goals for the lab and often provides you with specific
technical details you will practice directly in the lab session.
Mini-lecture:
We use pseudo code and flow charts to capture the logic of a program prior to implementing it
with code. In general practice, flow charts are too cumbersome for large programs/systems and
so they are mainly used for isolated sub-routines, and high-level architectural patterns, etc.
We use pseudo code all the time. The pseudo code outline we write initially becomes the
documentation for the completed program. To code the program, we go through and write the
program code that corresponds to the pseudo code outline. The outline then becomes the
program comments that document the code.
Students rarely believe me initially when I mention that the important part of this process is the
generation of the pseudo code outline. Generating the code that corresponds to the outline is
trivial and simply a matter of practice with the language syntax. If the pseudo code outline is
incorrect then the program code will not correctly solve the task. Instead of trying to “write the
program out of your head” as it were, take the time to create a solid and logically clear pseudo
code outline before you begin coding.
Common flowchart symbols:
Lines (Arrows) show the flow
Input symbols (parallelograms)
Processing symbols (rectangles)
Output symbols (parallelograms)
Terminal symbols (lozenges – flattened ovals)
Decision symbols (diamonds)
Start
input favNumber
doubleFun = favNumber * 2
End
Always include the prompt in your pseudo code and flowcharts when you do input.
Output should always be in the form of a complete sentence, not just a raw calculated
value. i.e. The total calculated building costs is: $560.00.
Example:
start
output “What is your favorite number?”
input favNumber
doubleFun = favNumber * 2
ouput “Double your fun is “ + doubleFun
stop
Lab:
1. Insert your work for the completed lab here within this MS Word document and
submit it as directed at the end of the document.
start
input yourPurchase
end
Input rectangleHeight
Input rectanlgeWidth
rectangleArea = rectangleHeight *
rectangleWidth
input winterCost
input springCost
input startingNumber
input subtractNumber
finalNumber = startingNumber -
subtractNumber
input creditCardBalance
a. Task 1 (2 pts): a program where the user enters the price of a purchase
and the program computes and outputs a 5% sales tax. Don’t forget the
prompt!
b. Task 2 (2 pts): A program for calculating the area in square feet. (User
will input the height and the width in feet.)
c. Task 3 (3 pts): A program that asks the user to enter home maintenance
costs for each of the four seasons and returns the total yearly
maintenance costs. (Separate prompt and input for each input value!)
e. Task 5 (2 pts Extra Credit): A program where the user enters a credit
card balance and the program calculates the interest at a rate of 17%
monthly. Assume the user does not make any payment. Display the
interest due after one month and again after two months.
You need to follow directions and develop professional work habits. I’m very
specific about how I want the work submitted especially with the naming and the
format of files so they can be tracked efficiently. If you can’t or won’t follow
directions, you work will not be graded and you receive no credit.