Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write an If... Then... Else statement that displays the string \"Columbia\" in t

ID: 3817216 • Letter: W

Question

Write an If... Then... Else statement that displays the string "Columbia" in the lblCapital control when the txtState control contains the string "SC" (in any case). Write an if... Then... Else statement that displays the string "Please enter ZIP code" in lblMsg control when the txtZip control does not contain any data. Write an If... Then... Else statement that displays the string "Incorrect quantity" in the lblMsg control when the intQuantity variable contains a number that is less than otherwise, display the string "Valid quantity". Write an If... Then... Else statement that displays the string "Time to reorder" in the lblMsg control when the intInStock variable contains a number that is less than otherwise, display the string "We have enough in stock". Write an If... Then... Else statement that assigns the number 35 to the variable when the decSales variable contains a number that is less than or equal to $250; otherwise, assign the number 50.

Explanation / Answer

Hi Friend, You have not mentioned about programming language.

Please try to mention all required details.

I have answered in Java.


1)

   if(txtState.toLowerCase().contains("sc"))
       System.out.println("Columbia");

2)
   if(txtZip == null || txtZip.trim().equals(""))
       System.out.println("Please enter ZIP code");

3)
   if(intQuantity < 0)
       System.out.println("Incorrect quantity");
   else
       System.out.println("Valid quantity");

4)
   if(intInStock < 2){
       System.out.println("Time to reorder");
   }
   else{
       System.out.println("We have enough stock");
   }

5)
   if(decSales <= 250)
       intComission = 35;
   else
       intComission = 50;

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote