Assignment1 OOP

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Assignment-1: Object-Oriented Programming

Submission: You are required to submit solution of all questions as a single word file through MS-
Teams. Name your file as “Reg No-Student Name-ProgramName”.

Deadline: Deadline to submit the assignment is 5th April 11:55 PM. No submission will be considered
for grading outside the MS-Teams or after 5th April 11:55 PM. Correct and timely submission of the
assignment is the responsibility of the student; hence no relaxation will be given to anyone.
Plagiarism: -50% marks in the assignment if any part of the assignment is found plagiarized.

Program 1:

Write a program to compute the sum and the sum of the squares of all data elements in the following
array arr[ ]={1,2,3,4,5}

Program 2:

Write a Program that calculates the total price of four items {2.0, 5.0, 1.0, 2.0} after entering the
quantity for each item such as:

Program 3:

(Conversion from kilograms to pounds) Write a program that displays the following table (note that 1
1 Kilogram is 2.2 pounds):

Kilograms Pounds
1 2.2
3 6.6

197 433.4
199 437.8

Program 4:

Suppose that the tuition for a university is PKR. 90,000 this year and increases 10% every year. In one
year, the tuition will be PKR. 99,000. Write a program that computes the tuition in ten years and the
total cost of four years’ worth of tuition after the tenth year.
Program 5:

Write an if-else statement to compute the amount of shipping due on an online sale. If the cost of the
purchase is less than $20, the shipping cost is $5.99. If the cost of the purchase over $20 and at most
$65, the shipping cost is $10.99. If the cost of the purchase is over $65, the shipping cost is $15.99.

Program 6:

Write a program called Strings2 that requires the user to type a long sentence. The program displays
the longest word in the sentence.

Sample Run:
Enter Sentence: The longest I have ever worked in my life-time was eight days!
Longest word is: life-time

Program 7:

Write a C++ program to swap two integers using pointers. Your program should take two integer
inputs from the user, swap their values using pointers, and then print the swapped values. You should
implement the swapping function using pointers, and not using any other temporary variable.

Program 8:

Write a recursive function in C++ to print a sequence of numbers in ascending order.

Program 9:

Write a recursive function in C++ to compute the nth Fibonacci number, where the nth Fibonacci
number is defined as the sum of the (n-1)th and (n-2)th Fibonacci numbers, with the first two Fibonacci
numbers being 0 and 1. Your function should take an integer n as input and return the nth Fibonacci
number.

Program 10:

COMP112 – Semester Project’s Requirements (Due date for only below highlighted requirements is:
05/04/2023, 11:55PM through this assignment submission)

• You can form a group starting from 1-4 students maximum.


• It would be great if you have ideas related to Pak-Austria Fachhochschule: Institute of Applied
Sciences and Technology (PAF-IAST), targeting to enhance any weaknesses that you face
or/and that can serve the university.
• Project Ideas could be:
o Recruitment System and evaluating new candidates,
o PAF-IAST Warning System
o Internship Program
o A program that introduces the IT&CS Programs (CS, SE, AI, DS) for new students, etc…)
o Others
• The same group can repeat an idea that another group is doing. (Take care the competition
will be high).

What should be submitted now:


0. Title of your project, Your Team Name, Name of Team lead, Team members
1. Problem Specification: Briefly explaining what the problem is about and what are you offering
and targeting.
Your next submissions for the same project will be:

2. Analysis: Mentioning briefly what is:


2.1 input 2.2 output 2.3 and main formulas used. (by 6th week of the semester)
3. Design:
3.1 Algorithm 3.2 Flowchart (by 7th week of the semester)
4. Implementation = Coding. (Saved in a word document and hyper-linked to your power point
presentation.) (by 12th week of the semester)
5. Testing (Snapshots of your test cases) (by 13th week of the semester)
6. Future plans: It would be great if you summarize in 1-2 slides at the end what are your
perspectives (i.e., future plans) regarding this project; meaning what you plan to improve in COMP-
112. (by 13th week of the semester)
In Summary, you should submit as a hard copy by the end of the 13th week of the semester:
1. ppt
2. Word document containing your code
3. A zipped folder for the soft data (ppt, word file, C++ project files), it should be named with team
lead and project title as the name of the submitted folder
To my email [email protected]: (Please mention team members and the project
name)
You should upload it all on MS-teams as well
- Teamwork is very important, and it is advisable to share beneficial info, therefore if you learnt a new
concept or a new technique, please share through MS-teams.

o E.g., if you heard a beneficial YouTube, you can post the link on MS-Teams.

After you form the group and after you have a clear picture of your project idea, please come to me
to give you extra tips and recommendations.

**** “University Education is not the learning of facts, but the training of minds to think .” Albert Einstein ****

You might also like