Question
c++ language Write a program to help a company store their monthly profit in a year and determine a few key facts from the sales
c++ language
Write a program to help a company store their monthly profit in a year and determine a few key facts from the sales data
i The total profit made
ii The name of the month with the lowest profit made
iii The name of the month with the lowest loss made
iv The number of months that make a loss
Answer the questions using the following functions
a) Function to fill up the array with the monthly profit/loss values from a file (Enter any 12 values for profit and loss in the file)
b) Function to display the content of the array
c) Function to find the total profit/loss made at the end of the year
d) Function that takes in a number between 0 and 11 and returns the corresponding name of month (e.g 0 - January, 1 - February)
e) Function that finds the name of the month where the lowest profit was made (function d above is required to help you with this)
f) Function that finds the name of the month where the lowest loss was made
g) Function that returns the number of months that make a loss
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started