. Else-if is good selection statement that help us to solve problems in C++,mostly times same problem of same nature can also be solved via switch statement. Which one you prefer to use and why?

Answers

Answer 1

Answer:

Else-If statements

Explanation:

Personally, I prefer using Else-If statements for conditional statements since you can start with and If statement and add to it if necessary. Aside from this, Else-If statements also allow you to add more than one condition to be met by using tags such as and or and not. Switch statements are better in scenarios where you have a set of possible inputs or results and need a specific event to happen for each input/result, but this is not as common of a scenario so Else-If is usually my go-to conditional statement.


Related Questions

java Elements in a range Write a program that first gets a list of integers from input. The input begins with an integer indicating the number of integers that follow. Assume that the list will always contain fewer than 20 integers. That list is followed by two more integers representing lower and upper bounds of a range. Your program should output all integers from the list that are within that range (inclusive of the bounds). For coding simplicity, follow each output integer by a comma, even the last one. The output ends with a newline. Ex: If the input is: 5 25 51 0 200 33 0 50 then the output is: 25,0,33, (the bounds are 0-50, so 51 and 200 are out of range and thus not output). To achieve the above, first read the list of integers into an array.

Answers

Answer:

The program in Java is:

import java.util.Scanner;

public class MyClass {

   public static void main(String args[]) {

     Scanner input = new Scanner(System.in);

     int n;

     n = input.nextInt();

     int [] mylist = new int[n+1];

     mylist[0] = n;

     System.out.print("List elements: ");

     for(int i = 1;i<n+1;i++){

         mylist[i] = input.nextInt();

     }

     int min,max;

     System.out.print("Min & Max: ");

     min = input.nextInt();

     max = input.nextInt();

     

     for(int i=1; i < mylist.length; i++){

         if(mylist[i]>=min && mylist[i]<=max){

             System.out.print(mylist[i]+" ");

 }

}

   }

}

Explanation:

This line declares length of list

     int n;

This line gets length of list

     n = input.nextInt();

This line declares the list/array

     int [] mylist = new int[n+1];

This line initializes the element at index 0 to the length of the list

     mylist[0] = n;

This prompts user for elements of the list/array

     System.out.print("List elements: ");

The following iteration gets list elements

     for(int i = 1;i<n+1;i++){

         mylist[i] = input.nextInt();

     }

This declares the lower and upper bound (min, max)

     int min,max;

This line prompts user for elements of the list/array

     System.out.print("Min & Max: ");

This next two lines get the bound of the list/array

     min = input.nextInt();

     max = input.nextInt();

The following iteration prints the elements in the range

     for(int i=1; i < mylist.length; i++){

         if(mylist[i]>=min && mylist[i]<=max){

             System.out.print(mylist[i]+" ");

 }

}

list the difference between sdram and dram​

Answers

Answer:

i need this for a challenge

Explanation:

What is the BCC feature used for?

to format email message text in a custom font
to format email message text in a blind font
to send a courtesy copy of an email to someone who does not need to take action
to send an email to someone without revealing that person’s email address to others on the distribution list

Answers

Answer:

to send an email to someone without revealing that person’s email address to others on the distribution list

Explanation:

BAM

To send an email to someone without revealing that person’s email address to others on the distribution list.

What is BCC?

"Blind carbon copy" is referred to as BCC. BCC is a similar method to CC for forwarding copies of an email to additional recipients. When CC is used, a list of recipients is shown; when BCC is used, a list of recipients is not visible.

Because the other receivers won't be able to see that the email has been forwarded to another person, it is known as a blind carbon copy.

Carbon copy is referred to as a "CC" in email communication. When there was no internet or email, you had to sandwich a piece of carbon paper between the paper you were writing on and the paper you wanted to use as your copy in order to make a copy of the letter you were writing.

Therefore, To send an email to someone without revealing that person’s email address to others on the distribution list.

To learn more about BCC, refer to the link:

https://brainly.com/question/29398332

#SPJ6

If an insurance policy covers individual losses up to $10,000 and has a deductible of
$500, the insured will be paid how much in the event of a covered loss of $5,000?

Answers

Answer: $4500

Explanation:

The deductible is the amount that the insured that is, the policy holder will have to pay. In this case, there is a covered loss of $5000 and the insured has a deductible of $500.

Therefore, the amount that the insured will be paid will be the difference between $5000 and the deductible of $500. This will be:

= $5000 - $500

= $4500

rheumatoid arthritis is caused when​

Answers

Answer:

caused by the immune system attacking healthy body tissue.

Explanation:

all though they are not sure what triggers it

Universal Container wants to understand all of the configuration changes that have been made over the last 6 months. Which tool should an Administrator use to get this information

Answers

Answer:

Set up audit trail

Explanation:

The administrator should set up an audit trail in order to get this information.

An audit trail would give him the record of all the configuration changes that have been made in a file or a database in the last 6 months.

Audit trails can be manual or electronic. It provides history and also documentation support. It can authenticate security and also help to mitigate challenges.

Other Questions
PLEASE HELP ASAP!!!!!!!!!!!!Which shared psychological traits can advertisers use to influence buying decisions? (Select all correct answers.)1. the need for belonging2. empathy toward others3. natural curiosity4. the desire to be remembered What motivated Nelson Mandela to fight for freedom in South Africa? 1. Who pays more money in taxes?1)The middle class.2)The more money you make, the more you pay in taxes.3)The less money you make, the more you pay in taxes.4) The poor. On July 1, 2016, Killearn Company acquired 110,000 of the outstanding shares of Shaun Company for $14 per share. This acquisition gave Killearn a 25 percent ownership of Shaun and allowed Killearn to significantly influence the investee's decisions. As of July 1, 2016, the investee had assets with a book value of $5 million and liabilities of $620,000. At the time, Shaun held equipment appraised at $308,000 above book value; it was considered to have a seven-year remaining life with no salvage value. Shaun also held a copyright with a five-year remaining life on its books that was undervalued by $1,208,000. Any remaining excess cost was attributable to goodwill. Depreciation and amortization are computed using the straight-line method. Killearn applies the equity method for its investment in Shaun. Shaun's policy is to declare and pay a $1 per share cash dividend every April 1 and October 1. Shaun's income, earned evenly throughout each year, was $591,000 in 2016, $634,400 in 2017, and $682,400 in 2018. In addition, Killearn sold inventory costing $98,400 to Shaun for $164,000 during 2017. Shaun resold $117,000 of this inventory during 2017 and the remaining $47,000 during 2018. Determine the equity income to be recognized by Killearn during each of these years. Compute Killearn's investment in Shaun Company's balance as of December 31, 2018. Dwight is selling flowers and candles for a school fundraiser. Flowers, x, sell for $7 for a bouquet, and candles, y, sell for $5. each. If he wants to sell at least $200 worth of flowers and candles, which inequality represents the situation where he sells x flowers and y candles?A: 7x + 5y 200C: 7x + 5y 200D: 7x + 5y 200Please explain why the right answer choice is correct. Thanks. Write an algebraic expression for the phrase 6 times Z What was the Plessy V. Ferguson Supreme Court Case? Katie's deli can make 60 sandwiches in 4 hours. Stacy's can make double that in the same amount of time. How many sandwiches can Stacy's deli make in 6 hours help quicklyy pleasee A quarterback throws the ball to the wide receiver. The wide receiver fumbles the ball but still makes the touchdown. What is the force in this scenario? Explain. what is the answer to 2(1-x)=11 Select the verb form that correctly completes the sentence. Yo ___________ a una entrevista de trabajo el martes. A. iremos B. ir C. irs D. irn Which number represents the theater of war in which World War II officially came to an end? ) 1 B) 2 C)3 D)4 why is it when you take a shower and you come out clean, how does the towel become dirty? This some real mathematics Given the Old French root plier, meaning to bend, which word in bold means capable of being easily influenced?The jury members were insulted by the suggestion that they were pliable.It was not plausible that the vase broke by itself.The park was overrun by a plethora of pigeons.The shirt was quite difficult to iron because it was pleated. Please help, this is worth 15 points! 8. Read the statement below.[All political power is inherent in the people, and allfree governments are founded on their authority, andinstituted for their benefit.]The statement above reflects which of the following principles?answer choices above please help me with all the questions maybee?? Find the sales tax.... i need help with this question...2x + 3 13