C Program 2 Report
C Program 2 Report
Introduction
For this project, I developed a C++ program that calculates the average of the
maximum values from two numerical sequences. If either of the maximum values is
negative, the program displays an error message instead of computing the average.
Tools Used
• Programming Language: C++
• IDE: Embarcadero Dev-C++
• Operating System: Windows 7
Problem Statement
The goal of this project was to design a program that takes two sequences of
numbers, determines the maximum value from each, and calculates their average only
if both are positive. If either maximum is negative, the program should notify the
user with an error message.
Algorithm
1. Read two sequences of numbers.
2. Identify the maximum value from each sequence.
3. Check if either of the maximum values is negative.
4. If a negative maximum is found, display an error message.
5. If both maximums are positive, compute and display their average.
Expected Output
If the input sequences contain only positive maximum values, the output will be:
Challenges Faced
One of the main challenges I encountered was that my computer is quite old, which
prevented me from running the program properly. However, I was able to compile it
successfully.
Possible Solutions
• Upgrade my system to improve performance.
• Test my code on a different machine with a more recent operating
system.
• Use a lighter IDE or an online compiler to run the program.
Conclusion