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

C Program 2 Report

The project involves a C++ program that calculates the average of maximum values from two numerical sequences, displaying an error if either maximum is negative. It outlines the tools used, the algorithm for processing the sequences, and the expected outputs based on the values. The report also discusses challenges faced due to hardware limitations and suggests possible solutions to improve performance.

Uploaded by

carl.denf
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

C Program 2 Report

The project involves a C++ program that calculates the average of maximum values from two numerical sequences, displaying an error if either maximum is negative. It outlines the tools used, the algorithm for processing the sequences, and the expected outputs based on the values. The report also discusses challenges faced due to hardware limitations and suggests possible solutions to improve performance.

Uploaded by

carl.denf
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

Project 2 Report

Project Report: Average Calculation of Two Sequences with Error Handling

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:

The average of the maximum values is: X.Y

If at least one maximum value is negative, the output will be:

Error: One or both of the maximum values are negative.

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

This project helped me reinforce my understanding of working with sequences,


finding maximum values, handling errors, and structuring a C++ program effectively.
Despite technical challenges, I was able to write and compile the code
successfully.

You might also like