Algorithm Analysis for Sales Reporting
Algorithm Analysis for Sales Reporting
DEPARTMENT OF SCIENCES
FINAL WORK
G02
MEMBERS:
TEACHER:
José Luis Ojeda Merino
May 2, 2023
1. INTRODUCTION
The study of algorithms is one of the central topics in science and studies.
engineering is a method for problem solving and is the fundamental concept of
computer science.
The main objective of this work is to demonstrate the scope of development of the
competencies proposed in the subject (identify, formulate and solve problems).
The general management of the company AID requests the general manager a sales report of
first quarter, for this he requested an algorithm and the verification of it through a
programming code.
2. THEORETICAL FRAMEWORK
● Natural language
● Pseudocode
● Flow diagrams
● Programs
● Analysis
● Design
● Coding
● Execution
● Maintenance
Characteristics of an algorithm:
John 18 15 19 52
Carla 24 18 17 59
Luis 18 22 22 62
Matas 21 17 16 54
Oscar 15 15 17 47
Juliana 15 23 29 67
Elena 15 18 21 54
Consider that there are 7 sales agents for the first quarter.
4. PROBLEM
The company seeks to obtain the report on the collaborators and the effectiveness they are showing.
having for the sales process. As well as verifying which was the month most
cash
3.1. OBJECTIVES
4. ANALYSIS
14. End
b. Data analysis table
We identified the input, intermediate, and output data of the AID company's problem.
nameOfLowestSale Exit
c. Mathematical Model
START
nombres (7) = {"Juan", "Carla", "Luis", "Matias", "Oscar", "Juliana", "Elena"}
meses (3) = {0,1,2}
ventas [nombres][meses] = {{18, 15, 19}, {24, 18, 17}, {18, 22, 22}, {21, 17, 16}, {15,
15, 17}, {15, 23, 29}, {15, 18, 21}}
Total Sales:
Write 'Average Sales: ', averageSales
Write "Less Sale: ", nombreMenorVenta " ( ", menorVenta " ) "
Write " More Sale: ", nameHighestSale " ( ", highestSale " ) "
Month of highest sales:
If SalesTime = 0 Then
January
IfSImesMasVenta = 1 Then
February
Finland-SI
WHO
March
Finland-South Inland
Write( totalSalesPerMonth[monthWithMostSales] )
FIN
6. ALGORITHM VERIFICATION
#include<iostream>
#include<string>
#include<cmath>
using namespace std;
const int agents = 7;
const intmeses = 3;
int main() {
// Variables
stringnombres[agentes] = {"Juan", "Carla", "Luis", "Matias", "Oscar", "Juliana", "Elena"};
intventas[agentes][meses] = {{18,15,19}, {24,18,17}, {18,22,22}, {21,17,16}, {15,15,17},
Invalid input format for translation.
inttotalVentas =0;
doubleAverageSales;
lowestSale = sales[0][0];
highestSale = sales[0][0];
stringnombreMenorVenta = names[0];
nameHighestSale = names[0];
intmesMasVenta =0;
{0};
Response to each question
for(int i = 0; i < agents; i++) {
intventasAgente =0;
for(int j = 0; j < months; j++) {
agentSales += sales[i][j];
totalSalesPerMonth[j] += sales[i][j];
}
totalSales += agentSales;
if(salesAgent < smallestSale) {
leastSale = agentSales;
lowestSalesName = names[i];
}
if(agentSales > highestSale) {
salesAgent
highestSaleName = names[i];
}
}
averageSales = totalSales / (agents * months);
for(int i = 0; i < months; i++) {
if(totalSalesPerMonth[i] > totalSalesPerMonth[monthWithMostSales]) {
i
}
}
Printing of results
cout << "Total Sales: " << totalSales << endl;
cout << "Average Sales: " << averageSales << endl;
cout << "Least sale: " << nombreMenorVenta << " (" << menorVenta << ")" << endl;
cout << "Most sales: " << nameWithMostSales << " (" << mostSales << ")" << endl;
Month of highest sales:
if(monthMostSales == 0) {
January
else if(mostSalesMonth == 1) {
February
else
March
}
cout << " (" << totalVentasPorMes[mesMasVenta] << ")" << endl;
return0;
}
7. CONCLUSIONS
8. RECOMMENDATIONS
Introduction to Programming
General Fundamentals of Programming
Cormen, T. H., Leiserson, C. E., Rivest, R. L., & Stein, C. (2009). Introduction to algorithms
(3rd ed.). The MIT Press
● Programming. Arrangements o Vectors. Recovered from
Unable to access the content of the provided URL.
● Microsoft. (2021). Const keyword (C++ Reference). Retrieved on May 2
2023, of[Link]