100% found this document useful (1 vote)
424 views

CC103

The document provides a course syllabus for Programming 2 that covers recursive functions, data structures like arrays and linked lists, and file input/output. The semester output involves designing classes for a banking program with savings, checking, and CD accounts. The term output involves analyzing a C++ program that reads and writes data to files.

Uploaded by

Nina Perena
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
424 views

CC103

The document provides a course syllabus for Programming 2 that covers recursive functions, data structures like arrays and linked lists, and file input/output. The semester output involves designing classes for a banking program with savings, checking, and CD accounts. The term output involves analyzing a C++ program that reads and writes data to files.

Uploaded by

Nina Perena
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 12

ASIA PACIFIC COLLEGE OF ADVANCED STUDIES

City of Balanga, Bataan

BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY

COURSE SYLLABUS

COURSE CODE: CC103


COURSE TITLE: PROGRAMMING 2

COURSE DESCRIPTION: The course trains students on the proper and judicious use of recursive code structures, proper parameter passing methods, data structures beyond
primitive types and simple arrays of primitive types, and text files. The course also trains students on how to plan and execute ways to test their
code with respect to common and boundary cases and on how to properly format and document their code with respect to appropriate coding
standards
The coverage of this course extends the topics of programming fundamentals by covering the parameter passing mechanisms of user-defined
functions, definition and applications of recursive functions, specification and implementation of arrays, matrices, records, and linked-lists, and
use of files.
PRE-REQUISITE: CC102
UNITS: 3
CONTACT HOURS PER WEEK: 2 HOURS LECTURE and 3 HOURS LABORATORY

OUTCOMES: On the completion of the course, student is expected to be able to do the following:

GRADUATE OUTCOMES CODE LEARNING OUTCOMES


Understand best practices and standard and their applications LO1 Design, implement and test and debug program based on a given
specification, that uses
Design, implement and evaluate computer based system, processes, (1) Data structure arrays, strings, structures, linked list and files.
components or programs to meet desired needs and requirements under (2) Conditional, iterative and recursive constructs and
(3) Standard libraries in the assigned programming language.

1 | Page
various constraints LO2 Assess and recommend revision to another programmers code
(1) Regarding appropriateness of chosen data structure.
Communicate effectively with the computing community and with society (2) Regarding appropriateness of the chosen conditional iterative
at large about complex computing activities through logical writing, constructs given a programming task and
presentations and clear instructions (3) Regarding thoroughness in applying procedural abstraction
LO3 Argue the cost and benefits of dynamic and static data structure
implementations.
LO4 Integrate Learning Management System in communication and submission
of the projects and outputs.

SEMESTRAL OUTPUT: Bank Account Program


Bank offers various types of accounts, such as savings, checking, certificate of deposits and money market, to attract customers as well as meeting with the specific needs. Two of
the commonly used accounts are savings and checking. Each of these accounts has various options.
For example you may have a savings account that requires no minimum balance but has a lower interest rate. Similarly you may have a checking account that limits the number of
check you may write. Another type of account that is used to save money for long term is certificate of deposits (CD).
In this programming exercise, you may use abstract classes and pure virtual function to design classes to manipulate various types of account.
For simplicity, assume that the back offers three (3) types of accounts: savings, checking, and certificate of deposit
SAVINGS ACCOUNTS: Suppose that the bank offers two (2) types of savings account:
One that has no minimum balance and a lower interest rate and
Another that requires a minimum balance and has a higher interest rate
CHECKING ACCOUNTS: Suppose that the bank offers three (3) types of checking account:
One with a monthly service charge, limited check writing, no minimum balance and no interest,
Another with no monthly service charge, a minimum balance requirement, unlimited check writing and lower interest, and
Third with no monthly service charge, a higher minimum requirement, a higher interest rate and unlimited check writing.
CERTIFICATE OF DEPOSIT (CD): In an account of this type, money is left for some time, and these account draw higher interest rates than savings or checking account. Suppose
that you purchase a CD for six months. Then we say that the CD will mature in six months. Penalty for early withdrawal is stiff:
Figure 14-22 shows the inheritance hierarchy of these bank accounts.
bankAccount

certificateofDeposit
checkingAccount savingAccount

serviceChargeChecking
noChargeChecking
highInterestsSavings
2 | Page

highInterestChecking
Note that the classes bankAccount and checkingAccount are abstract. That is we cannot instantiate object of these classes. The other class in figure 14-22 are not abstract.
C++ Programming Problem Analysis to Program Design
D.S Malik Programming Exercises No. 5 Page 799 - 781

TERM OUTPUT:

PRELIM: Consider the following C++ program:

#include <iostream>
(

)
a. Write a statement that includes header file fstream, string and iomanip in this program
b. Write statement that declares inFile to be an ifstream, variable and outfile to be an ofstream variable
c. The program will read data from the file inData.txt and write output to the outData.txt. Write statements to open both of these files, associate inFile with inData.txt and
associate output file with outdata.txt.
d. Suppose that the file in inData.txt contains the following data:
10.20 5.35
15.6
Randy Gill 31
18500 3.5
A
The number in the first line represent the length and width, respectively, of a rectangular. The number on the second line represent the radius of a circle. The 3 rd line
contains the first name, last name and age of the person. The fourth line is the savings account balance at the beginning of the month, and the second number is the interest
rate per year. (Assume thatp =3.1416) and the fifth line contains an upper case letter between A and Y (Inclusive).
Write statements so that after the program executes, the content of the file outData.txt are as shown below. If necessary, declare additional variables. You statement should
be general enough so that if the content of the output file of the input file changes and the program is run again (without editing and recompiling), it outputs the appropriate
results.
Rectangle:
Length = 10.20,
Width = 5.35,
Area = 54.57,

3 | Page
Parameter = 31.10
Circle:
Radius = 15.60,
Area = 764.54
Circumference = 98.02
Name: Randy Gill, Age: 31
Beginning Balance = 18500.00, Interest Rate = 3.50
Balance at the end of the month = 18553.00
The character that comes after A in the ASCII set is B.
e. Write statements that close the input and output files.
f. Write a C++ program that test the statements in part a through e.

MIDTERM: Program Development and evaluation


1. Write a program that prompts the user to input an integer and then outputs both the individual digits of the number and the sum of the digits.
For example: it should out the individual digits of 3456 as 3 4 5 6
Output the individual digits of 8030 as 8 0 3 0
Output the individual digit of 2345526 as 2 3 4 5 5 2 6
Output the individual digit of 4000 as 4 0 0 0
and Output the individual digit of -2345 as 2 3 4 5
2. The program Telephone Digits outputs only telephone digits that correspond to uppercase letters, REWRITE the program so that it process both upper case and lowercase
letters and outputs the corresponding telephone digits.
If the input is something other than an uppercase or lowercase letter, the program must output an appropriate error message.
3. To make telephone number easier to remember, some companies uses letter to show their telephone number.
For example, using letters, the telephone number 438 5626 can be shown as GET LOAN,
in some cases, to make telephone number meaningful, companies might use more than seven letters. For example, 225 5466 can be displayed as CALL HOME, which
uses 8 letters.
Write a program that prompts the user to enter a telephone number expressed in letters and outputs the corresponding telephone number in digits.
If the user enters more than seven letters. Also outputs the (hyphen) after the third digit.
Allow the user to use both uppercase the lowercase letter as well as spaces between words, more over your program should process as many telephone number as the user
wants
C++ Programming Problem Analysis to Program Design
D.S Malik Programming Exercises No. 1, 4, and 5 Page 295

FINALS: Programming Exercises

4 | Page
1. Write a program that converts a number entered in ROMAN NUMERALS to DECIMAL. Your program should consist of a class, say romanType. An object to type
romanType should do the following:
a. Store the number as a Roman Numeral
b. Convert and store number into decimal form
c. Print the number as a Roman numeral cr decimal number as requested by the user.
The decimal values of the Roman numeral number are:
M 1000
D 500
C 100
L 50
X 10
V 5
I 1
d. Test your program using the following Roman numerals: MCXI, CCCLIX, MDCLXVI
2. Design and implement a class dayType that implements the day of the week in a program. The class dayType should store the day, such as Sun for Sunday. The program
should be able to perform the following operations on an object of type dayType:
a. Set the day
b. Print the day
c. Return the day
d. Return the next day
e. Return the previous day
f. Calculate and return the day by adding certain days to the current day.
For example if the current day is Monday and we add 4 days, the day to be returned is Friday. Similarly if today is Tuesday and we add 13 days the day to be returned
is Monday.
g. Add the appropriate constructors.
C++ Programming Problem Analysis to Program Design
D.S Malik Page 657 No. 1, 2

GRADING SYSTEM:

Lecture (40%) Laboratory (60%)


Major Exam 40% Laboratory Activity 25%
Quizzes 25% Major Course Output 20%

5 | Page
Assignment 20% Term Output 20%
Class Participation 15% Laboratory Exam 35%
100% 100%

FINAL GRADE
Prelim Grade + Midterm Grade + Final Grade 70%
Comprehensive Exam 15%
Semestral Output 15%
100%
COURSE OUTLINE:

MAJOR
SPECIFIC
LEARNING COURSE
WEEK LEARNING LEARNING LEARNING
OUTCOME OUTPUT TOPICS TA ASSESSMENT REFERENCES
# OUTCOME OUTPUT ACTIVITIES
(LO) (MCO)
(SLO)
Course 2 Discussion
1 Orientation Hours
Discuss the rules
and regulations
Discuss the
different expected
output
Discuss the
Grading System

6 | Page
MCO1: Design Examine High Explore how C+ The Language of a 2 Lecture Quiz C++ Programming
an algorithm Level program processed computer Hours Discussion Programming Problem Analysis
2 LO1 that does the Programming Become aware of a The evolution of Program Exercises to Program Design
following Languages structure design programming Simulation D.S Malik
Page 38. No. Discover what a and object oriented languages Page 21 36
22 - 23 compiler is and design Processing a C++ Program Hands On
what is does programming program Exercises Examination
methodologies Programming with 3
the Problem Analysis Hours
Coding Execution
Cycle
Programming
Methodologies
ANSI/ISO Standard
C++
MCO2: Explore simple Create a program Basic elements of C+ 2 Lecture Quiz C++ Programming
Convert Length datatypes that convert + Hours Discussion Programming Problem Analysis
3 LO1 (Page 94) Examines how number into string A C++ program Program Exercises to Program Design
program evaluate using string data Data types Simulation D.S Malik
arithmetic types Arithmetic Operation 3 Page 39 59
operations and Operator Hours Program Hands On
Precedence Exercises Examination
- Expression
Type of conversion
(casting)
String type
Input
MCO3: Make Examine ways to Write a program Increment and 2 Lecture Quiz C++ Programming
Change output results with arithmetic Decrement Operators Hours Discussion Programming Problem Analysis
4 LO2 (Page 97) using output operators - Output Program Exercises to Program Design
statements Debug a program Preprocessor Simulation D.S Malik
syntax error Directives Hands On Page 39 59

7 | Page
Debugging: Examination
Understanding and
fixing program errors
Program style an
forms
More on assignment
statement
MCO4: Identify and Discover how to Increment and 2 Lecture Quiz C++ Programming
Convert Length become familiar input data into Decrement Operators Hours Discussion Programming Problem Analysis
4 LO2, LO4 (Page 94) with the use of memory using - Output Program Exercises to Program Design
Make Change increment and input and output Preprocessor Simulation D.S Malik
(Page 97) decrement statements Directives Hands On Page 72 97
operators Debugging: Examination
Understanding and
fixing program errors
Program style an
forms
More on assignment
statement

6 PRELIMINARY EXAMINATION

MCO5: What Learn about Create programs Control Structure Lecture Quiz C++ Programming
is the output of control structure using control (Selection) Discussion Programming Problem Analysis
7 LO3 the following Examine selection structure - Control Program Exercises to Program Design
program? relational and (if, if else and Structures Simulation D.S Malik
Page 222 No. 9 logical operators switch in a Relational Operators 3 Page 169 181
program) and learn Logical Boolean Hours Program Hands On
how to avoid bugs operators and Logical Exercises Examination
by avoiding expression

8 | Page
3 Program
Hours Exercises

partially Selection: if and if


