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
  • Assume you have already declared and initialized a variable named number as seen here: number =...

    Assume you have already declared and initialized a variable named number as seen here: number = 1 This list contains 10 potential assignment statements that will give the variable named number a value of 4. Select all the LEGAL ways to do this. Assume that these other variables also exist and have been initialized as seen here: value = 4 count = 2 Group of answer choices number = count + number * 2 4 = number number == count...

  • 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...

  • 4. RetailItem Class Write a class named RetailItem that holds data about an item in a...

    4. RetailItem Class Write a class named RetailItem that holds data about an item in a retail store. The class should have the following fields: • description. The description field references a String object that holds a brief description of the item. • unitsOnHand. The unitsOnHand field is an int variable that holds the number of units currently in inventory. • price. The price field is a double that holds the item’s retail price. Write a constructor that accepts arguments...

  • Write a python program that stores a random number from 0-99 in a variable named target...

    Write a python program that stores a random number from 0-99 in a variable named target (this part is provided). Note that target will not be further updated in the program. The program then accepts user input and stores it in a variable named guess. You may assume that the user only enters integers. The program ends when guess is equal to target otherwise the program continuously asks the user to provide a guess. Output Correct after x trial! when...

  • 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

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