Pet information (derived classes)

The base class Pet has private data members petName, and petAge. The derived class Dog extends the Pet class and includes a private data member for dogBreed. Complete main() to:

create a generic pet and print information using PrintInfo().
create a Dog pet, use PrintInfo() to print information, and add a statement to print the dog's breed using the GetBreed() function.
Ex. If the input is:

Dobby
2
Kreacher
3
German Schnauzer
the output is:

Pet Information:
Name: Dobby
Age: 2
Pet Information:
Name: Kreacher
Age: 3
Breed: German Schnauzer
________________________________________________

the given code:

Main.cpp:

#include
#include
#include "Dog.h"

using namespace std;

int main() {

string petName, dogName, dogBreed;
int petAge, dogAge;

Pet myPet;
Dog myDog;

getline(cin, petName);
cin >> petAge;
cin.ignore();
getline(cin, dogName);
cin >> dogAge;
cin.ignore();
getline(cin, dogBreed);

// TODO: Create generic pet (using petName, petAge) and then call PrintInfo


// TODO: Create dog pet (using dogName, dogAge, dogBreed) and then call PrintInfo


// TODO: Use GetBreed(), to output the breed of the dog


}

___________________________________________________________________________________________

Pet.h

#ifndef PETH
#define PETH

#include
using namespace std;

class Pet {
protected:
string petName;
int petAge;

public:
void SetName(string userName);

string GetName();

void SetAge(int userAge);

int GetAge();

void PrintInfo();
};

#endif
_________________________________________________________________________--

Dog.h

#ifndef DOGH
#define DOGH

#include
#include "Pet.h"

class Dog : public Pet {
private:
string dogBreed;

public:
void SetBreed(string userBreed);

string GetBreed();
};

#endif

____________________________________________________________

Pet.cpp

#include "Pet.h"
#include
#include
using namespace std;

void Pet::SetName(string userName) {
petName = userName;
}

string Pet::GetName() {
return petName;
}

void Pet::SetAge(int userAge) {
petAge = userAge;
}

int Pet::GetAge() {
return petAge;
}

void Pet::PrintInfo() {
cout << "Pet Information: " << endl;
cout << " Name: " << petName << endl;
cout << " Age: " << petAge << endl;
}

__________________________________________________________________

Dog.cpp

#include "Dog.h"
#include
#include
using namespace std;

void Dog::SetBreed(string userBreed) {
dogBreed = userBreed;
}

string Dog::GetBreed() {
return dogBreed;
}

Answers

Answer 1

Answer:

I think the answer is Breed: German Schnauzer don't listen too mee

________________________________________________

the given code:

Main.cpp:

#include

#include

#include "Dog.h"

don't listen

Explanation:


Related Questions

Anyone know why my pc won’t start up I upgraded my ram and everything seems fine

Answers

Answer:

RAM Slots

Explanation:

If you upgraded RAM then check if RAM is in correct slots according to the Motherboard Manual, i had the same issue when i replaced my RAM.

how to maintain large processors

Answers

avoiding turning it off with the power switch or power button use the os to turn it off

a. Modify the FitnessTracker class that includes data fields for a fitness activity, the number of minutes spent participating, and the date. The class includes methods to get each field. In addition, create a default constructor that automatically sets the activity to running, the minutes to 0, and the date to January 1 of the current year. Create an application that demonstrates each method works correctly.


b. Create an additional overloaded constructor for the FitnessTracker class you created in Exercise 3a. This constructor receives parameters for each of the data fields and assigns them appropriately. Add any needed statements to the TestFitnessTracker.java application to ensure that the overloaded constructor works correctly, save it, and then test it.


An example of what it should look like:

running 0 minutes on 2021-01-01

bicycling 35 minutes on 2020-08-20


What's done:

import java.time.*;

public class FitnessTracker {

String activity;

int minutes;

LocalDate date;

// constructor for 3a

public FitnessTracker() {

}

// constructor for 3b

public FitnessTracker(String a, int m, LocalDate d) {

}

public String getActivity() {

}

public int getMinutes() {

}

public LocalDate getDate() {

}

}

Answers

Answer:

It keeps saying servers fully loaded

Explanation:

Write a program to calculate the angle of incidence (in degrees) of a light ray in Region 2 given the angle of incidence in Region 1 and the indices of refraction n1 and n2. (Note: If n2>n1, then for some angles 1, Equation 2 will have no real solution because the absolute value of the quantity will be greater than 1. When this occurs, all light is reflected back into Region 1, and no light passes into Region 2 at all. Your program must be able to recognize and properly handle this condition.) The program should also create a plot showing the incident ray, the boundary between the two regions, and the refracted ray on the other side of the boundary. Test your program by running it for the following two cases: (a) n1= 1.0, n2 = 1.7, and 1= 45°. (b) n1 = 1.7, n2 = 1.0; and 1= 45°

Answers

The program is an illustration of conditional statements

What are conditional statements?

conditional statements are statements that are used to make decisions

The main program

The program written in Python, where comments are used to explain each line is as follows

#This imports the math module

import math

#This get sthe refraction index 1

n1 = float(input("Refraction index 1: "))

#This get sthe refraction index 2

n2 = float(input("Refraction index 2: "))

#This gets the normal angle of incidence in region 1

theta1 = float(input("Normal of incidence in region 1 (degrees): "))

#If n1 is greater than n2, then there is no real solution

if n1 > n2:

   print("No real solution")

#If otherwise

else:

   #This calculates the angle of incidence

   theta2 = math.asin(n1/n2 * math.sin(math.radians(theta1))) * (180/math.pi)

   #This prints the angle of incidence

   print("Angle of incidence",round(theta2,2),"degrees")

Note that the program only calculates the angle of incidence, it does not print the plot

Read more about conditional statements at:

https://brainly.com/question/24833629

What does the “mystery” function do?

Answers

Answer:

Find the product of prime number between 1and8

Answer:

function mystery() {

while (noBallsPresent()) {

move();

}

}

Explanation:

Karel moves until it is on a ball.

Which of the formulas below are valid? Select all that apply?

Answers

Answer:

Is there a picture to go with this question?

Explanation:

Is there a picture to go with this question?

hello everyone can help me give all the answer​

Answers

Answer:

1. were

2. were

3 was

4 was

5 were

1 wasnt

2 werent

3werent

4 wasnt

5 werent

were you at work?

was it in the garden?

were they worried?

was lucy present?

were his friends late?

1 they were

2 it was

3 he wasn't

4 I was

5 they weren't

Explanation:

11. In cell R9, enter a formula using the AVERAGE function and structured references to determine the average number of years of post-secondary education of all students as shown in the Post-Secondary Years column.

Answers

The typical AVERAGE function that can be used to determine the average number of years of post-secondary education of all students is "AVERAGE(StudentRepresentatives[Post-Secondary Years])".

What is an AVERAGE function?

In a spreadsheet, the AVERAGE function is used to find the normal average of a list of data, such as the total list of population.

In conclusion, the function "AVERAGE(StudentRepresentatives[Post-Secondary Years])" will be used to determine the average number of years.

Read more about AVERAGE function

brainly.com/question/2263994

Create a python program that will input their name and their age. It will show an output "Hi, {name} ! How are you? I know you are {age} old."

I WILL MARK YOU AS BRAINLIEST​

Answers

Answer:

age = 10

name = Cynthia

make an f string so the variables appear in the string. There are other ways to do this but I prefer f strings instead of using string concatenation. It causes problems adding 2 strings together most of the time.

print(f'Hi, {name} ! How are you? I know you are {age} old.')

Name three reasons why computers use both integers and real numbers

Answers

Answer:

Precision, readability, and appropriateness

convert 34.657 to binary and also 25.75 to binary

Answers

Answer:

34.657=100010.1010100000110001001 base two

25.75  =11001.11

please give all the answer​

Answers

Change the vowel ::--

