I need this coded in C++. I keep coming up with errors.
// Start
// Declarations
// number id
// string ownerName
// string breed
// number age
// number weight
// number weeklyFee
//
// output "Please enter owner's ID: "
// input id
// output "Please enter owner's name: "
// input ownerName
// output "Please enter dog's breed (no space in input, use
'_'
// instead; For example Great_Dane): "
// input breed
// output "Please enter dog's age: "
// input age
// output "Please enter dog's weight: "
// input weight
// if (weight < 15) then
// weeklyFee = 55.00
// else if ((weight >= 15) and (weight <= 30)) then
// weeklyFee = 75.00
// else if ((weight > 30) and (weight <= 80)) then
// weeklyFee = 105.00
// else
// weeklyFee = 125.00
//
// output "Owner Name: ", ownerName
// output "Owner ID: ", id
// output "Dog Breed: ", breed
// output "Dog Age: ", age
// output "Dog Weight: ", weight
// output "Weekly Fee: ", "$",weeklyFee
// Stop
#include<iostream>
using namespace std;
int main(){
int id;
string ownerName;
string breed;
int age;
int weight;
int weeklyFee;
cout<<"Please enter owner's ID: ";
cin>>id;
cout<<"Please enter owner's nane: ";
cin>>ownerName;
cout<<"Please enter dog's breed (no space in
input, use '_' instead;For example Great_Dane): ";
cin>>breed;
cout<<"Please enter dog's age: ";
cin>>age;
cout<<"Please enter dog's weight: ";
cin>>weight;
if(weight < 15){
weeklyFee = 55.00;
}else if((weight >= 15) &&
(weight<=30)){
weeklyFee = 75.00;
}else if((weight > 30) && (weight <=
80)){
weeklyFee = 105.00;
}else{
weeklyFee = 125.00;
}
cout<<"Owner Name:
"<<ownerName<<endl;
cout<<"Owner ID: "<<id<<endl;
cout<<"Dog Breed:
"<<breed<<endl;
cout<<"Dog Age: "<<age<<endl;
cout<<"Dog Weight:
"<<weight<<endl;
cout<<"Weekly Fee:
"<<"$"<<weeklyFee;
}
/* Output */
Please enter owner's ID: 123
Please enter owner's nane: xyz
Please enter dog's breed (no space in input, use '_' instead;For
example Great_Dane): Great_Dane
Please enter dog's age: 5
Please enter dog's weight: 20
Owner Name: xyz
Owner ID: 123
Dog Breed: Great_Dane
Dog Age: 5
Dog Weight: 20
Weekly Fee: $75
/* Please upvote (thank you in advance)*/
I need this coded in C++. I keep coming up with errors. // Start // Declarations...
solve it in c++ 10
note:
please do not give me same answer like this
1. Define a Pet class that stores the pet's name, age, and weight. Add appropriate constructors, accessor functions, and mutator functions. Also define a function named getLifespan that returns a string with the value "unknown lifespan." Next, define a Dog class that is derived from Pet. The Dog class should have a private member variable named breed that stores the breed of the dog. Add...
Please put the following pseudocode into C++. // Start // Declarations // Automobile myAuto // string vin // string make // string model // string color // output "Please enter the Vehicle Identification Number: " // input vin // output "Please enter the Make: " // input make // output "Please enter the Mode: " // input model // output "Please enter the color: " // input color // Set the VIN for myAuto // Set the Make for myAuto...
In Java Code Needed is Below the Question Using Program 3: Encapsulating Dogs, modify this program to create a database of dogs of your own. You will also include File I/O with this program. You will create 3 classes for this assignment. The first class: Create a Class representing the information that is associated with one item (one dog) of your database. Name this class Dog. Using Lab 3, this will include the information in regard to one dog. The...
Hello I need a small fix in my program. I need to display the youngest student and the average age of all of the students. It is not working Thanks. #include <iostream> #include <iomanip> #include <fstream> #include <vector> #include <algorithm> using namespace std; struct Student { string firstName; char middleName; string lastName; char collegeCode; int locCode; int seqCode; int age; }; struct sort_by_age { inline bool operator() (const Student& s1, const Student& s2) { return (s1.age < s2.age); // sort...
I NEED UML FOR THIS QUESTION ONLY!
This question 9 requires you to (i) draw a UML diagram and (ii) address 9(a) to 9(e) questions. • Draw a UML diagram (in the style covered in week 7) to represent the data entities model of all custom data types in the given program. You are required to paste your UML diagram to On Track 9.2P resource document for 9.2P submission. Your assessor will evaluate your work. • Analyse the information of...
I need to now how to input the following code into the complier for C++ code. It is for chapter 8 question 7a in the PLD book // Start // Declarations // num MAXADS = 100 // num adcatcode[MAXADS] // num adwords[MAXADS] // num curCode // num numads // num i // num j // num k // num subtotal // num temp // output "Please enter the number of ads: " // input numads // if ((numads > 0)...
Hello, I need to implement these small things in my C++ code. Thanks. 1- 10 characters student first name, 10 characters middle name, 20 characters last name, 9 characters student ID, 3 characters age, in years (3 digits) 2- Open the input file. Check for successful open. If the open failed, display an error message and return with value 1. 3- Use a pointer array to manage all the created student variables.Assume that there will not be more than 99...
Please help fix my code C++, I get 2 errors when running. The code should be able to open this file: labdata.txt Pallet PAG PAG45982IB 737 4978 OAK Container AYF AYF23409AA 737 2209 LAS Container AAA AAA89023DL 737 5932 DFW Here is my code: #include <iostream> #include <string> #include <fstream> #include <vector> #include <cstdlib> #include <iomanip> using namespace std; const int MAXLOAD737 = 46000; const int MAXLOAD767 = 116000; class Cargo { protected: string uldtype; string abbreviation; string uldid; int...
Write in C++ 1. Use the following Person class (Person.cpp, Person.h). You will be writing Person objects to a random access file. --------------------- Person.cpp--------------------------------- // Class Person stores customer's credit information. #include <string> #include "Person.h" using namespace std; // default Person constructor Person::Person( int idValue, string lastNameValue, string firstNameValue, int AgeValue ) { setID( idValue ); setLastName( lastNameValue ); setFirstName( firstNameValue ); setAge( AgeValue ); } // end Person constructor // get id value int Person::getID() const { return id;...
Write a program in java. You are tasked with writing an application that will keep track of Insurance Policies. Create a Policy class called InsurancePolicies.java that will model an insurance policy for a single person. Use the following guidelines to create the Policy class: • An insurance policy has the following attributes: o Policy Number o Provider Name o Policyholder’s First Name o Policyholder’s Last Name o Policyholder’s Age o Policyholder’s Smoking Status (will be “smoker” or “non-smoker”) o Policyholder’s...