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
What will be the output of the following HLOOKUP formula on the table?
shutvik [7]

Answer:

i think that the answer is 103

Explanation:

4 0
3 years ago
Read 2 more answers
Brandack is a leading manufacturer of storage devices. During a span of every five years, it produces one high-performance stora
Ede4ka [16]

Answer:

S-curve pattern of innovation

Explanation:

Based on the information being provided with regards to Brandack's business it seems that this scenario best illustrates the S-curve pattern of innovation. This is a pattern that describes a the slow rise as a new product enters the market, followed by a rapid increase in profit as the product enters it's maturity stage, and finally a constant decline in profit as it approaches the end of it's life cycle. Usually occurring when a new or updated version of the product is being introduced into the market. Which for Brandack is every five years.

If you have any more questions feel free to ask away at Brainly.

3 0
3 years ago
6.12.1: Return number of pennies in total. Write a function NumberOfPennies() that returns the total number of pennies given a n
Anit [1.1K]

Answer:

public class Pennies

{

public static void main(String[] args) {

 System.out.println("Total pennies: " + NumberOfPennies(5, 6));

               System.out.println("Total pennies: " + NumberOfPennies(5));

}

public static int NumberOfPennies(int amount, int pennies) {

    int total = (amount * 100) + pennies;

   

    return total;

}

public static int NumberOfPennies(int amount) {

    NumberOfPennies(amount, 0);

    int total = amount * 100;

   

    return total;

}

}

Explanation:

- Create a function called NumberOfPennies that takes two parameters, amount and pennies

- In order to calculate the number of pennies, multiply the given amount by 100 and add the pennies. Set this result to the total and return the total.

- Since pennies parameter should be optional, overload the function NumberOfPennies so that it can take one parameter, amount. When it takes one parameter, the value of the pennies set to 0.

Inside the main, call the function with two possible scenarios

3 0
3 years ago
What does IP stand for (as in IP address)? Also, what is overtype mode?
tino4ka555 [31]
An  IP address is mostly for your WIFI . Internet Protocol . 

Overtype Mode is where you are making changes to text (putting in new characters) 
4 0
3 years ago
A Silicon Valley billionaire purchases 3 new cars for his collection at the end of every month. Let a_n denote the number of car
Ket [755]

Answer:

a_8 =47

The cost of maintenance for 2 years is $69000

Explanation:

a.) a_0 = 23 is the number of cars at the beginning of the first month. At the end of the first month a_1 = 26 cars. This is due to the addition of extra 3 cars.

The Arithmetic Progression equation will be used to solve this question.

T(n) = a + (n-1)×d

Where

T(n) is the number of cars after n months

a is the number ofr cars at the end bbn of the first month; 26

d is the monthly car increment; 3

Substituting a and d into the equation, the equation reduces to

T(n)= 23 + 3n

For number of cars after 8 month a_8;

T(8)= 23 + 3(8)

T(8) = 47

b.) The maintenance cost at the first month is $50× 23 cars= $1150, for the second month $50 × 26 cars= $1300, for the third month $50 × 29 cars = $1450. The monthly increment is $150.

Arithmetic Progression will also be used to solve this problem.

Sm = n/2 [2a + (n-1)×d]

Where

Sn is the sum of maintenance cost for months n

a is the maintenance cost of the first month; $1150

d is the monthly increment; $150

Inserting a and d into the formula,Sn reduces to

Sn= n/2[2150 + 150n]

Inputting 24months (2 years) as n on the equation above

Sn= 24/2[2150 + 150×24]

Sn= $69000

6 0
4 years ago
Other questions:
  • A. When executing System.out.println(a1), the toString() method in the Object class is invoked.
    14·1 answer
  • Design and code a program including the following classes, as well as a client class to test all the methods coded:A Passenger c
    7·1 answer
  • Jess and Ann have decided to exchange messages using the Caesar cipher. If the predetermined key is seven places to the left, th
    10·1 answer
  • Why is stranded rather than solid cable used for patch cables? Why is it critical not to score the jacket too deeply when stripp
    12·1 answer
  • What is the output of the following code snippet? int s1 = 20; if (s1 &lt;= 20) { System.out.print("1"); } if (s1 &lt;= 40) { Sy
    6·1 answer
  • HELP ME ASAP
    13·2 answers
  • How to reload ingenuity when a pulsating blue thing is there
    11·1 answer
  • Areas on which the development of the computer as a communication technology is based
    5·1 answer
  • Void printInfo()
    8·1 answer
  • In a web application, the client uses a ___________ to interact with a web server.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!