swam got ran woke roderosesang came gave knew blew drank wrote drew sat slept kept swept bought brought taught thought

Which is an advantage of a computer network?
A. Networked computers can process data and run software faster than single computers.
B. Networks prevent unauthorized access to data and protect equipment.
C. Networked computers are less likely than single computers to suffer equipment failure.
D. Networks allow computers to connect quickly and to share data or equipment.

Answers

D. is the answer.............

What is an object? Give five examples of real world objects.

Answers

Answer:

things u can touch

Explanation:

paper

pen

eraser

table, metal

one example of requirement verification techniques

Answers

Answer:

The four fundamental methods of verification are Inspection, Demonstration, Test, and Analysis. The four methods are somewhat hierarchical in nature, as each verifies the requirements of a product or system with increasing rigor.

Explanation:

A virus is NOT a software * True or False​

Answers

Answer:

false

Explanation:

Create a class RightTriangle which implements the API exactly as described in the following JavadocLinks to an external site..

Don't forget - you will need to use the Pythagorean theorem (Links to an external site.) to find the hypotenuse (and therefore the perimeter) of a right triangle. You can find the area of a right triangle by multiplying the base and height together, then dividing this product by 2.

Use the runner_RightTriangle file to test the methods in your class; do not add a main method to your RightTriangle class.

Hint 1 - Javadoc only shows public methods, variables and constructors. You will need to add some private member variables to your RightTriangle class to store the necessary information. Think carefully about what information actually needs to be stored and how this will need to be updated when methods change the state of a RightTriangle object.

Hint 2 - As in the previous lesson's exercise it's helpful to add your method/constructor headers and any dummy returns needed before implementing each one properly. This will allow you to test your code using the runner class as you go along.

This is the runner code:

import java.util.Scanner;

public class runner_RightTriangle{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
RightTriangle t = new RightTriangle();
String instruction = "";
while(!instruction.equals("q")){
System.out.println("Type the name of the method to test. Type c to construct a new triangle, q to quit.");
instruction = scan.nextLine();
if(instruction.equals("getArea")){
System.out.println(t.getArea());
}
else if(instruction.equals("getBase")){
System.out.println(t.getBase());
}
else if(instruction.equals("getHeight")){
System.out.println(t.getHeight());
}
else if(instruction.equals("getHypotenuse")){
System.out.println(t.getHypotenuse());
}

else if(instruction.equals("getPerimeter")){
System.out.println(t.getPerimeter());
}
else if(instruction.equals("toString")){
System.out.println(t);
}
else if(instruction.equals("setBase")){
System.out.println("Enter parameter value:");
double arg = scan.nextDouble();
t.setBase(arg);
scan.nextLine();
}
else if(instruction.equals("setHeight")){
System.out.println("Enter parameter value:");
double arg = scan.nextDouble();
t.setHeight(arg);
scan.nextLine();
}
else if(instruction.equals("equals")){
System.out.println("Enter base and height:");
double bs = scan.nextDouble();
double ht = scan.nextDouble();
RightTriangle tOther = new RightTriangle(bs, ht);
System.out.println(t.equals(tOther));
scan.nextLine();
}
else if(instruction.equals("c")){
System.out.println("Enter base and height:");
double bs = scan.nextDouble();
double ht = scan.nextDouble();
t = new RightTriangle(bs, ht);
scan.nextLine();
}
else if(!instruction.equals("q")){
System.out.println("Not recognized.");
}
}
}
}

My code so far:

class RightTriangle{
private double base;
private double height;
public RightTriangle(){
base = 1.0;
height = 1.0;
}
public RightTriangle(double ds, double ht){
base=ds;
height=ht;
}
public boolean equals​(RightTriangle other){
if(base==other.base && height==other.height ){
return true;
}
else
{
return false;
}
}
public double getArea()
{
return (base*height)/2;
}
public double getBase(){
return base;
}
public double getHeight()
{
return height;
}
public double getHypotenuse()
{
return Math.sqrt((base*base)+(height*height));
}
public double getPerimeter()
{
return base+height+Math.sqrt((base*base)+(height*height));
}
void setBase (double bs)
{
if(bs==0){
System.exit(0);
}
else{
base=bs;
}
}
public void setHeight(double ht){
if(ht==0){
System.exit(0);
}
height=ht;
}
public java.lang.String toString()
{
return "base: "+base+" hegiht: "+height+" hypothesis: "+ Math.sqrt((base*base)+(height*height));
}

}

