Introduction
SECJ1013 Programming Technique I is a course introduced students to the theory and practice on problem-solving techniques by using a structured approach. This course also introduced students to the basic programming knowledge and skills such as data types, control structures, array and structured data types by using C++ programming language.
There is a total of 8 chapters in this course. The 8 chapters are "Programming Problem-Solving", "Elementary Programming", "Control Structures", "Function", "Array", "Input & Output", "Pointers" and "Structered Data".
TimeLine
List of Labs
Lab 1
Lab 1 is an assignment that required students to draw a flowchart to calculate and display the sum of the square of 11 numbers. Print "low" if the sum is less than 70 and print "high" if the sum is more or equal than 70.
Lab 2
Lab 2 is an assignment that required students to translate a flowchart into a C++ program using an appropriate loop statement. The while and switch statements are used in this lab.
Lab 2 Resource File Download
-
Download Lab2.cpp
Lab2.cpp Details
- Wednesday, 03 February 2021 [567 B]
Lab 3
Lab 3 is an assignment that required students to create a C++ program which is able to hold a 3 x 3 array and receive input for the array from the user. Next, the program will display all the elements in the array and calculate and display the sum of the square of all major diagonal elements.
Lab 3 Resource File Download
-
Download Lab3.cpp
Lab3.cpp Details
- Wednesday, 03 February 2021 [1.3KB]
Lab 4
Lab 4 is an assignment that required students to create a C++ program which is able read students' information such as name and score from input file and determine whether the student passed or failed based on the input. Next, the program will calculate the average marks of all students and create an output file with students' information, whether they passed or failed and the average marks of all students.
Lab 4 Resource Files Download
-
Download inputdata.txt
inputdata.txt Details
- Wednesday, 03 February 2021 [58 B] -
Download Lab4.cpp
Lab4.cpp Details
- Wednesday, 03 February 2021 [1.1KB]
Lab 5
Lab 5 is an assignment that required students to create a C++ program that can receive the information about the brand name, price and expired date of 4 milks from user. Data type struct is required in the process of programming the code. The program will calculate the average of milk price and display the milk's information and the average of milk price.
Lab 5 Resource File Download
-
Download Lab5.cpp
Lab5.cpp Details
- Wednesday, 03 February 2021 [1.2KB]
List of Assignments
Assignment 1
Assignment 1 is an assignment that required students to write a pseudocode and flowchart for a program that will receive the information on nutrient amount is in one serving of a food and the amount of nutrients recommended per day for individuals 4 years of age and older. Next, the program will calculate the % Daily Value of the food product, in which the nutrient amount in the food divided by total daily recommended value and multiply by 100. After that, the program will display either “The amount of this nutrient is low in this product”, “The amount of this nutrient is moderate in this product” or “The amount of this nutrient is high in this product” based on the calculated %DV value. (5% DV or less is low, 20% DV or more is high, while the rest is moderate). The number of products to be checked is 31.
Assignment 2
Assignment 2 is an assignment that required students to write a program that will receive the information on nutrient amount is in one serving of a food and the amount of nutrients recommended per day for individuals 4 years of age and older. Next, the program will calculate the % Daily Value of the food product, in which the nutrient amount in the food divided by total daily recommended value and multiply by 100. After that, the program will display either “The amount of this nutrient is low in this product”, “The amount of this nutrient is moderate in this product” or “The amount of this nutrient is high in this product” based on the calculated %DV value. (5% DV or less is low, 20% DV or more is high, while the rest is moderate). However, the number of food product to be check is unlimited and only stop the program when the user wants to end the program. Therefore, the program also provide a mechanism to control the loop of reading input from user.
Assignment 2 Resource File Download
-
Download Assignment 2.cpp
Assignment 2.cpp Details
- Wednesday, 03 February 2021 [1.6KB]
Assignment 3 & Assignment 4
Assignment 3 & Assignment 4 is an assignment that combine two of the chapters, in which are array and input & output. This assignment required students to write a complete C++ program to grade an exam where the exam consists of 7 short answer questions. This program will read the students' answers and the correct answers from files and prints out the result onto the output file. The number of student will be less than or equal to 40. The students' answers input file is named "StudentAnswers.txt". This file contains the information of students such as name, ID and their answers to respective questions. The student's answer are considered correct if the round of the student's answer is equal to the round of the correct answer. Next, the program will calculate the percentage of questions answered correctly by the student and display the grade as follow:
- 80 ≤ percentage ≤ 100 - grade is A
- 65 ≤ percentage < 80 - grade is B
- 50 ≤ percentage < 65 - grade is C
- percentage < 50 – grade is F
After calculate the percentage and grade of all students, the program will create an output file which display all students' name, students' ID, students' percentage and students' grade. Besides, the program will also calculate the average percentage and average grade of all students and record the name of students who get grade A. The average percentage and average grade as well as the list of students who get grade A will also be in the output file.
Reflection
I had learnt a lot about programming knowledge and skills in C++ programming language through this course, but the most important thing that I learned is the basic concept of programming that can also be used when using other programming languages such as data types, control structures, loop, and array. I had the opportunities to train myself in programming through the labs and assignments given by this course and most of these assignments is related to a real-world situation which required me to think and design a functional program that can solve the problems. These experiences will help me to build a more efficient code in the future. Besides, this course also provided me with the opportunities to debug a program where syntax and logic errors exist. These experiences will help me to identify the problems of the program and think of a way to solve the problems. Furthermore, these experiences can help me to reduce errors during coding to minimize the time required for coding a program.