CC1021 Assignment 2
CC1021 Assignment 2
Deadline: Thursday, November 28, 2019 Last Saved by: Mustahsan Hammad Naqvi
Instructions:
1. Type your name and Student ID at the places mentioned Student ID :
2. Save the document with your student ID
a. 19014020001 Ahmad.zip Name:
b. The Zip file must contain files in following format
i. ID_Name_AssignmentNo_QNo.c/cpp Batch:
c. Each File must contain comments
3. Upload your assignment through http://lms.skt.umt.edu.pk Program:
4. No marks would be awarded if
a. Assignment is copied
b. File is corrupt/does not open
c. Submitted through email/in-person
d. Files in ZIP/RAR file are other than .c / .cpp files
DO NOT FORGET TO ADD COMMENTS in the following format at the top of your program
/*
ID 19014020001
Name Ahmad
Study Program BSCS/SE/IT
Assignment No 2
Question No 1 or 2
Program Description This program adds two numbers
Development Environment Dev C++ 4.9.050
Code Last Modified on Date
*/
CC1021 – Programming Fundamentals
Attempt each question. Marks are specified with each question. 25 – Marks
Q 1. Write a C++ program that accepts a number and tells the user whether the number is Even or Odd.
Use constructs learned in the class. 5 Mark(s)
Q 2. Write a program that takes an integer from the user and then displays its corresponding Day of
the Week. E.g. if the user enters 1 it should display Monday, for 2 its Tuesday and so on. If the
value exceeds 7 it should display a message “invalid input” and beep. (do not use switch
statement) 5 Mark(s)
Q 3. A large company pays its salespeople on a commission basis. The salespeople each receive $200
per week plus 9% of their gross sales for that week. For example, a salesperson who sells $5000
worth of chemicals in a week receives $200 plus 9% of $5000, or a total of $650. Develop a C++
program that uses a asks the user about his/her gross sales for last week and calculates and
displays that salesperson’s earnings. 15 Mark(s)