Question

Suppose you have a variable named quantity that holds a number. Provide an if statement heading...

Suppose you have a variable named quantity that holds a number. Provide an if statement heading that checks to see whether quantity holds a whole number.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

whole numbers is a set of number starting from 0,1,2.... and so on.

int quantity;
if(quantity>=0)
cout<<"Quantity holds a whole number";
else
cout<<"Quality does not hold a whole number";

if you like the answer please provide a thumbs up.

Add a comment
Know the answer?
Add Answer to:
Suppose you have a variable named quantity that holds a number. Provide an if statement heading...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Write a C# program named Miles-ToEest that declares a named constant that holds the number of...

    Write a C# program named Miles-ToEest that declares a named constant that holds the number of feet in a mile: 5280. Also declare a variable to represent the distance in miles between your house and your uncle's house. Assign an appropriate value to the variable-for example, 8.5. Compute and display the distance to your uncle's house in both miles and feet. Display explanatory text with the values-for example, The distance to my uncle's house is 8.5 miles or 44880 feet....

  • Write the C++ if statement that compares the content of the quantity variable to the number...

    Write the C++ if statement that compares the content of the quantity variable to the number 10. If the quantity variable contains a number that is greater than 10, display the string "Over 10"; otherwise display the string "Not over 10".

  • 6. Code a statement that assigns the value “Test” to a scalar variable named (can not...

    6. Code a statement that assigns the value “Test” to a scalar variable named (can not insert the at sign, but it should be here)Name that’s declared with the varchar data type. 8. A parameter passes a value from the calling program to the stored procedure, unless you code the ______________________________ keyword. 9. Unless a database system supports declarative referential integrity, the only way to enforce referential integrity is to use ______________________________. 10. Code a statement that returns the value...

  • MATLAB QUESTION Suppose you were writing a program for a tic-tac-toe routine, in which you had a variable named board th...

    MATLAB QUESTION Suppose you were writing a program for a tic-tac-toe routine, in which you had a variable named board that was supposed to be the 3-by-3 array of the game board. Write a matlab script with the filename tictactoe.m that checks that board is indeed a 3-by-3 array. If it is not, your script throws an error with an appropriate error message.

  • You are given an array named digits of digitCapacity that holds the individual digits of a...

    You are given an array named digits of digitCapacity that holds the individual digits of a very large number in such a way that the least significant digit of any given number is located at element index zero The number of valid digits in the array is held by a variable named digitNumber. All the values above digitNumber elements are always zero, no matter how large the array itself is. However, some transactions cause the digitNumber to misrepresent the correct...

  • Write a class named Month. The class should have an int field named monthNumber that holds...

    Write a class named Month. The class should have an int field named monthNumber that holds the number of the month. For example. January would be 1. February would be 2. and so forth. In addition, provide the following methods A no-arg constructor that sets the monthNumber field to 1 A constructor that accepts the number of the month as an argument. It should set the monthNumber field to the value passed as the argument. If a value less than...

  • Need Java Code for this Algorithm Workbench question: Suppose we have a stylesheet named styles.css, and...

    Need Java Code for this Algorithm Workbench question: Suppose we have a stylesheet named styles.css, and in our Java code the scene variable references the Scene object. Write a statement to add the stylesheet to the scene. Ratings will be given, and comments. Thanks

  • Suppose you have the information shown in the table below about the quantity of a good...

    Suppose you have the information shown in the table below about the quantity of a good that is supplied and demanded at various prices. Price (S) Quantity demanded Quantity supplied 50 40 30 20 10 20 40 60 80 180 140 100 60 20 a. Draw the demand and supply curves from the data provided. Instructions: Round your answers to the nearest whole number and include a negative sign if appropriate. b. The equilibrium price is $. and the equilibrium...

  • (Classes and Objects) Design a class named Box. The class should have the following private members:...

    (Classes and Objects) Design a class named Box. The class should have the following private members: width - A double member variablethat holds the width of the box. length – A double member variable for holding the length of the box. height – A double member variable of type double that holds the height of the box. In addition, provide the following member functions with full (inline) implementation. a) A default constructor that sets all member variables to 0. b)...

  • 1.The code box below includes a live 2 dimensional array variable called gridNums. This array holds...

    1.The code box below includes a live 2 dimensional array variable called gridNums. This array holds integers. You cannot see its declaration or initialization. What value is in the zeroth (initial) position of the second row? Print this array entry to the console. (Note: remember that the second row is actually row 1). Enter your code in the box below. 2.The code box below includes a live 3x3 2-dimensional array variable called fredsNums. This array holds integers. You cannot see...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT