Question
The user will be asked to enter his/her monthly earnings for 12 months for years 2018 and 2017. The monthly difference between the two years
The user will be asked to enter his/her monthly earnings for 12 months for years 2018 and 2017. The monthly difference between the two years will be calculated and all the information will be displayed as follows (You do not need the borders):
You would need to declare two (or three depending on your taste) double arrays of 12 (Declare 12 as a constant and use it as the array size) to store the user input for 2018, 2017 and the difference between the two.
You may also want to declare a string array of 12 (use the constant) to store the months.
You will use for loops to get user input into the two double arrays, to calculate the difference and store it in the third double array.
You will display the information as shown using loops.
2018 2017 Difference Jan. 105.54 345.00 -239.46 Feb. 234.56 233.56 1.00 Mar. 124.34 789. 45 665.11 Apr. 600.00 456.78 143.22 May 590.67 456.78 133.89 Jun. 650.00 500.45 149.55 Jul. 389.00 678.90 -289.9 Aug. 567.80 456.78 111.02 Sept. 450.90 400.89 50.01 Oct. 547.89 500.78 47.11 Nov. 345.67 345.67 0.00 Dec. 890.90 670.00 220.90
Step by Step Solution
There are 3 Steps involved in it
Step: 1
include include using namespace std const int k 12 int main coutpre...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