#include #include #include using namespace std; int main() { string Jan,F,Ma,Ap,May,Ju,Jul,Au,S,O,N,D; int i; double sum,sum1; double B; cout << "please input monthly usage in kWh for January: " << endl; cin >> Jan; cout << "please input monthly usage in kWh for February: " << endl; cin >> F; cout << "please input monthly usage in kWh for March: " << endl; cin >> Ma; cout << "please input monthly usage in kWh for April: " << endl; cin >> Ap; cout << "please input monthly usage in kWh for May: " << endl; cin >> May; cout << "please input monthly usage in kWh for June: " << endl; cin >> Ju; cout << "please input monthly usage in kWh for July: " << endl; cin >> Jul; cout << "please input monthly usage in kWh for August: " << endl; cin >> Au; cout << "please input monthly usage in kWh for September: " << endl; cin >> S; cout << "please input monthly usage in kWh for October: " << endl; cin >> O; cout << "please input monthly usage in kWh for November: " << endl; cin >> N; cout << "please input monthly usage in kWh for December: " << endl; cin >> D; string month[12] ={" January "," February "," March "," April "," May "," June "," July ","August "," September "," October "," November "," December ",}; //- For consumption of less than or equal to RM600 per month, a 10% discount is given. //- For consumption of more than RM600 per month, a 6% service tax is imposed. { for(i=1;i<=100;i++) { i*(17.5)==sum; sum*(10/100)==sum1; sum-sum1==B; } for(i=101;i<=200;i++) { i*(18.5)==sum; sum*(10/100)==sum1; sum-sum1==B; } for(i=201;i<=300;i++) { i*(33.0)==sum; sum*(10/100)==sum1; sum-sum1==B; } for(i=301;i<=500;i++) { i*(44.5)==sum; sum*(10/100)==sum1; sum-sum1==B; } for(i=501;i<=1000;i++) { i*(45.0)==sum; sum*(10/100)==sum1; sum-sum1==B; } for(i=1001;i>1001;i++) { i*(47.0)==sum; sum*(10/100)==sum1; sum-sum1==B; } cout << "Your bill for " << month[0] << " is " << B << endl; cout << "Your bill for " << month[1] << " is " << B << endl; cout << "Your bill for " << month[2] << " is " << B << endl; cout << "Your bill for " << month[3] << " is " << B << endl; cout << "Your bill for " << month[4] << " is " << B << endl; cout << "Your bill for " << month[5] << " is " << B << endl; cout << "Your bill for " << month[6] << " is " << B << endl; cout << "Your bill for " << month[7] << " is " << B << endl; cout << "Your bill for " << month[8] << " is " << B << endl; cout << "Your bill for " << month[9] << " is " << B << endl; cout << "Your bill for " << month[10] << " is " << B << endl; cout << "Your bill for " << month[11] << " is " << B << endl; } return 0; } What is the mistake of the program that cause to not get the output shown in the picture?
#include <iostream>
#include <string>
#include<iomanip>
using namespace std;
int main()
{
string Jan,F,Ma,Ap,May,Ju,Jul,Au,S,O,N,D;
int i;
double sum,sum1;
double B;
cout << "please input monthly usage in kWh for January: " << endl;
cin >> Jan;
cout << "please input monthly usage in kWh for February: " << endl;
cin >> F;
cout << "please input monthly usage in kWh for March: " << endl;
cin >> Ma;
cout << "please input monthly usage in kWh for April: " << endl;
cin >> Ap;
cout << "please input monthly usage in kWh for May: " << endl;
cin >> May;
cout << "please input monthly usage in kWh for June: " << endl;
cin >> Ju;
cout << "please input monthly usage in kWh for July: " << endl;
cin >> Jul;
cout << "please input monthly usage in kWh for August: " << endl;
cin >> Au;
cout << "please input monthly usage in kWh for September: " << endl;
cin >> S;
cout << "please input monthly usage in kWh for October: " << endl;
cin >> O;
cout << "please input monthly usage in kWh for November: " << endl;
cin >> N;
cout << "please input monthly usage in kWh for December: " << endl;
cin >> D;
string month[12] ={" January "," February "," March "," April "," May "," June "," July ","August "," September "," October "," November ","
December ",};
//- For consumption of less than or equal to RM600 per month, a 10% discount is given.
//- For consumption of more than RM600 per month, a 6% service tax is imposed.
{
for(i=1;i<=100;i++)
{
i*(17.5)==sum;
sum*(10/100)==sum1;
sum-sum1==B;
}
for(i=101;i<=200;i++)
{
i*(18.5)==sum;
sum*(10/100)==sum1;
sum-sum1==B;
}
for(i=201;i<=300;i++)
{
i*(33.0)==sum;
sum*(10/100)==sum1;
sum-sum1==B;
}
for(i=301;i<=500;i++)
{
i*(44.5)==sum;
sum*(10/100)==sum1;
sum-sum1==B;
}
for(i=501;i<=1000;i++)
{
i*(45.0)==sum;
sum*(10/100)==sum1;
sum-sum1==B;
}
for(i=1001;i>1001;i++)
{
i*(47.0)==sum;
sum*(10/100)==sum1;
sum-sum1==B;
}
cout << "Your bill for " << month[0] << " is " << B << endl;
cout << "Your bill for " << month[1] << " is " << B << endl;
cout << "Your bill for " << month[2] << " is " << B << endl;
cout << "Your bill for " << month[3] << " is " << B << endl;
cout << "Your bill for " << month[4] << " is " << B << endl;
cout << "Your bill for " << month[5] << " is " << B << endl;
cout << "Your bill for " << month[6] << " is " << B << endl;
cout << "Your bill for " << month[7] << " is " << B << endl;
cout << "Your bill for " << month[8] << " is " << B << endl;
cout << "Your bill for " << month[9] << " is " << B << endl;
cout << "Your bill for " << month[10] << " is " << B << endl;
cout << "Your bill for " << month[11] << " is " << B << endl;
}
return 0;
}
What is the mistake of the program that cause to not get the output shown in the picture?
![enter the monthly usage (in kwh) from January to December.
100
200
300
2000
100
5000
3575
4500
800
563
1287
909
Month
Usage (kwh)
Consumption (RM) 10% Discount (RM)
6% Tax(RM)
Bill(RM)
Jan
100
17.50
1.75
0.00
15.75
Feb
200
36.00
3.60
0.00
32.40
March
April
May
June
300
69.00
6.90
0.00
62.10
2000
853.00
0.00
51.18
904.18
100
17.50
1.75
0.00
15.75
5000
2263.00
0.00
135.78
2398.78
July
Aug
Sep
Oct
Nov
Dec
3575
1593.25
0.00
95.59
1688.85
4500
2028.00
0.00
121.68
2149.68
800
293.00
29.30
0.00
263.70
563
186.35
18.64
0.00
167.72
1287
517.89
51.79
0.00
466.10
909
342.05
34.21
0.00
307.85
Process exited after 31.54 seconds with return value e
Press any key to continue](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fe67db429-dae4-4f0d-9c03-9f7e2264d172%2F49f291d3-851d-434f-89f0-a87cd8393d13%2F5vnrszi_processed.png&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 3 steps with 1 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)