60 635
Assignments Done
97,8%
Successfully Done
In April 2018

Answer to Question #4845 in C++ for Amber Moore

Question #4845
A program that accepts data for an ID number of a dog’s owner, and the name, breed, age, and weight of the dog. Display a bill containing all the input data as well as the weekly day care fee, which is $55 for dogs under 15 pounds, $75 for dogs from 15 to 30 pounds inclusive, $105 for dogs from 31 to 80 pounds inclusive, and $125 for dogs over 80 pounds. Write the pseudo code.
Expert's answer
#include <cstdlib>
#include <iostream>

using namespace std;
int weight,age,price;
string name,breed;
int main(int argc, char *argv[])
{
cout<<"Enter name : ";
cin>>name;
cout<<"Enter breed : ";
cin>>breed;
cout<<"Enter age : ";
cin>>age;
cout<<"Enter weight : ";
cin>>weight;
if (weight<15) price=55;
else if (weight>=15 && weight<=30) price=75;
else if (weight>=31 && weight<=80) price=105;
else if (weight>80) price=125;
cout<<endl;
cout<<" name : "<<name<<endl;
cout<<" breed : "<<breed<<endl;
cout<<" age : "<<age<<endl;
cout<<" weight : "<<weight<<endl;
cout<<" weekly day care fee : "<<price<<endl;
system("PAUSE");
return EXIT_SUCCESS;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions