Computers and Technology
Computers and Technology, 20.09.2020 17:01, smolemily

Need help with this C++ question Step 1: Add the follow ing lab6.cpp program. Here is a copy of the source code 2// This program determines the fee for a cat or dog pet tag. 3 // It uses nested if/else statements. 4 // PUT YOUR NAME HERE. 5 #include 6 #include 7 using namespace stod; 9 int main0) 10 string pet; "cat" or "dog 12 char spayed; l'y' or n 13 14 I/Get pet type and spaying information 15 cout <<"Enter the pet type (cat or dog): " 16 cin >> pet; 17 cout <<"Has the pet been spayed or neutered (y/n)?" 18 cin >>spayed; 19 20 / Determine the pet tag fee 21 if (pet--"cat") 22 if (spayed 'y) 23 cout<< "Fee is $4.00 n"; 24 else 25 cout<< "Fee is $8.00 n"; 26 27 else if (pet "dog") 28 if (spayed 'y) 29 cout<<"Fee is $6.00 In"; 30 else 31 out<<"Fee is $12.00 In"; 33 else 34 cout<<"Only cats and dogs need pet tags. In" 35 36 return 0;
Step 2: Compile the program and then run it 7 times. For each run use the input test data shown in the table below and write down the fee information that is displayed. Indicate whether or not the displayed information seems to be correct or not. Run Input data FeIformation Correct? cat y cat n cat Y 4 6 dog Y hamster n
Step 3: Improve the program in the following two ways. Use a logical OR on lines 22 and 28 so that either a lowercase 'y' or an uppercase 'Y is accepted. Currently when an animal other than a cat or dog is entered (such as a hamster), the program asks if it is spayed or neutered before displaying the message that only cats and dogs need pet tags. Find a way to make the program only execute the spay/neuter prompt and input when the pet type is cat or dog. Step 4: Recompile your revised previous table. Make sure it works correctly for all 7 cases. program and test it with the same 7 test cases given in the previous table. Make sure it works correctly in all 7 cases

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 18:00, rajenkins79
What is stored in str after the following code executes? string str = "computer science"; int i = 0; while (i < 8) { if (str. indexof("m") < i) { str = str. substring(0, 2) + str; } i += 2; } computer science cocomputer science cococomputer science cocococomputer science computer scienceco
Answers: 3
image
Computers and Technology, 21.06.2019 20:50, Lydiac9243
Write a method in the heapintpriorityqueue class called merge that accepts another heapintpriorityqueue as a parameter and adds all elements from the other queue into the current queue, maintaining proper heap order such that the elements will still come out in ascending order when they are removed. your code should not modify the queue passed in as a parameter. (recall that objects of the same class can access each other's private fields.)
Answers: 2
image
Computers and Technology, 22.06.2019 15:50, minideeri
The file sales data. xlsx contains monthly sales amounts for 40 sales regions. write a sub that uses a for loop to color the interior of every other row (rows 3, 5, etc.) gray. color only the data area, columns a to m. (check the file colors in excel. xlsm to find a nice color of gray.)
Answers: 2
image
Computers and Technology, 22.06.2019 21:30, Tcareyoliver
The salespeople at hyperactive media sales all use laptop computers so they can take data with them on the road. you are a salesperson for superduper lightspeed computers talking to hyperactive media sales about upgrading the laptops to windows 10. explain how network location awareness in windows 10 would make the laptops more secure.
Answers: 3
Do you know the correct answer?
Need help with this C++ question Step 1: Add the follow ing lab6.cpp program. Here is a copy of the...

Questions in other subjects:

Konu
Mathematics, 06.10.2019 16:10