Docsity

Temperature Calculation System Assignment for CS201: Introduction to Programming, Exercises of Computer Programming

Toggle sidebar
bg1
Assignment No. 02
Semester: Spring 2012
CS201: Introduction to Programming
Total Marks: 20
Due Date:02/05/2012
Instructions:
Please read the following instructions carefully before submitting
assignment. It should be clear that your assignment will not get any credit
if:
The assignment is submitted after due date.
The submitted assignment does not open or file is corrupt.
Assignment is copied(partial or full)
f
rom any source (websites,
forums, students, etc)
Note: You have to upload only .cpp file.
A
ssignment in any other format
(extension) will not be accepted and will be awarded with zero marks.
F
or
example, if you submit code in .doc (Word document) or .txt files, no reward
will be given in any case.
Objective:
The objective of this assignment is to provide hands on experience of:
Functions
Array Manipulation
Guidelines:
Code should be properly indented and well commented.
Follow C/C++ rules while writing variable names, function names etc
Use only dev-C++ for this assignment.
Use appropriate C/C++ structure i.e. if-
e
lse; switch statement etc to
get inputs from user where required (Marks will be deducted if
inappropriate structure will be used)..
Assignment
docsity.com
pf2

Partial preview of the text

Download Temperature Calculation System Assignment for CS201: Introduction to Programming and more Exercises Computer Programming in PDF only on Docsity!

Assignment No. 02 Semester: Spring 2012 CS201: Introduction to Programming

Total Marks: 20

Due Date:02/05/

Instructions:

Please read the following instructions carefully before submitting

assignment. It should be clear that your assignment will not get any credit

if:

 The assignment is submitted after due date.  The submitted assignment does not open or file is corrupt.  Assignment is copied(partial or full) from any source (websites, forums, students, etc)

Note: You have to upload only .cpp file. Assignment in any other format (extension) will not be accepted and will be awarded with zero marks. For example, if you submit code in .doc (Word document) or .txt files, no reward will be given in any case.

Objective:

The objective of this assignment is to provide hands on experience of:

 Functions  Array Manipulation

Guidelines:

 Code should be properly indented and well commented.  Follow C/C++ rules while writing variable names, function names etc  Use only dev-C++ for this assignment.  Use appropriate C/C++ structure i.e. if-else; switch statement etc to get inputs from user where required (Marks will be deducted if inappropriate structure will be used)..

Assignment

docsity.com

Problem Statement: Temperature Calculation system

Write a program that displays average, highest and lowest temperatures.

Detailed Description:

 The program will take temperature readings as input from user for specified number of consecutive days.  Program will store these temperature values into an array.  Then it will pass this array to three different functions.  One function will return highest temperature, one will return lowest temperature and third one will return average temperature.  All these functions will be called inside main() function where these temperature results will be displayed to the user.

Sample Output:

Enter the number of consecutive days to read their temperature : 5

Enter temperature for day 1: 50

Enter temperature for day 2: 80

Enter temperature for day 3: 30

Enter temperature for day 4: 92

Enter temperature for day 5: 47

The average temperature is 59. The highest temperature is 92. The lowest temperature is 30.

NOTE:

The array containing temperature values must be passed to three different functions to return average, highest and lowest temperatures. Marks will be deducted if assignment is solved with some other technique.

docsity.com