MY CODE SAYS THAT THE setHeight and setBase and toString METHODS ARE INCORRECT.

Answers

Answer:

I don't see anything. Its blank

Explanation:

( _____)once demonstrated that a rigid wing on an aircraft would break more often than a flexible wing. Will give BRAINLIEST.

Answers

Answer:

the Wright brothers

Explanation:

Wing warping was an early system for lateral (roll) control of a fixed-wing aircraft. The technique, used and patented by the Wright brothers, consisted of a system of pulleys and cables to twist the trailing edges of the wings in opposite directions.

Answer:

the Wright Brothers

Explanation:

I know

In other programming languages, the dictionary data structure is referred to as a(an)

Answers

Answer:

hash

Explanation:

it is called a hash, a map, or a hasmap

A dictionary is a data structure for storing items. Languages such as JavaScript refer to dictionaries as objects. They're all key-value stores.

This project was used to drive the VR Robot to number 25 on the Number Grid
*
Map, but it does not work correctly. What is the error?
.
The VR Robot should drive in reverse first
Wait until position Yin millimeters (mm) should be GREATER than 500.no LESS
than
Wait una position Xin millimeters() should be less than 100, no CREATER
than
O
The Stop driving blocks are not needed

Answers

Answer:

B Wait until position y in millimeter should be greater than 500 at least im guessing because you didnt add what the map looked like, making my job MUCH harder

Explanation:

14. My computer “boots-up” (aka activates and starts running) but it tells me that it cannot find the data to start the operating system, and I hear a subtle clicking noise coming from my computer. What physical component of the computer do you believe is defective? Defend your answer.

Answers

For this computer, the hard drive is the physical component that is defective.

What is a physical component?

A physical component can be defined as a component (hardware) of an computer system or information technology (IT) that can be seen and touched.

The physical components of a computer.

Some examples of the physical components of a computer system include:

MotherboardCentral processing unit (CPU)KeyboardMonitorMouseHard drive

The hard drive refers to an electromagnetic data storage device that is typically used for storing and retrieving digital data such as an operating system (OS) on a computer system.

Generally, a computer would make a subtle clicking noise when it finds it difficult to read or retrieve the data stored on its hard drive.

Read more on physical components here: brainly.com/question/959479

Why do we use for loops with arrays?
Group of answer choices

For loops let us access one specific element of an array.

Lets us quickly process contents of the array.

To store one piece of data at a time.

For loops let Python handle the values as strings not numbers.

Answers

B. Let’s us quickly process contents of the array

what is computer/why it is called data processor

Answers

Answer:

Computer is known as data processor because it processes the data. First the data is inserted in the computer through input devices. After that, computer translate the data in its own language and then the computer takes action according to the instructions given to the computer

Pick the correct statements on the 64-bit machine representation of numbers.

The relative error in any elementary arithmetic operation is bounded above by machine precision.
Most of the decimal numbers are concentrated around zero.
Division by small numbers in an iterative process is a potential source of instability.
There are as many numbers between 1 and 2 as there are between 3 and 4.
Machine precision epsilon is the smallest decimal number that could be represented on the computer.

Answers

Answer:Floating-point arithmetic is considered an esoteric subject by many people. This is rather surprising because floating-point is ubiquitous in computer systems. Almost every language has a floating-point datatype; computers from PCs to supercomputers have floating-point accelerators; most compilers will be called upon to compile floating-point algorithms from time to time; and virtually every operating system must respond to floating-point exceptions such as overflow. This paper presents a tutorial on those aspects of floating-point that have a direct impact on designers of computer systems. It begins with background on floating-point representation and rounding error, continues with a discussion of the IEEE floating-point standard, and concludes with numerous examples of how computer builders can better support floating-point.

