1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
trapecia [35]
3 years ago
12

Write the C++ if statement that compares the contents of the quanity variable to the number 10. If the quantity variable contain

s a number that is equal to 10, display the string "Equal". If the quantity variable contains a number that is greater than 10, display the string "Over 10". If the quantity variable contains a number that is less than 10, display the string "Not over 10".
Computers and Technology
1 answer:
Rus_ich [418]3 years ago
8 0

Answer:

#include <iostream>

using namespace std;

int main

{

//Declare variable quantity

int quantity;

//Accept value for Quantity

cin>>quantity;

//Compare variable quantity with 10

if(quantity == 10)

{

cout<<"Equal";

}

else if(quantity > 10)

{

cout<<"Over 10";

}

else

{

cout<<"Not over 10";

}

return 0;

}

Explanation:

The above is a full c++ Program that does executes the instructions in the question.

Lines that starts with // are comments and they are ignored during program execution.

Variable quantity was declared as integer because the number to be compared with (10), is an integer.

Before comparison, the program must accept input. This was shown with the statement "cin>>quantity;"

For each comparison statement, if it's true, the statement within the curly braces {} will be executed.

Comparison of variable quantity with 10 starts at "if(quantity == 10)"

If quantity equals 10, then "Equal" will be printed (without the quotes)

if(quantity>10) means if quantity is greater than 10 and this will print "Over 10", if it's true (without the quotes)

The last comparison statement

"else {"

This will print "Not over 10" (without the quotes) if the first 2 comparison statements are not true.

You might be interested in
What is the iterative procedure of recursive and nonrecursive?
DanielleElmas [232]

Answer:

nonrecursive

Explanation:

3 0
3 years ago
Ryan is looking to buy a new HDTV set. He knows from friends that LCD set screens reflect less light than plasma set screens, bu
lbvjy [14]

Answer: Cognitive

Explanation:

 According to the question, the Ryan shows cognitive attitude towards the HDTV. The cognitive component basically refers to the three main components that are:

  • Thoughts
  • Beliefs
  • Attributes

The cognitive component is one of the type of attitude which basically consist of various types of thoughts, knowledge and the beliefs towards the any type of object. It is one of the belief and opinion of the attitude.  

3 0
3 years ago
2min speech on can teachers be replace by technology​
elena-s [515]

Answer:

The boom of online courses, where anyone can learn from the comfort of one’s own home or office at their own chosen time is the main cause. When online courses made their foray a decade ago, the same question of technology replacing teachers in schools emerged as a major argument. However, if we ask you today whether calculators can replace mathematics teachers at school, what would you say? Sounds weird, right! Do you think calculators which are also a kind of a technological advancement only, are capable enough of themselves, so as to replace the teachers? The answer is obvious. It’s an obvious No!

6 0
3 years ago
Your boss is trying to modify a PDF file that he made a year ago. He asks you what he can use to do this. Which of the selection
Masteriza [31]
The answer is b. Office 2013
3 0
3 years ago
Read 2 more answers
Selecting the Tiled windows arrangement option places the windows in a(n) _______ pattern on the screen.
Archy [21]

Answer:

Selecting the Tiled windows arrangement option places the windows in a(n) Grid pattern on the screen.

Explanation:

3 0
2 years ago
Other questions:
  • Write a program that prompts the user to enter the month and year and displays the number of days in the month. For example, if
    13·1 answer
  • In your own words explain how to add footer and head in a word doc.
    10·1 answer
  • A company has critical systems that are hosted on an end-of-life OS. To maintain operations and mitigate potential vulnerabiliti
    14·1 answer
  • Anyone have an answer for 4.9 lesson code practice
    9·1 answer
  • What is the process of adding random characters at the beginning or end of a password to generate a completely different hash ca
    10·1 answer
  • Write a method named lastIndexOf that accepts an array of integers and an * integer value as its parameters and returns the last
    15·1 answer
  • Do pc players ever go outside?
    11·2 answers
  • ________ was one of the first uses of the Internet
    15·2 answers
  • Mention how to install antivirus software in your computer, either by following the instructions given on installation CDs or we
    6·1 answer
  • The people on this platform are unbelievably nice. its almost rare to see this type of kindness online these days. Just wanted t
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!