Link to home
Start Free TrialLog in
Avatar of LamaKAN13
LamaKAN13

asked on

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

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
Avatar of sarabande
sarabande
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of LamaKAN13
LamaKAN13

ASKER

I made corrections... It sill is not running... Please Help
I'm showing you what I know... And I am trying


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

int main()
{

      //variable
     
        string January;
        string Febuary;
        string March;
        string April;
        string May;
        string June;
        string July;
        string August;
        string September;
        string November;
        string December;
        string October;
        string December;
        string  Months[12];
      double NotGreenCost;
      double GoneGreenCost;
      double GoneGreenCost;
      double Savings;
      int counter = 0;
     
     
        Months[13] = {January, Febuary, March, April, May, June, July, August, September, November, December, October, December};

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

      cout<< "Enter NOT GREEN Energy Cost For Febuary";
      cin>>NotGreenCost cin>>Febuary;
      cout<< "Enter ----> 790"


      cout<< "Enter NOT GREEN Energy Cost For March";
      cin>>NotGreenCost>>March;
        cout<< "Enter ----> 890"
     
      cout<< "Enter NOT GREEN Energy Cost For May";
      cin>>NotGreenCost >>May>>;
        cout<< "Enter -----> 773"

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

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

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

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

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

      cout << "Enter NOT Green Energy Cost For October";
      cin  >> NotGreenCost >>October>>;
      cout << "Enter ----> 791"

      cout <<"Enter NOT GREEN Energy Cost For November";
      cin  >>NotGreenCost >>November>>;
        cout << "Enter ----> 898"

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

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

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

      cout<< "Enter GONE GREEN Energy Cost For Febuary";
      cin>>GoneGreenCost >>Febuary>>;
      cout<< "Enter -----> 536"

      cout<< "Enter GONE GREEN Energy Cost For March";
      cin>>GoneGreenCost >>March>>;
      cout<< "Enter ----> 519"

      cout<< "Enter GONE GREEN Energy Cost For May";
      cin>>GoneGreenCost >>May>>;
        cout<< "Enter ----> 493"

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

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

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

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

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

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

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

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


      //processing
      int counter = 0 ;

      string Months [13];
       Months [0] = 0;
       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;
     

      double NotGreenCost [13];
            NotGreenCost [0] ;
            NotGreenCost [1] ;
            NotGreenCost [2] ;
            NotGreenCost [3] ;
            NotGreenCost [4] ;
            NotGreenCost [5] ;
            NotGreenCost [6] ;
            NotGreenCost [7] ;
            NotGreenCost [8] ;
            NotGreenCost [9] ;
            NotGreenCost [10];
            NotGreenCost [11];
            NotGreenCost [12];

     

      double GoneGreenCost [13];
            GoneGreenCost [0] ;
            GoneGreenCost [1] ;
            GoneGreenCost [2] ;
            GoneGreenCost [3] ;
            GoneGreenCost [4] ;
            GoneGreenCost [5] ;
            GoneGreenCost [6] ;
            GoneGreenCost [7] ;
            GoneGreenCost [8] ;
            GoneGreenCost [9] ;
            GoneGreenCost [10];
                  GoneGreenCost [11];
                  GoneGreenCost [12];

     double savings [36];
            savings [0] ;
            savings [1] ;
            savings [2] ;
            savings [3] ;
            savings [4] ;
            savings [5] ;
            savings [6] ;
            savings [7] ;
            savings [8] ;
            savings [9] ;
            savings [10];
            savings [11];
            savings [12];
            savings [13];
            savings [14];
            savings [15];
            savings [16];
            savings [17];
            savings [18];
            savings [19];
            savings [20];
            savings [21];
            savings [22];
            savings [23];
            savings [24];
            savings [25];
            savings [26];
            savings [27];
            savings [28];
            savings [29];
            savings [30];
            savings [31];
            savings [32];
            savings [33];
            savings [34];
            savings [35];
            savings [36];

            cout>> "Do You Want To End The Program?" >> "Yes/No">>;
           
                  Months[13] * {"January", "Febuary", "March", "April", "May", "June", "July", "August", "September", "November", "December", "October", "December"};

            cout>> Months[13] *  NotGreenCost[13] -  GoneGreenCost[13] = Savings;
            cin<<Savings;

             
return 0;
}
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial