Advertisement
Guest User

Untitled

a guest
Oct 18th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.51 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     float wl=1.5;
  8.     int yrlm;
  9.     cout << "Please enter the final year :";
  10.     cin >> yrlm;
  11.     while (yrlm < 1)
  12.     {
  13.         cout << "Please enter a parameter bigger or equal than 1." << endl;
  14.         cout << "Please enter the final year :";
  15.         cin >> yrlm;
  16.     }
  17.     for (int year=1; year <= yrlm; year++)
  18.     {
  19.         cout << "The year is " << year << " and the water level is: " << wl << endl;
  20.         wl = wl+1.5;
  21.     }
  22.     return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement