Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
7 views

Programming problems

The document outlines a programming problem that involves calculating the sum, difference, product, and quotient of two integers. It includes a defined diagram for input, processing, and output, as well as pseudocode for the algorithm. Additionally, it presents two data sets with expected results for verification purposes.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Programming problems

The document outlines a programming problem that involves calculating the sum, difference, product, and quotient of two integers. It includes a defined diagram for input, processing, and output, as well as pseudocode for the algorithm. Additionally, it presents two data sets with expected results for verification purposes.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Programming problems

1.
Defining Diagram
Input Processing Output
num 1 Read num 1, num 2 Sum
num 2 Sum = num 1 + num 2 Difference
Diff = num 1 – num 2 Product
Pro = num 1 * num 2 Quotient
Quot = num 1/ num 2
Output Sum, Difference,
Product, Quotient
IF num 2 != 0 THEN
Print “Quotient”
ELSE
Print “Zero”

Pseudocode Algorithm
Pseudocode to calculate sum, difference, product, quotient of two integer numbers
and display them
Variables: num 1, num 2, sum, difference, product, quotient
Desking checking
Data set 1 Data set 2
num 1 5 10
num 2 12 24
Expected sum 17 34
Expected difference 7 14
Expected product 60 240
Expected quotient 0.4167 0.4167
Expected quotient if num 2 != 0 “Error” “Error"

Line Num 1 Num 2 Sum Diff Pro Quotient


1 Read Read
2 5 12
3 17
4 7
5 60
6 0.4167
7 Print
8 Print
9 Print
10 Print

2.
Defining Diagram

You might also like