troubleshooting Question

Can you help me fix my errors so that it will run?

Avatar of LamaKAN13
LamaKAN13 asked on
C++
3 Comments2 Solutions264 ViewsLast Modified:
Write a program that will allow the user to enter the energy bills from January to December from the year prior to going green. Next allow, the user to enter the energy bills from January to December of the past year after going green. The program should calculate the energy difference from the past two years and display the two years worth of data, along with the savings.


This is a C++ Code

This is a code that I tried to do on my own can you help me fix my errors so that it will run.


#include <iostream>
#include <cmath>
using namespace std;

int main()
{

      //variable
      char Months;
      double NotGreenCost;
      double GoneGreenCost;
      double GoneGreenCost;
      double Savings;
      int counter
      double TwoYearsData
      



      //input'
      cout<< "Enter NOT GREEN Energy Cost For January";
      cin>>NotGreenCost >>January>>;
      

      cout<< "Enter NOT GREEN Energy Cost For Febuary";
      cin>>NotGreenCost >>Febuary>>;
      
      cout<< "Enter NOT GREEN Energy Cost For March";
      cin>>NotGreenCost >>March>>;
      
      cout<< "Enter NOT GREEN Energy Cost For May";
      cin>>NotGreenCost >>May>>;

      cout<< "Enter NOT GREEN Energy Cost For April";
      cin>>NotGreenCost >>April>>;

      cout << "Enter NOT GREEN Energy Cost For July";
      cin>> NotGreenCost >>July>>;

      cout << "Enter NOT GREEN Energy Cost For June";
      cin>> NotGreenCost >>June>>;

      cout << "Enter NOT GREEN Energy Cost For August";
      cin >> NotGreenCost>>August>>;

      cout << "Energy NOT GREEN Energy Cost  For September";
      cin  >> NotGreenCost >>September>>;

      cout << "Enter NOT Green Energy Cost For October";
      cin  >> NotGreenCost >>October>>;
      
      cout <<"Enter NOT GREEN Energy Cost For November";
      cin  >>NotGreenCost >>November>>;

      cout << "Enter NOT GREEN Energy Cost For December";
      cin  >>NotGreenCost >>December>>;


--------------------------------------------------------------------------------------------------------------------------------------

      cout<< "Enter GONE GREEN Energy Cost For January";
      cin>>GoneGreenCost >>January>>;
      

      cout<< "Enter GONE GREEN Energy Cost For Febuary";
      cin>>GoneGreenCost >>Febuary>>;
      
      cout<< "Enter GONE GREEN Energy Cost For March";
      cin>>GoneGreenCost >>March>>;
      
      cout<< "Enter GONE GREEN Energy Cost For May";
      cin>>GoneGreenCost >>May>>;

      cout<< "Enter GONEGREEN Energy Cost For April";
      cin>>GoneGreenCost >>April>>;

      cout << "Enter Energy Cost For July";
      cin>> GoneGreenCost >>July>>;

      cout << "Enter GONEGREEN Energy Cost For June";
      cin>> GoneGreenCost >>June>>;

      cout << "Enter GONEGREEN Energy Cost For August";
      cin >> GoneGreenCost>>August>>;

      cout << "Energy GONEGREEN Energy Cost  For September";
      cin  >> GoneGreenCost >>September>>;

      cout << "Enter GONE GREEN Energy Cost For October";
      cin  >> GoneGreenCost >>October>>;
      
      cout <<"Enter GONE GREEN Energy Cost For November";
      cin  >>GoneGreenCost >>November>>;

      cout << "Enter GONE GREEN Energy Cost For December";
      cin  >>GoneGreenCost >>December>>;



      //processing
             int counter = 0 ;

      char Months [12];
       Months [0]= 1000;
       Months [1] = January;
       Months [2] = Febuary;
       Months [3] = March;
     Months [4] = May;
       Months [5] = June;
       Months [6] = July;
       Months [7] = August;
       Months [8] = September;
       Months [9] = October;
       Months [10] = November;
     Months [11]= December;
       Months [12]= April;
      

      int NotGreenCost [12];
            NotGreenCost [0] = 1000;
            NotGreenCost [1] = [789];
            NotGreenCost [2] = [790];
            NotGreenCost [3] = [890];
            NotGreenCost [4] = [773];
            NotGreenCost [5] = [723];
            NotGreenCost [6] = [759];
            NotGreenCost [7] = [690];
            NotGreenCost [8] = [681];
            NotGreenCost [9] = [782];
            NotGreenCost [10] = [791];
            NotGreenCost [11] = [898];
            NotGreenCost [12] = [923];

      

      int GoneGreenCost [12];
            GoneGreenCost [0] = 1000;
            GoneGreenCost [1] = 546;
            GoneGreenCost [2] = 519;
            GoneGreenCost [3] = 493;
            GoneGreenCost [4] = 472;
            GoneGreenCost [5] = 432;
            GoneGreenCost [6] = 347;
            GoneGreenCost [7] = 318;
            GoneGreenCost [8] = 453;
            GoneGreenCost [9] = 489;
            GoneGreenCost [10]= 516;


      int Savings [35];
            Savings [0] = 1000;
            Savings [1] = 243;
            Savings [2] = 254;
            savings [3] = 371;
            savings [4] = 280;
            Savings [5] = 251;
            Savings [6] = 327;
            Savings [7] = 343;
            Savings [8] = 363;
            Savings [9] = 329;
            Savings [10]= 789;
            Savings [11]= 790;
            Savings [12]= 890;
            savings [13]= 773;
            Savings [14]= 723;
            savings [15]= 759;
            Savings [16]= 690;
            Savings [17]= 681;
            Savings [18]= 782;
            Savings [19]= 546;
            Savings [20]= 536;
            Savings [21]= 519;
            Savings [22]= 493;
            Savings [23]= 472;
            Savings [24]= 432;
            Savings [25]= 347;
            Savings [26]= 318;
            Savings [27]= 453;
            Savings [28]= 302;
            Savings [29]= 459;
            Savings [30]= 407;
            Savings [31]= 791;
            Savings [32]= 898;
            Savings [33]= 923;
            Savings [34]= 489;
            Savings [35]= 439;
            Savings [36]= 516;

            cout>> "Do You Want To End The Program?" >> Yes/No>>;
            
            cout>> Months [12] + NotGreenCost [12] + GoneGreenCost [12] = Savings;
            cin<<Savings;

            cout>> Months [12] + NotGreenCost [12] + GoneGreenCost [12] = TwoYearsData
            cin<<TwoYearsData;
return 0;
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 2 Answers and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros