5.7 Figure 5.12 Program to Process Bald Eagle Sightings for a Year
#include <cstdlib>
#include <iostream>
#define SENTINEL 0
#define NUM_MONTHS 12
using namespace std;
int main(void)
{
int month,mem_sight,sightings;
cout<<"BALD EAGLE SIGHTINGS"<<endl;
for(month=1;month<=NUM_MONTHS;month++){
sightings=0;
cin>>mem_sight;
while (mem_sight != SENTINEL){
if(mem_sight>=0)
sightings += mem_sight;
else
cout<<"Warning, negative count ignored"<<mem_sight<<endl;
cin>>mem_sight;
}
cout<<"month : "<<month<<sightings;
}
system("PAUSE");
return EXIT_SUCCESS;
}
Tugas Kelompok ebook chapter 5 Alpro
| Judul | : | Tugas Kelompok ebook chapter 5 Alpro |
| Url | : | https://fiqriany1300018072.blogspot.com/2014/03/tugas-kelompok-ebook-chapter-5-alpro_2474.html |
| Pada | : | Senin, 24 Maret 2014 |
| Oleh | : | Unknown |
| Respond | : | 0 |
| Share | : |
Langganan:
Posting Komentar (Atom)
0 komentar:
Posting Komentar