0% found this document useful (0 votes)
35 views4 pages

Program 1: Assignment 1 TDB 2073 Chemical Engineering Group

This document outlines an assignment for a chemical engineering group. It describes 3 programs that students must write: Program 1 displays half or full pyramids based on student ID, Program 2 calculates totals and averages of user-entered numbers using a sentinel value, and Program 3 determines a user's birth state based on their Malaysian ID number. The programs must be named and compressed into a zip file for submission by August 17th, 2015.

Uploaded by

Liew Wen Xuan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views4 pages

Program 1: Assignment 1 TDB 2073 Chemical Engineering Group

This document outlines an assignment for a chemical engineering group. It describes 3 programs that students must write: Program 1 displays half or full pyramids based on student ID, Program 2 calculates totals and averages of user-entered numbers using a sentinel value, and Program 3 determines a user's birth state based on their Malaysian ID number. The programs must be named and compressed into a zip file for submission by August 17th, 2015.

Uploaded by

Liew Wen Xuan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Assignment 1 TDB 2073 Chemical Engineering Group

Introduction
You are required to write three programs:_ Program 1, Program 2 and Program 3.

Program 1
Write a flowchart and a program that displays a half pyramid.

For student ID with ODD last digit, e.g. 19111, 19001, 20121 etc, the output displayed should be
similar to Figure 1

Figure 1

For student ID with EVEN last digit, e.g. 19112, 19002, 20124 etc, the output displayed should
be similar to Figure 2.

Figure 2

Assignment 1 TDB 2073 Chemical Engineering Group

Program 2
Use SENTINEL to write a program that calculates the total and average of undetermined series
of numbers. The user enters a series of numbers and finally a sentinel value (e.g. 999). Having
entered the sentinel value, the program will instantly calculate the sum and the average of the
numbers. Sample output is as in Figure 3

Figure 3

Assignment 1 TDB 2073 Chemical Engineering Group

Program 3
Program 3 determines the birth state of the user based on his or her Malaysian Identity Card
(IC) number. For example, if a user enters 12-digit IC number 120488145667, the program will
extract the 7th and 8th digits, i.e. 14. It refers to the state codes in Figure 4 and displays
Wilayah Persekutuan as the birth place of the user.

Figure 4

A sample output is shown in Figure 5.

Figure 5

Assignment 1 TDB 2073 Chemical Engineering Group

Submission
You are required to name the programs as follows:

Program 1

studentIDnumber_halfpyramid.cpp

Program 2

studentIDnumber_sentinel.cpp

Program 3

studentIDnumber_statecode.cpp

Compress all three files in a zip file. Name the zip file as follows:
studentIDnumber_CE_Assignment1.zip

Due date for the submission is Monday


to be done through e-learning.

17 August 2015 before 5pm. Submission is

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy