Professional Documents
Culture Documents
JANUARY 2024
Instructions:
1. The total marks for Assignment 1 is 100 and contributes 50% to the total grade.
2. Assignment 1 covers the topics in Unit 1 and Unit 2.
3. Submit your Assignment to the Online Assignment Submission system. Submission
of assignments in hard copy will not be accepted. Marks will be awarded for quality
content and presentation.
4. Times New Roman 12 pt font should be used for all writing. Answer all questions in
English.
5. Students would be required to attach the CA Declaration form as the front cover of
their Assignment. No duplication of work will be tolerated. Any plagiarism or
collusion may result in disciplinary action to all parties involved.
6. Please check WawasanLearn for submission deadline.
1
TCC238/05 –Structured Programming
1. Compile and test all codes before submitting to ensure that they are error free.
2. Provide the necessary comments in your source codes.
3. Include both codes and sample outputs (e.g. screen shots) in your answer script, i.e.
Word document. Additionally, attach also the original source codes (e.g. *.cfiles) in
the final zipped file for submission.
4. Note the differences between the codes for a complete C program and C function:
• C program comprises all codes needed for compilation and execution of a
runnable system. A complete C program can include multiple functions and
function calls. Modularity makes the entire program more readable and easier to
debug. You should always strive to modularize your codes.
• A C function on the other hand is limited to the implementation of
procedure/method performing a specific task.
5. Hence, read each question's requirements properly in order to avoid losing marks
unnecessarily.
2
TCC238/05 –Structured Programming
b) Write a C program to categorize the grades of oranges based on the table given
below:
c) What are the primary differences between symbolic and high-level languages?
[10 marks]
3
TCC238/05 –Structured Programming
a) Write a program that generates a random number from the following set:
1, 4, 7, 10, 13, 16
[15 marks]
b) Write a function to print your name, as shown below. Write a call as it would be
coded in a calling function, such as main.
[15 marks]
c) Write a function that receives a positive floating-point number and rounds it to two
decimal places. For example, 127.565031 rounds to 127.570000. Print the rounder
numbers to six decimal places.
[10 marks]