0% found this document useful (0 votes)
9 views3 pages

PF Assignment

This assignment requires students to write pseudocode for various problems aimed at enhancing problem-solving skills and applying basic control structures. The tasks include calculating percentages, areas, circumferences, and implementing a calculator, among others. Submissions are due on November 7 and 8, 2023, with strict guidelines against plagiarism.

Uploaded by

irha.mustafa2011
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views3 pages

PF Assignment

This assignment requires students to write pseudocode for various problems aimed at enhancing problem-solving skills and applying basic control structures. The tasks include calculating percentages, areas, circumferences, and implementing a calculator, among others. Submissions are due on November 7 and 8, 2023, with strict guidelines against plagiarism.

Uploaded by

irha.mustafa2011
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

ASSIGNMENT#1

COURSE CODE: CC1021 MAXIMUM MARKS: 5*12=60


INSTRUCTOR’S NAME: Ms. Afnan Iftikhar
SUBMISSION DEADLINE: start of class 7 November (Y5) and 8 November (Y9)
Instructions: Attempt all questions. Copied assignments will be cancelled & NEGATIVE marks will be
awarded.

Question Number CLO Mapping BT Level


All CLO3 C3

Objective:
The objective of this assignment is to:
1. Make students working on their problem-solving skills
2. Make students able to apply basic control structures (loops,
conditionals) in algorithm design

Scope:
This assignment (and all its tasks) remain focus on:
1. Algorithms

Write pseudocode for all the given problems.

Problem 1: CLO2
1. Input the marks of 5 quiz from user. Then calculate as the percentage of marks of 5 quizzes, where
every quiz is out of 15 marks.

Sample Output:

Please enter marks of quiz 1: 5


Please enter marks of quiz 2: 10
Please enter marks of quiz 3: 12
Please enter marks of quiz 4: 15
Please enter marks of quiz 5: 15
Percentage = 76
2. Input the “Base” and “Height” of triangle from user than calculate the Area of the Triangle

Formula: Area of Triangle = (base*height)/2.

Sample Output:

Please enter height: 5


Please enter base: 10
Area of triangle with height 5 and base 10 is: 25

3. You are supposed to calculate circumference of circle, when value of r = 50cm and π=3.14.

Formula: circumference of circle =2πr

Sample Output:

circumference of circle with r = 50 is 314

4. Read angle between three side of triangle then check whether a triangle can be formed by the
given value for the angles.
Note: a triangle can be formed if the sum of all 3 angles is 180.

Sample Output 1:

Please enter angle1: 10


Please enter angle2: 100
Please enter angle3: 70

Yes, tringle can be formed

Sample Output 2:

Please enter angle1: 10


Please enter angle2: 10
Please enter angle3: 70

No, tringle can be formed

5. Make a calculator which should be able to perform the following operations. Display these
operations in form of menu to user then Prompt the user to enter two numbers and operator from
the given menu. Your calculator should be able to perform the required operation.
• Addition
• Subtraction
• Multiplication
• Division
Sample Output 1:

Calculator can perform + , - , * , /

Please enter number1: 8


Please enter number2: 10
Please enter the operator: +

8 + 10 = 18

6. Input 10 number from user and find maximum

7. Input 10 number from user and find minimum

8. Write pseudocode to calculate r, where r = 2a + 6 (b + c)


d+ e

9. Take the CostPrice and SellingPrice of an item into appropriate variables. Print the amount of
profit or loss the seller suffered on the item. (Hint: Remember if SP>CP then its profit otherwise
its loss).

10. Input two integers from the user and store these in variables numerator and denominator. If
the denominator is not equal to zero then display the result of the division otherwise output a
message stating division by zero is an illegal operation.

11. Input an integer form the user and store it in the variable currentNumber. If integer variable
currentNumber contains an odd value, change its value so that it is now 3 times currentNumber
plus 1, otherwise change its value so that it is now half of currentNumber. Display the value
before changing and also after changing.

12. Input employee name, hours worked for the week, and an hourly rate of pay from the user.
Your program is to calculate an amount for the regular pay (hours up to and including 40), the
overtime pay (time and one half for hours over 40), and the gross pay (the sum of the regular pay
and overtime). Look for calculations that are always performed in the same manner and those
that differ according to the hours worked. You should not have any redundant code in your
program. Output the three calculated values at the end of your program.

Guidelines
• Submit hardcopy for this assignment
• Cover page of assignment must have your Name, roll number and section.
• No assignment will be considered after deadline.

You might also like