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
vfiekz [6]
4 years ago
8

2.Write an if /else if statement that carries out the following logic. If the value of variable quantityOnHand is equal to 0, di

splay the message ''Out of stock''. If the value is greater than 0, but less than 10, display the message ''Reorder ''. If the value is 10 or more do not display anything.
Computers and Technology
1 answer:
Oliga [24]4 years ago
5 0

Answer:

if(quantityOnHand == 0) { cout<<"Out of stock"; }

else if(quantityOnHand > 0 && quantityOnHand <10) { cout<<"Reorder "; }

else if(quantityOnHand >= 10){ }

See Explanation for comments

Explanation:

//This program segment is written in C++

//Only required segment is written

// Comments are used for explanatory purpose

// Program Segment starts here

/*

The following condition tests if quantityOnHand equals 0

If this condition is true, the program prints "Out of stock" without the quotes

*/

if(quantityOnHand == 0) { cout<<"Out of stock"; }

/*

The following condition tests if quantityOnHand  is greater than 0, but less than 10

If this condition is true, the program prints "Reorder " without the quotes

*/

else if(quantityOnHand > 0 && quantityOnHand <10) { cout<<"Reorder "; }

/*

The following condition tests if quantityOnHand  is greater than o equal to 10

If this condition is true, nothing is done

*/

else if(quantityOnHand >= 10){ }

// End of program segment

Assumption: <em>The program assumes that variable </em>quantityOnHand has already been declared

You might be interested in
Difference between batabse and database management system
adelina 88 [10]

Answer:A database is an organized collection of structured information, or data, typically stored electronically in a computer system. A database is usually controlled by a database management system (DBMS). ... The data can then be easily accessed, managed, modified, updated, controlled, and organized.

Explanation:A database could be grades that students get at school and to manage it we can use a spreadsheet program like excel

4 0
3 years ago
What is the largest place value in a 12 bit binary number?
azamat
The largest binary number that can be expressed with 12 bits is all 1s, which means 1 followed by 1 followed by 1, up to 12 times.
6 0
3 years ago
This type of website, supporting collaborative writing, is designed to allow visitors to use their browser to add, edit, or dele
Daniel [21]
It would be Wiki......
8 0
4 years ago
Explain why blocking ping (ICMP echo request) packets at an organization's edge router is not an effective defense against ping
tresset_1 [31]

Answer:

The blocking ping is not effective in an organization because it may required ping echo message from some trusted system. the best method will be to do the filtering of incoming echo ICMP messages.

In systems we have ping utility, that is based on ICMP protocol. Its function is  to check the end to end connectivity of the system.

In this case a  fist all an echo ICMP message is send to the host then host reply with ICMP message. to defend yourself from this flood attack, we need to filter the incoming echo ICMP packet messages. a net filter can be used to achieve it.

The best method be to applied is the firewall having a net filter with limit setting or any intrusion system. In market we have various firewall and intrusion system available to do so.

Explanation:

Solution

Ping Flood Atack:

In this attack the main of the attacker is to saturate the system with ICMP for example (internet control message protocol) traffic. as you have saturated the system, it will have less CPU time to serve others.

Defence against this attack:

In our systems we have ping utility, that is based on ICMP protocol. Its used to check the end to end connectivity of the system. here fist all an echo ICMP message is send to the host then host reply with ICMP message. to defend yourself from this flood attack , we need to filter the incoming echo ICMP packet messages. a Net filter can be used to achieve this.

The best way will be to used the firewall having net filter with limit setting or any intrusion system. In market we have various firewall and intrusion system available to do so.

Blocking ping packets to avoid ping flood attack:

Its not a good approach to block ping packets. because you may required ping echo message from some trusted system. The best option will be to do the filtering of incoming echo ICMP message.

6 0
4 years ago
Define ROM and list the types of read only memories.
Lorico [155]

Answer:

Read-only memory, also known as ROM, is a storage medium used in computers and electronic devices, which allows only the reading of information and not its writing, regardless of the presence or not of an energy source.

The data stored in the ROM cannot be modified, or at least not quickly or easily. It is mainly used to contain firmware (a program that is closely linked to specific hardware, and is unlikely to require frequent updates) or other vital content for device operation, such as programs that start up the computer and perform diagnostics.

There are three types of ROM memories: PROM. EPROM, and EEPROM.

6 0
3 years ago
Other questions:
  • A range of cells can be converted into an Excel ________ so that the data can be analyzed
    7·1 answer
  • How do I attach a file on the computer?
    13·1 answer
  • Write a program named ArrayDemo that stores an array of 10 integers. (Note that the array is created for you and does not need t
    14·1 answer
  • What is the manufacturer’s specific ID for Intel Core?
    7·1 answer
  • How should resumes and cover letters be written to help you obtain a job that meets your
    14·1 answer
  • How to do row of circles in phyton programming ?
    11·1 answer
  • Use the drop-down menus to match the description to the correct audio-editing technique or term. deleting unwanted sounds increa
    14·2 answers
  • #include
    12·1 answer
  • Suppose we want an error correcting code that will allow all single-bit errors to be corrected for memory words of length 15. 1.
    5·1 answer
  • In Python, when do we use the str( ) function
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!