Programming Fundamentals
Assignment 4
Due Date: 25 Feb 2021.
Total marks 60
Note: Do not copy code from internet or any other source even across the sections. I will check the
plagiarism of the assignment and it will capture the cheated code from internet or copied from class fellows.
Those who will try they will get some marks for their effort even you do not get perfect solution. Copied
& Shared work will score in negative grading. Assignment should be in visual Studio. You will copy all
the code to word file and send it on LMS. Word file should be renamed with your roll number. After
submission, no excuse will be entertained. No assignment will be accepted after due date.
Q1. 0, 1, 1, 2, 3, 5, 8, 13… are the Fibonacci numbers series as we learnt in the class. Write a
C++program that takes/declares an array with the name fibnum[80] with 80 size and start
filling it with the first 80 Fibonacci series. Now declare another fibar[80] which will copy
those elements from fibnum[] which are multiple of 5 and count of the total numbers which
are multiple of 5. Display first array completely and display fibar[] according to the size of
the count only. 5
Clue: First, enter two numbers 0 and 1 manually in the array and then calculate the remaining
numbers using the loop.
Q2.Write a C program that that takes as input two integers arrays hours worked and pay rate of 5
employees and display each employee gross salary
(Hint: Gross pay= hours*pay rate)
Sample Input for 1 employee:
Hours worked by employee 1: 10
Hourly pay rate for employee 1:1000
Employee 1 gross salary:10000 use 3rd array for gross Salary 5
Q3.Write a program in C++ to separate odd and even integers in separate arrays. 5
Q4.Write a C++ Program to copy an array element into another array in reverse order 5
e.g a[1,2,3,4,5] the b should be b[5,4,3,2,1]
Q5. Determine the Low and High grades of Students.
#include <iostream>
Assignment 4
Due Date: 25 Feb 2021.
Total marks 60
Note: Do not copy code from internet or any other source even across the sections. I will check the
plagiarism of the assignment and it will capture the cheated code from internet or copied from class fellows.
Those who will try they will get some marks for their effort even you do not get perfect solution. Copied
& Shared work will score in negative grading. Assignment should be in visual Studio. You will copy all
the code to word file and send it on LMS. Word file should be renamed with your roll number. After
submission, no excuse will be entertained. No assignment will be accepted after due date.
Q1. 0, 1, 1, 2, 3, 5, 8, 13… are the Fibonacci numbers series as we learnt in the class. Write a
C++program that takes/declares an array with the name fibnum[80] with 80 size and start
filling it with the first 80 Fibonacci series. Now declare another fibar[80] which will copy
those elements from fibnum[] which are multiple of 5 and count of the total numbers which
are multiple of 5. Display first array completely and display fibar[] according to the size of
the count only. 5
Clue: First, enter two numbers 0 and 1 manually in the array and then calculate the remaining
numbers using the loop.
Q2.Write a C program that that takes as input two integers arrays hours worked and pay rate of 5
employees and display each employee gross salary
(Hint: Gross pay= hours*pay rate)
Sample Input for 1 employee:
Hours worked by employee 1: 10
Hourly pay rate for employee 1:1000
Employee 1 gross salary:10000 use 3rd array for gross Salary 5
Q3.Write a program in C++ to separate odd and even integers in separate arrays. 5
Q4.Write a C++ Program to copy an array element into another array in reverse order 5
e.g a[1,2,3,4,5] the b should be b[5,4,3,2,1]
Q5. Determine the Low and High grades of Students.
#include <iostream>