Answer:
#include<iostream> //i/o library
using namespace std;
int main(){
double hourlyRate = 0;
char paycheckPeriod='a';
while(paycheckPeriod<'A' || paycheckPeriod>'Z'){
cout<<"Enter paycheck period(A-Z): ";
cin>>paycheckPeriod;
}
while(hourlyRate<18 || hourlyRate>36){
cout<<"Enter hourly rate (18-36): ";
cin>>hourlyRate;
}
int hours = 0;
while(hours < 60 || hours > 120){
cout<<"Enter number of hours (60-120): ";
cin>>hours;
}
double grossPay = hourlyRate*hours;
cout<<"Gross Pay: "<<grossPay<<endl;
cout<<"federal tax: "<<0.15*grossPay<<endl;
cout<<"FICA tax: "<<0.0765*grossPay<<endl;
cout<<"state tax: "<<0.0435*grossPay<<endl;
cout<<"Net pay: "<<grossPay-(grossPay*(0.15+0.0765+0.0435));
return 0; //This makes sure that the program terminates
}
Attached is the output
There are ones for smart people andones that want to lay sports and small colleges.
#include
#include
using namespace std;
int CountCharacters(char userChar, string userString){
int result = 0;
for(int i = 0;i if(userString[i] == userChar){
result++;
}
}
return result;
}
int main(){
string userString;
char userChar;
cin>>userChar>>userString;
cout< return 0;
}
Just multiply all numbers to get the total number of bits:
25*50*12 = 15000 bits.