Course Title Course Code Lab Work No Learning Objectives
Course Title Course Code Lab Work No Learning Objectives
COURSE CODE
ICT1101
LAB WORK NO
LEARNING OBJECTIVES
Introduce to students Decision Logic Structure.
LEARNING OUTCOME
Students should able to prepare the tools: PAC, Structure Chart, IPO Chart, algorithm and
flowchart for single IF-THEN and IF-THEN-ELSE instruction.
You should present your solution in PAC, Structure Chart, IPO Chart, algorithm, flowchart, data
dictionary and C++ coding for the following exercises.
DESCRIPTION OF THE LAB SESSION
Tutorial 1
This program accepts string from the keyboard and decide if the username correctly matched the
owners name. If its not matched, display an error message.
Save it as Week7Tutorial_1.cpp
Tutorial 2
Write a program that asks the user to enter two integers, and then perform mathematical
operation based on users decision. The decision must be a single character input. It should
handle 5 operation: add, subtraction, multiplication, division and power of 2. For every operation,
it should display the result, and if theres invalid input; an error message Invalid user input
should appear.
(i)
You must use if-then-else statement.
(ii)
Make sure the program also works if the user enter small OR capital letter.
Save it as Week7Tutorial_2.cpp
Sample output
Exercise 1
Write a program to handle a savings-account withdrawal. The program should request the current
balance and the amount of the withdrawal as input and then display the new balance. If the
withdrawal is greater than the original balance, the program should display Withdrawal denied;
otherwise calculate and display the new balance.
Present your solution in (with MS Word save as Balance.docx and CPP file as Week7Ex1.cpp):
a) PAC
b) Structure Chart
c) IPO chart
d) Algorithm
e) Flowchart
f) Data dictionary.
Sample Output
have to prepare the diagram. I would suggest for all to try and do this. Ill post the answer in
content Week 8.
Save it as Week7Ex2.cpp
******************************************************************************
(i)
From the question above, modify the program; so it should accept input for check
balance, deposit more money and withdraw money from their bank. For every decision
from user, it should display the current balance available.
Sample output
Deadline: Submit your work on Thursday 8th September 2015 before 17:00:00 GMT +8