Explanation:

What are two things to consider when linking pages in your website? How are your decisions about absolute and relative URLs affect the reliability of your links?

Answers

The two (2) things to consider when linking webpages in your website include:

The names of the hyperlink.The proper use of anchor text.

What is a hyperlink?

A hyperlink can be defined as an element in a hypertext markup language (HTML) document such as a website, which provides a direct access or link to another HTML document, webpage, location, and image.

Basically, a hyperlink links to the same webpage in a hypertext markup language (HTML) document such as a website.

The things to consider when linking webpages.

In Web design, the two (2) things to consider when linking webpages in your website include:

The names of the hyperlink: it should be the same as the webpage name that is being linked to.The proper use of anchor text: it is more advisable to use anchor text rather than linked images.

An absolute URL contains all the information (protocol and domain name) that are needed to locate a resource while a relative URL can only locate a resource by using an absolute URL as a starting point because it doesn't contain any protocol.

In conclusion, an absolute URL helps to improve and enhance the reliability of your links because it contains the entire information that are needed to locate a resource.

Read more on absolute URL here: https://brainly.com/question/23338043

what is the numeric value of 19%(2+3) as evulated by Java

Answers

Answer:

4

Explanation:

java does parenthesis first then mod so it will do 2+3 which is 5 then 19 mod 5 which is 4(5 goes in evenly 3 times for a total of 15. Mod is the remainder number meaning that 19-15 = 4).

Write a program that does the following:

You will make a program that registers the maximum TEMPERATURE that is registered during the WEEK (that is, every day, that is, 7 days).

You must at the end show/print the number of temperatures that were HOT (May or equal to 25 degrees) and those that were COLD (less than or equal to 10 degrees)

The program MUST have DO WHILE and IF.






IN JAVA SCRIPT AND PLEASE SEND THE CODE IN THE COMMENTS

Answers

Answer:

Mean maximum temperature is measured by taking maximum temperatures and add them up and divide again by as many as the mean highest temperatures you added up. One measures the mean of only highest temperatures and the other the average of all high temperatures.

Explanation:

Given the user inputs, complete a program that does the following tasks: Define a set, fruits, containing the user inputs: my_fruit1, my_fruit2, and my_fruit3. Add the user inputs, your_fruit1 and your_fruit2, to fruits. Add the user input, their_fruit, to fruits. Add your_fruit1 to fruits. Remove my_fruit1 from fruits. Observe the output of each print statement carefully to understand what was done by each task of the program. Note: For testing purposes, sets are printed using sorted() for comparison, as in the book's examples. Ex: If the input is:

Answers

The program is an illustration of sets in a python program

What are sets?

Sets are variables that hold multiple values in a program

The main program

The program written in Python, where comments are used to explain each line is as follows:

my_fruit1 = input()

my_fruit2 = input()

my_fruit3 = input()

your_fruit1 = input()

your_fruit2 = input()

their_fruit = input()

# 1. TODO: Define a set, fruits, containing my_fruit1, my_fruit2, and my_fruit3

fruits = {my_fruit1, my_fruit2, my_fruit3}

print(sorted(fruits))

# 2. TODO: Add your_fruit1 and your_fruit2 to fruits

fruits.add(your_fruit1)

fruits.add(your_fruit2)

print(sorted(fruits))

# 3. TODO: Add their_fruit to fruits

fruits.add(their_fruit)

print(sorted(fruits))

# 4. TODO: Add your_fruit1 to fruits

fruits.add(your_fruit1)

print(sorted(fruits))

# 5. TODO: Remove my_fruit1 from fruits

fruits.remove(my_fruit1)

print(sorted(fruits))

Read more about python programs at:

https://brainly.com/question/26497128

Amazon Web Services (AWS) has several data centers which have multiple processors that perform computations.

a. True
b. False

Answers

There is several data centers associated with Amazon Web Services (AWS) and this contain multiple processors that perform computations.

What is a data center?

A data center serves as a building that house computer systems as well as associated components for data processing. These center helps in telecommunications and storage systems.

In Amazon Web Services, these data centers contains multiple processors which is been used in computations. The processor is usually sequence with their IDs.

Learn more about data center  at;

https://brainly.com/question/25605883

why are men more exposed to mass media?

Answers

Answer:

because they like exploring

I hope this helps :) it should give an idea on how to answer your question!
Other Questions
the sum of ten times a number and 12 2) Choose the best answer.Find the volume of this terrarium. You may use a calculator to find the answer.l = 5 m, w = 1 m, h = 3 mA. 30 m2B. 15 m3C. 5 m2D. 7.5 m3E. 9 m3pPelz I really really need help:( All of the following describe blockchain: Multiple select question. blockchain cannot verify and facilitate Bitcoin transactions blockchain makes it more difficult for the ledger to be modified blockchain is continuously and simultaneously updated and verified blockchain is a less secure type of accounting ledger Write five things you have to do when you were younger, but dont have to do now. Someone can help me please?? when a number is increased by 9.5% the result is 58 what is the original number to the nearest tenth? Question 2 (1 point) Name ALL the reasons people traveled west on the Oregon trail.Question 2 options:A) land was readily available and people could be property ownersB) farmers could grow many types of cropsC) ranchers could raise animalsD) there was gold in Oregon GIVING OUT BRAINLIEST TO THE PERSON WHO ANSWERS CORRECTLYMembers of the Second TriumvirateLepidusSullaMark AntonyOctavianJulius CaesaSays the correct answer: FIRST = Brainliest, Thanks, 5 stars, and praise.Correct answer: Thanks, 5 stars, and praise.Incorrect answer: 2 stars (Nothing personal).Odd answer like: GPUO:FYG: 1 star and report.Links: 1 star and report. EASY!!! What is (8+4)+24 / 2^3 What is the slope of the line that passes through the points (6,-5) and (6,-4)?Write your answer in simplest form. Genetic engineering of agricultural crops has primarily increased the productivity of modern farming by. A leader is best when people barely know he exists, when his work is done, his aim fulfilled, they will say: we did it ourselves. was said by who? 3 rhombi are connected at a point, side by side. All sides are congruent. Juan is making a model out of rhombi. Each rhombus will be connected to the one before it. Each rhombus will be 6 inches tall and 4 inches wide. How much paper does he need for each rhombus? square inches If his wall is 11 feet long, how much paper does he use? square inches. Puzzle ThreeIn order to complete the following puzzle you will need to use youranswers to fill in the questions that follow. For example your answer tonumber one you will have to fill in for number two and so on. Be sure totake your time as one mistake will mess up the entire puzzle.1) (152 - 10) =x2)(4x - 5) + 2x =3) 7x +x - 2x -x=X4) - 20x + 4) + 5x =x-5) - (x+12) + 2(3x + 4) = x -Code: Find the mean of the following:Mithin the 2019Your answerThis is a required question For each different higher-pitched sound we hear, hair cells bend the most at different locations on the basilar membrane in the cochlea. This statement describes the ____ A repeated line throughout the musical is Im not throwing away my shot. Consider what weve learned about Abigail Adams and Angelica Schuyler. In what ways does this line apply to each woman? Use text evidence from Adams' letter and "The Schuyler Sisters" to support your answer What would happen if the weather became very calm and the wind was not blowing for a few days around the wave hub?PLEASE ANSWER ILL GIVE BRAINLIEST !!!!! Whats the correct answer for this question? Calcium-49, a radioactive isotope, has a half-life of 9 minutes. If an 80-gram sample of the isotope decays for 27 minutes, how many grams of the original sample remain?Select one:a. 60b. 10c. 40d. 20 What is the value of x in the figure below? In this diagram, ABD similar to CAD.