understood else
concepts
And use assert
MCO6: Develop, test and Write an algorithm Using Pseudocode to 2 Lecture Quiz C++ Programming
Compare debug a program on a given develop, test and Hours Discussion Recitation Problem Analysis
Numbers using Pseudocode program debug a program Program Laboratory to Program Design
8 LO2 Create a Switch structure Simulation Activity D.S Malik
program that Terminating a Page 202 - 228
compares two program with the
integers and assert function
output the
largest
Page 203
MCO7: Debug Learn about Perform debug Control Structure 2 Lecture Quiz C++ Programming
a program with repetition loops (Repetition) Hours Discussion Recitation Problem Analysis
Looping (looping) control Learn how to Why is repetition Program Laboratory to Program Design
9 LO2 structure structure avoid bugs by needed Simulation Activity D.S Malik
Explore how to avoiding patches While Looping Page 234 272
construct and use (Repetition Structure)
counter- For Looping
controlled, Structure
sentinel- Break and Continue
controlled, flag- Statements
controlled and
EOF-control
repetition
structures

9 | Page
MCO8:Create Examines various Explore ways to Records (structs) 2 Lecture Quiz C++ Programming
a program operation on a manipulate data Programming Hours Discussion Recitation Problem Analysis
using an array struct using struct example: Sales Data Program Laboratory to Program Design
10 LO3, LO4 of struct items Analysis Simulation Activity D.S Malik
3 Program 562- 592
Hours Exercises

11 MIDTERM EXAMINATION

MCO9: Largest Learn about user- Create a program User defined 2 Lecture Quiz C++ Programming
Number defined functions using user defined functions Hours Discussion Recitation Problem Analysis
12 LO1, LO4 Page 320 and examine functions. - Predefined Program Laboratory to Program Design
value-returning functions Simulation Activity D.S Malik
Cable functions, - Value returning Page 302 305
Company including actual functions Page 338 356
Page 322 and formal Void Functions
parameters Value Parameters
- Reference value
as parameters
- Value and
reference
parameters and
memory
allocation
Reference parameter
and value returning
functions
Scope of an identifier
MCO10: Explore how Create a program Classes and data 2 Lecture Quiz C++ Programming
Candy information using OOD abstraction Hours Discussion Recitation Problem Analysis
13 LO2 Machine hiding is A struct versus a Program Laboratory to Program Design

10 | P a g e
Input: The item implemented in class 3 Simulation Activity D.S Malik
selection and C++ Information hiding Hours Page 595 - 661
the cost of the Examine Executable code
item constructors and Static members of a
Output: The destruction class
selected item
Page 637
Complete
Program listing
Page 644
649
MCO11: Become familiar Examine how the Inheritance and 2 Lecture Quiz C++ Programming
Create a with the 3 basic constructor of base compositions Hours Discussion Recitation Problem Analysis
14 LO2 program using principles of and derived classes Object oriented Program Laboratory to Program Design
pointer, 2 object oriented works, and design and object Simulation Activity D.S Malik
dimensional design redefine the oriented 3 Page 661 711
array And explore 3 member function programming Hours
Page 776 No. types on of a base class
22 (a d) inheritance:
PUBLIC,
PROTECTED
AND PRIVATE
Examine the Discover the Pointer, classes, 2 Lecture Quiz C++ Programming
relationship peculiarities of virtual function and Hours Discussion Recitation Problem Analysis
15 LO2 between the classes with abstract classes Program Laboratory to Program Design
address of pointer member - Address of Simulation Activity D.S Malik
operator and variables, explore operator (&) 3 Page 722 - 753
classes and use the NEW, - Dereferencing Hours Program
Become aware of DELETE operators Operator (*) Exercises
abstract classes to manipulate - Initializing
dynamic variables. pointer variables
- Classes and
Learn about the

11 | P a g e
pointer data type pointers
and pointer - Address and
variables operator classes
16 FINAL EXAMINATION

REFERENCE:

C++ Programming Problem Analysis to Program Design


D.S Malik

Prepared by: Noted by: Checked by:

_____________________ _____________________ _____________________

Nina B. Perena Kristin Dyan E. Ayangco Jennyfer N. Mendoza


Instructor Dean CPDO Director

Approved by:
_____________________ _____________________
Gigi Sunga Flocerfida E. Ayangco
Head, Academic Affairs School President

12 | P a g e

You might also like