0% found this document useful (0 votes)
6 views1 page

Object-Oriented Programming Lab Exercises

The document outlines a series of programming tasks focused on object-oriented programming concepts. Tasks include evaluating arithmetic expressions, implementing string operations, creating a Boolean expression evaluator, demonstrating floating-point errors, and developing encryption methods. Additional exercises involve statistical computations, temperature conversions, and a calculator that handles various data types while managing overflow and underflow conditions.

Uploaded by

jjlaroche415
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)
6 views1 page

Object-Oriented Programming Lab Exercises

The document outlines a series of programming tasks focused on object-oriented programming concepts. Tasks include evaluating arithmetic expressions, implementing string operations, creating a Boolean expression evaluator, demonstrating floating-point errors, and developing encryption methods. Additional exercises involve statistical computations, temperature conversions, and a calculator that handles various data types while managing overflow and underflow conditions.

Uploaded by

jjlaroche415
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

Object-Oriented Programming lab

1. Write a program that accepts an arithmetic expression involving different data types (int,
float, double) and evaluates it with type promotion rules applied manually.
Example: 5 + 3.2 * 2.0 → 11.4.
2. Implement string operations (length, reverse, substring, concatenation, frequency
of a character) without using built-in functions.
Example: Input → "Programming" → Frequency of g → 2.
3. Create a Boolean expression evaluator that accepts inputs as true/false or 0/1 and
evaluates logical operations (AND, OR, NOT, XOR).
Extend to truth table generator for 3 variables.
4. Demonstrate floating-point errors by comparing (a*b)/c vs. (a/c)*b.
Analyze rounding issues with float vs. double and write a program to find the smallest
detectable difference (epsilon).
5. Take input text and implement Caesar Cipher and XOR encryption using char.
Also, display ASCII values of characters before and after encryption.
6. Take a 2D array of integers, convert into float and then into double.
Perform matrix multiplication on each type and compare results (accuracy, overflow
issues).
7. Write a program that converts temperature values between Celsius, Fahrenheit, and
Kelvin.

 Use float and double separately, compare results.


 Show where precision loss occurs for very large/small values.

8. Accept n real numbers (as double) and compute:

 Mean, Median, Mode, Standard Deviation, Variance.


 Implement manually without library functions.
 Compare results when stored as float vs. double.

9. Write a program that takes a string and counts:

 Uppercase letters, lowercase letters, digits, whitespace, special characters.


 Use char and ASCII code comparisons only (no <cctype> functions).

10. Develop a calculator that accepts different data types (int, float, double) as input
operands and performs + - * / %.

 Manually detect overflow/underflow conditions for int and float.


 Display warnings when results exceed limits of the data type.

You might also like