write the c++ code to display the message " Entry error" when the value in the units variable is less than or eqaul to 0. Otherwise, calculate the total owed by multiplying the units variable value by 5. Store the total owed in the toatal variable, and then display the total owed
1
Expert's answer
2013-03-12T12:51:00-0400
/*write the c++ code to display the message " Entry error" when the value in the units variable is less than or equal to 0. Otherwise, calculate the total owed by multiplying the units variable value by 5. Store the total owed in the total variable, and then display the total owed*/
# include <iostream>
using namespace std;
int main(){
while(true){ int tot=0; cout<<"Enter value:"; int n; cin>>n; if (n<=0) {cout<<"error\n";cout<<"Total:"<<tot<<endl; system("PAUSE");return 0;} else{ tot+=n*5;
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments
Leave a comment