Analysis Program :
This program to find out the name of the day if we input the number. The process uses a switch case. We can input the numbers 1 through 7. If more than 7 or 0, then the program can not determine because already know right? Yes. Because there are only 7 days a week

Program :
[sourcecode language="css"]

#include <iostream.h>

class HARI {
public:
hari();
private:
int dino;
};
HARI::hari() {
cout<<"Masukan angka = ";
cin>>dino;
switch (dino) {
case 1:
cout<<"Hari ke : "<<dino<<" = Senin";break;
case 2:
cout<<"Hari ke : "<<dino<<" = Selasa";break;
case 3:
cout<<"Hari ke : "<<dino<<" = Rabu";break;
case 4:
cout<<"Hari ke : "<<dino<<" = Kamis";break;
case 5:
cout<<"Hari ke : "<<dino<<" = Jumat";break;
case 6:
cout<<"Hari ke : "<<dino<<" = Sabtu";break;
case 7:
cout<<"Hari ke : "<<dino<<" = Minggu";break;
default:
cout<<"Inputan eror, hanya 1 sampai 7 !!!";break;
}
}

main(){
HARI x;
x.hari();
}

[/sourcecode]