Anda di halaman 1dari 2

Exam : Assignment

Total Marks
:5

DEPARTMENT OF ELECTRICAL ENGINEERING


MILITARY COLLEGE OF SIGNALS, NUST
INTRODUCTION TO PROGRAMMING
TE51 A/B/C/D
Number
: 1/ 3 pages
Due Date
: 04/NOV / 2014

Note:
1. Students are expected to write and test code for correctness before submitting.
2. Students MUST submit the hardcopy to course senior, who will hand over the same
collectively to instructor.
3. Each program MUST have the following block at the start.
**************************************
** ** ************************* ** ** ***
* Programming Assignment :1 *
* Introduction to Programming
* Programmer: ??
* Due Date: Thursday, 2 4 Sep. *
***** ** ** ** ******* ** ** ** ** ** ******
**************************************
In your program, substitute ?? with your own name and * with the current no/date
Question 1. Write a program to display the following output using a single cout statement.
Subject Marks
Mathematics 90
Computer
77
Chemistry
69

Question 2. Write a program which accept principle, rate and time from user and print the simple interest.

Question 3.

Write a program to swap the values of two variables.

Question 4.
accordingly.

Write a program to check whether the given number is even or odd and print message

Page 1 of 2

Question 5.
Write a program to determine whether the seller has made profit or incurred loss. Also
determine how much profit he made or loss he incurred. Cost price and selling price of an item is input by
the user.
Question 6.
Write a program to calculate the monthly telephone bills as per the following rule:
Minimum Rs. 200 for upto 100 calls.
Plus Rs. 0.60 per call for next 50 calls.
Plus Rs. 0.50 per call for next 50 calls.
Plus Rs. 0.40 per call for any call beyond 200 calls.

Question 7.
Any character is entered by the user; write a program to determine whether the character
entered is a capital letter, a small case letter, a digit or a special symbol. The following
table shows the range of ASCII values for various characters.
Characters
AZ
az
09
special symbols

ASCII
Values
65 90
97 122
48 57
0 - 47, 58 64, 91 - 96,
123 127

Page 2 of 2

Anda mungkin juga menyukai