Visual Programming

Only available on StudyMode
  • Download(s) : 57
  • Published : October 9, 2013
Open Document
Text Preview
Riphah International University, Faisalabad

Visual Programming – Assignment 2
Functions and Control Sructures
Instructions for Submission
Submission Guidelines:
• Your code must be properly commented and your code should be neat and nested format. • All the steps involved in solution of each question should be written. Just Answers are not required
• Try NOT to copy paste data from your friends etc.
• This is an individual assignment. PLAGIARISM IS NOT ACCEPTABLE! In case of plagiarism you will get ZERO MARKS for that question
• Please do not copy paste program from your friend.
• Complete the assignment nicely and submit .cpp files on email you can zip all program in one file then submit that file
• Submit files in format like “yourname_yourclass_q1.cpp, yourname_yourclass_q2.cpp”, other file naming convention will not be accepted. • Submit files on uzairsaeed@riphahfsd.edu.pk
• Other questions except program can be solved on Microsoft Word or alike, and plagiarism is 30% with proper reference is allowed only
• Last date of submission 02-October-2013 11:55 pm

Question 1:
Write a function that receives 5 integers and returns the sum and average of these numbers. Call this function from main( ) and print the results in main(). Question 2:
A 5-digit positive integer is entered through the keyboard, write a function to calculate sum of digits of the 5-digit number.
Question 3:
A positive integer is entered through the keyboard and taking input and terminates on sentinel value, write a function primeFactor that take argument of your input number and increment on even, odd or prime. At the end your program should display how many even, odd or prime numbers were entered.

Question 4:
Instructor: Uzair Saeed

1

Riphah International University, Faisalabad
Given N and K write a function to compute the Binomial Coefficient. Pass the value of N and K to the function, calculating Binomial.
[Hint]: Make an additional function of factorial as...
tracking img