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
Why is operating system pivotal in teaching and learning
Mkey [24]

Answer:

Kindly see explanation

Explanation: The operating system is a huge part of a computer system which plays a an invaluable role in the working of computer programs, hardwares and influences the overall experience of the user. It operating system serves as the interface between the computer hardware itself and the user who may wish to perform different tasks using a computer. In other to teach and learn, it is necessary to input and also obtain output, store our files and process and most essentially one may need to install application programs or softwares, all these functions are made possible with the help of an operating system. In essence, a system without an operating system can perform very little to no function at all. So basically teaching and learning becomes difficult. Teaching and Learning tools such as video, writing and other application softwares cannot be installed without an operating system and thus teaching or learning becomes impossible in it's absence.

7 0
3 years ago
Using selection sort, how many times longer will sorting a list of 40 elements take compared to a list of 5 elements
Hoochie [10]

It will take 8 times more time to sort a 40-element list compared to the time spent on a 5-element list.

We can arrive at this answer as follows:

  • We can see that if we divide a group of 40 elements into groups containing 5 elements, we will have 8 groups.
  • In this case, the time it would take to sort the list of one group of 5 elements would be repeated 8 times so that we could sort all the groups and their elements.

Another way to do this is to divide the number 40 by 5. We would have the number 8 as a result, which indicates that we would need 8 times more time to sort a list of 40 elements, compared to a list of 5 elements.

You can get more information about lists at this link:

brainly.com/question/4757050

5 0
3 years ago
50 points!!!!!
prohojiy [21]
I would say a. correcting others' spelling and grammar.
3 0
4 years ago
Read 2 more answers
Where would you go to add fractions to a document in adobe indesign
prisoha [69]

Just select the fraction text and choose Open Type > Fractions from the Character panel menu.

5 0
3 years ago
Which computer is the fastest to process complex data?
Andreas93 [3]

Answer:

D. 2.6 GHz processor, 8 GB RAM, 1 TB hard drive

Explanation:

In Computer science, the processor speed of a computer can be defined as the number of cycles per seconds that the central processing unit (CPU) of a computer operates. The processor speed typically determines the number of information that a computer is able to execute per seconds. Therefore, the higher or faster the processor speed the faster the computer in processing complex data.

Generally, the processor speed of a computer is measured in megahertz (MHz) or gigahertz (GHz).

Additionally, Radom Access Memory (RAM) can be defined as the main memory of a computer system which allow users to store commands and data temporarily. RAM is measured in megabytes (MB) or gigabytes (GB).

Generally, the Radom Access Memory (RAM) is a volatile memory and as such can only retain data temporarily.

All software applications temporarily stores and retrieves data from a Radom Access Memory (RAM) in computer, this is to ensure that informations are quickly accessible, therefore it supports read and write of files.

Hence, the computer which is the fastest to process complex data is the 2.6 GHz processor, 8 GB RAM, 1 TB hard drive because of the higher processor speed and RAM size.

7 0
3 years ago
Other questions:
  • The security administrator for PLABS.com recommends using a host-based firewall for all servers and workstations. What can a hos
    6·1 answer
  • Write a Java program that generates a random number between 0 and 50. Then, the program prompts for guesses until the user is co
    14·1 answer
  • Su wants to apply the new font to the other slides of the presentation. She knows she can use the Format Painter tool
    12·1 answer
  • The economist George gilder argued that
    6·1 answer
  • Ron travels extensively. He posts articles, photos, and videos about his experiences on a website. Which type of electronic comm
    9·1 answer
  • "Common knowledge" must always be credited or else it is considered plagiarism?<br> True<br> Fales
    5·1 answer
  • You recently created several new user accounts in the Sales OU and configured them with the appropriate group membership, logon
    12·1 answer
  • Which components can be added to a lightning app on custom object (choose 3 answers)A. Visualforce B. Standard Lightning compone
    6·1 answer
  • What is a filter in excel (please keep your answer brief)
    11·1 answer
  • A user wants to print a spreadsheet horizontally on a piece of paper instead of vertically to fit more columns on a single page.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!