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.
1
Expert's answer
2011-10-27T08:17:25-0400
#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; }
Comments
Leave a comment