Write a complete C++ program that asks the user to enter their age and the number...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a complete C++ program that asks the user to enter their age and the number of pets that they have at home. A legal age must be between 1 and 100 (inclusive). If the user enters an illegal age the program should print I don't believe you! Otherwise if the number of pets is divisible by the age (without a remainder) the program should print Here is a sample to show how the program runs. Enter the your age and number of pets: 20 200 That is a lot of pets. That is a lot of pets. Write a complete C++ program that asks the user to enter their age and the number of pets that they have at home. A legal age must be between 1 and 100 (inclusive). If the user enters an illegal age the program should print I don't believe you! Otherwise if the number of pets is divisible by the age (without a remainder) the program should print Here is a sample to show how the program runs. Enter the your age and number of pets: 20 200 That is a lot of pets. That is a lot of pets.
Expert Answer:
Answer rating: 100% (QA)
Based on the given requirements you want a C program that prompts the user for their age and the num... View the full answer
Related Book For
Java An Introduction To Problem Solving And Programming
ISBN: 9780134462035
8th Edition
Authors: Walter Savitch
Posted Date:
Students also viewed these programming questions
-
Alpha Company used the periodic inventory system for purchase & sales of merchandise. Discount terms for both purchase & sales are, FOB Destination, 2/10, n30 and the gross method is used. > Alpha...
-
You are required to write a Python program that will manage character (heroes and villain) information. Character (hero and villain) information will be stored in a text file that will be read in...
-
Amato is preparing a resume to apply for a higher-level management position with Amato's current company. The position Amato is applying for is in a different location from Amato's current job. What...
-
A lot of things have changed since the advent of the Internet. Communication is much different than it used to be. Consumers have a lot more access to information. But, is everything as it seems on...
-
Mapleton Enterprises Inc. is evaluating alternative uses for a three-story manufacturing and warehousing building that it has purchased for $975,000. The company could continue to rent the building...
-
Using the NORM.S.DIST function, compute the probability that a score would fall between+ 1 and +2 z scores. Remember, you don't need any raw score values because a z score of 1 is a z score of 1 is a...
-
The cash data of Big City Automotive for July 2014 follow: Big City Automotive received the following bank statement on July 31, 2014: Additional data for the bank reconciliation include the...
-
Cecilia Company reported net income of $1,400,000. The average total liabilities were $4,310,000 and average total stockholders' equity was $5,220,000. Interest expense was $102,000 and the tax rate...
-
Suppose Ann is working on a project with John. Both must decide whether to put into a decent amount of effort into the project. Since Ann is the leader of the project, her contribution determines...
-
The CFO of Spotify Inc. has summarized its free cash flows for the next three years in the following table. The cash flows are expected to grow at a constant growth rate 2.00% afterwards. The company...
-
You and your fellow team members are to assume that you have been assigned to the 2023 audit of Qantas Airways Limited. You have been asked by the audit partner, as preparation for your involvement...
-
The polynomial models for the forward rate and yield curves are not very realistic and were used near merely for illustration. A popular model for the forward rate curve and the yield curve is due to...
-
The spherically symmetric form of the diffusion equation for the dispersal of a material in a medium is given by 2 G = K (Crr + =C), where c is the concentration of the material. The associated 3D...
-
Suppose the 3 x 3 matrix A has eigenvalues A =-6, A2=-2, and A = 5. (a) Let v be randomly chosen vector in R. Set and for k> 0 set Fo= 23 Ao = xo Axo Tk+1= Ark ||AT||' i. What number do you expect A...
-
Prove the theorem with step-by-step answers and explanations: Theorem. Let a and b be integers. Then a and b are relatively prime if and only if there exist integers x and y so that ax + by 1. The...
-
Please answer in your own words. 1) List the basic steps in the recording process 2) Whats a journal and how does it contribute in the recording process 3) Whats a ledger and how does it help in the...
-
Use translations to graph f. f(x) = x-/2 +1
-
Repeat the previous programming project, but sort the Pet objects by pet weight instead of by name. After displaying the sorted data on the screen, write the number and percentage of pets that are...
-
Create a class Rational that represents a rational number. It should have private attributes for The numerator (an integer) The denominator (an integer) and the following methods: Rational(numerator,...
-
Write a program to enter employee data, including Social Security number and salary, into an array. The maximum number of employees is 100, but your program should also work for any number of...
-
Often the assumption is made that the flow of a certain fluid can be considered as incompressible flow if the density of the fluid changes by less than \(2 \%\). If air is flowing through a tube such...
-
Air enters the converging nozzle at \(T_{1}=70^{\circ} \mathrm{F}\) and \(V_{1}=50 \mathrm{ft} / \mathrm{s}\). At the exit of the nozzle, \(V_{2}\) is given by \[ V_{2}=\sqrt{V_{1}^{2}+2...
-
When a fluid flows through a sharp bend, low pressures may develop in localized regions of the bend. Estimate the minimum absolute pressure (in psi) that can develop without causing cavitation if the...
Study smarter with the SolutionInn App