0% found this document useful (0 votes)
55 views

Asm 04

This document provides instructions for Assignment 04 in PRF192. It outlines the software requirements, instructions to download materials and submit assignments, and provides 4 questions to answer. For each question, students are given a C file with some code and asked to write additional statements without editing the main function. They must submit their work by creating appropriately named folders containing the source and executable files for each question. Attention to formatting of files, folders and outputs is important for grading.
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)
55 views

Asm 04

This document provides instructions for Assignment 04 in PRF192. It outlines the software requirements, instructions to download materials and submit assignments, and provides 4 questions to answer. For each question, students are given a C file with some code and asked to write additional statements without editing the main function. They must submit their work by creating appropriately named folders containing the source and executable files for each question. Attention to formatting of files, folders and outputs is important for grading.
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/ 3

ASSIGNMENT 04 – PRF192

Duration: 90’
=====================================================================================
Software Requirements
• Dev C++ 5.11, NotePad, Command Prompt, WinRAR / WinZip with Windows Explorer
(File Explorer) on Windows 7 and above.
Instructions
• Step 1: Students download the given materials from LMS.
• Step 2: Students read questions and prepare answers in the given template.
• Step 3: Prepare to submit the answer:
o For each question (e.g., question Q1, Q2, Q3,…), please create two sub-folders: run and
src.
o Copy the *.exe file into the run folder, and the *.c file into the src folder.
• Step 4: Submit a solution for each question:
o Create a folder formatted: RollNumber_FullName_ASMxx (xx: 01, 02,..) that contains
folders (created Step 03 ) as the below figure:

o Use WinRAR / WinZip tool to compress the RollNumber_FullName_ASMxx folder and


submit it to LMS
❖ Importance:
o Do not change the names of the folders, files, and struct (format) of .c files specified in the
assignment. If you change it, the grading software can not find the execute file (.exe) or the output
results to score, thus the mark will be 0
o Do not edit given statements in the main function. If you change, the grading software can not
score and the mark will be 0.
=====================================================================================

Question 1: (2 marks)

The given file Q1.c already contains statements to input data for the integer 1-D array. You should write
statements to print the average of odd numbers in even places in the array.
Notes:
- Do not edit given statements in the main function
- You can create new functions if you see it is necessary.
- The output result is formatted in two decimal places
Sample input and output:
Input: n = 6
Array: 1 3 7 4 9 11
After processing: (1+7+9) / 3 = 5.67
Output for marking:
OUTPUT:
5.67

Question 2: (3 marks)

The given file Q2.c already contains statements to input data for the integer 1-D array. You should write
statements to count the number of occurrences of the smallest elements in the array
Notes:
- Do not edit given statements in the main function.
- You can create new functions if you see it is necessary.
Sample input and output:
Input: n = 9
Array: 1 3 1 4 2 7 8 1 9
After processing: 3
Output for marking:
OUTPUT:
3

Question 3: (2 marks)

The given file Q3.c already contains statements to input data for the integer 1-D array and an integer
variable named x. You should write statements to print the average of all the elements are prime greater
than x ( the primes start from 2)
Notes:
- Do not edit given statements in the main function.
- You can create new functions if you see it is necessary.
- The output result is formatted in two decimal places
Sample input and output:
Input: n = 9
Array: 1 3 5 4 2 7 8 11 9
Input: x = 3
After processing: (5 + 7 + 11) / 3 = 23/3 = 7.67
Output for marking:
OUTPUT:
7.67

Question 4: (3 marks)

The given file Q4.c already contains statements to input data for the integer 1-D array. You should write
statements to print the sum of the largest and smallest elements in the array.
Notes:
- Do not edit given statements in the main function.
- You can create new functions if you see it is necessary.
- The output result is formatted in two decimal places
Sample input and output:

Input: n = 10
Array: 2 3 5 4 2 7 8 11 9 11
After processing: (2 + 2 + 11 + 11) = 26
Output for marking:
OUTPUT:
26

You might also like